Unix Technical Forum

newbie: backing up archived logs

This is a discussion on newbie: backing up archived logs within the DB2 forums, part of the Database Server Software category; --> We have a procedure to backup archived logs and then purge them. The backup product we use is Syncsort's ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 06:04 PM
Chuck
 
Posts: n/a
Default newbie: backing up archived logs

We have a procedure to backup archived logs and then purge them. The
backup product we use is Syncsort's Backup Express 2.1.5. We use a user
exit (db2uext2) to copy logs to the archive directory. The backup
procedure is essentially

1. force current log to be archived
2. Backup the archive directory
3. run "rm *" to purge the logs

I have concern that there is the possibility of a log being generated
after step 2 begins, not being backed up, and then being deleted by step
3. Is my convern valid?

One other question while I'm at it. What happens if the disk where the
archive directory fills up and db2 needs to archive another file? Will
the db hang?
--
Chuck
Remove "_nospam" to reply by email
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 06:05 PM
Ian
 
Posts: n/a
Default Re: newbie: backing up archived logs

Chuck wrote:

> We have a procedure to backup archived logs and then purge them. The
> backup product we use is Syncsort's Backup Express 2.1.5. We use a user
> exit (db2uext2) to copy logs to the archive directory. The backup
> procedure is essentially
>
> 1. force current log to be archived
> 2. Backup the archive directory
> 3. run "rm *" to purge the logs
>
> I have concern that there is the possibility of a log being generated
> after step 2 begins, not being backed up, and then being deleted by step
> 3. Is my convern valid?


This is definitely a valid concern, and it depends on how the backup
tool works -- i.e., it probably builds a list of files to back up
when it starts, so any files created after this get skipped.

It's safer to remove files that have not been modified for 1 day, but
only if your backup is successful.

> One other question while I'm at it. What happens if the disk where the
> archive directory fills up and db2 needs to archive another file? Will
> the db hang?


No, the user exit will fail and the files will remain in the active log
path. DB2 will have the retry the operation every 5 minutes.

If the filesystem holding the active log path fills, things are different-
this is controlled by the database configuration parameter BLK_LOG_DSK_FUL.
See: http://tinyurl.com/2mbez for more info.




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 06:05 PM
Chuck
 
Posts: n/a
Default Re: newbie: backing up archived logs

Ian <ianbjor@mobileaudio.com> wrote in
news:40ac46fe_1@corp.newsgroups.com:

> Chuck wrote:
>
>> We have a procedure to backup archived logs and then purge them. The
>> backup product we use is Syncsort's Backup Express 2.1.5. We use a
>> user exit (db2uext2) to copy logs to the archive directory. The
>> backup procedure is essentially
>>
>> 1. force current log to be archived
>> 2. Backup the archive directory
>> 3. run "rm *" to purge the logs
>>
>> I have concern that there is the possibility of a log being generated
>> after step 2 begins, not being backed up, and then being deleted by
>> step 3. Is my convern valid?

>
> This is definitely a valid concern, and it depends on how the backup
> tool works -- i.e., it probably builds a list of files to back up
> when it starts, so any files created after this get skipped.
>
> It's safer to remove files that have not been modified for 1 day, but
> only if your backup is successful.
>
>> One other question while I'm at it. What happens if the disk where
>> the archive directory fills up and db2 needs to archive another file?
>> Will the db hang?

>
> No, the user exit will fail and the files will remain in the active
> log path. DB2 will have the retry the operation every 5 minutes.
>
> If the filesystem holding the active log path fills, things are
> different- this is controlled by the database configuration parameter
> BLK_LOG_DSK_FUL. See: http://tinyurl.com/2mbez for more info.
>
>
>
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
>


Thanks.

On the archived log backup I decided to take a snapshot of the files in
that directory immediately prior to backing it up.

ls -1 $ARCHIVE_DIR/*.LOG > $ARCHIVE_DIR/files_to_delete

When the backup finishes I only remove the files captured by the
snapshot.

xargs rm < $ARCHIVE_DIR/files_to_delete
--
Chuck
Remove "_nospam" to reply by email
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 06:06 PM
ChetWest
 
Posts: n/a
Default Re: newbie: backing up archived logs

Chuck <chuckh_nospam@softhome.net> wrote in message news:<Xns94EFA5C58D5Echuckhsofthomenet@130.133.1.4 >...
> Ian <ianbjor@mobileaudio.com> wrote in
> news:40ac46fe_1@corp.newsgroups.com:
>
> > Chuck wrote:
> >
> >> We have a procedure to backup archived logs and then purge them. The
> >> backup product we use is Syncsort's Backup Express 2.1.5. We use a
> >> user exit (db2uext2) to copy logs to the archive directory. The
> >> backup procedure is essentially
> >>
> >> 1. force current log to be archived
> >> 2. Backup the archive directory
> >> 3. run "rm *" to purge the logs
> >>
> >> I have concern that there is the possibility of a log being generated
> >> after step 2 begins, not being backed up, and then being deleted by
> >> step 3. Is my convern valid?

> >
> > This is definitely a valid concern, and it depends on how the backup
> > tool works -- i.e., it probably builds a list of files to back up
> > when it starts, so any files created after this get skipped.
> >
> > It's safer to remove files that have not been modified for 1 day, but
> > only if your backup is successful.
> >
> >> One other question while I'm at it. What happens if the disk where
> >> the archive directory fills up and db2 needs to archive another file?
> >> Will the db hang?

> >
> > No, the user exit will fail and the files will remain in the active
> > log path. DB2 will have the retry the operation every 5 minutes.
> >
> > If the filesystem holding the active log path fills, things are
> > different- this is controlled by the database configuration parameter
> > BLK_LOG_DSK_FUL. See: http://tinyurl.com/2mbez for more info.
> >
> >
> >
> >
> > -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> > http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> > -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
> >

>
> Thanks.
>
> On the archived log backup I decided to take a snapshot of the files in
> that directory immediately prior to backing it up.
>
> ls -1 $ARCHIVE_DIR/*.LOG > $ARCHIVE_DIR/files_to_delete
>
> When the backup finishes I only remove the files captured by the
> snapshot.
>
> xargs rm < $ARCHIVE_DIR/files_to_delete


FWIW, After we transfer our logs to our contingency server, we tar
them up. We then have another process that are more than xx days old.

Chet
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:56 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com