If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB Backup / Restore strategy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-06-08, 15:54
db2user db2user is offline
Registered User
 
Join Date: Dec 2002
Posts: 123
DB Backup / Restore strategy

Hi,

I'm just wondering if this backup/restore setup will work...we have a production db and backup db. The production db has a full backup done on the 1st Sunday of every month and an incremental for the rest of the days.

We plan to copy over the backup images (with the logs included as a part of the image) to our backup server every night and then perform a restore.

If I try the full restore and an automatic incremental restore after, it works fine but fails to successfully restore the next incremental image after that. (I'm assuming this is because an automatic incremental restore 'always' requires a full backup image restore first?)

This currently does not work ---

1.
(FULL BACKUP RESTORE -- THIS PART WORKS FINE)
db2 restore db dbname from /dir1/ taken at 20080906050002 logtarget /home/dir2/logs/

db2 rollforward db dbname to end of logs and stop overflow log path \(/home/dir2/logs\)

2.
(INCREMENTAL BACKUP RESTORE -- THIS PART WORKS FINE)
db2 restore db dbname incremental automatic from /dir1/ taken at 20080928050002 logtarget /home/dir2/logs/ REPLACE EXISTING

db2 rollforward db dbname to end of logs and stop overflow log path \(/home/dir2/logs\)

3. (INCREMENTAL BACKUP RESTORE -- THIS PART FAILS)
db2 restore db dbname incremental automatic from /dir1/ taken at 20080929050002 logtarget /home/dir2/logs/ REPLACE EXISTING

db2 rollforward db dbname to end of logs and stop overflow log path \(/home/dir2/logs\)


I'm assuming this will work (without the automatic keyword)---

1. db2 restore db dbname from /dir1/ taken at 20080906050002 logtarget /home/dir2/logs/

db2 rollforward db dbname to end of logs and stop overflow log path \(/home/dir2/logs\)

2. db2 restore db dbname incremental from /dir1/ taken at 20080928050002 logtarget /home/dir2/logs/ REPLACE EXISTING

db2 rollforward db dbname to end of logs and stop overflow log path \(/home/dir2/logs\)

3. db2 restore db dbname incremental from /dir1/ taken at 20080929050002 logtarget /home/dir2/logs/ REPLACE EXISTING

db2 rollforward db dbname to end of logs and stop overflow log path \(/home/dir2/logs\)

Please correct me if I'm wrong.. thanks!

Last edited by db2user; 10-06-08 at 16:02.
Reply With Quote
  #2 (permalink)  
Old 10-07-08, 01:55
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
if using incremental - you should only restore the base/full backup and last incremental backup. if using delta backup you need to restore the full and each delta. you can also use the recover command
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 10-07-08, 11:12
db2user db2user is offline
Registered User
 
Join Date: Dec 2002
Posts: 123
Quote:
Originally Posted by przytula_guy
if using incremental - you should only restore the base/full backup and last incremental backup.
Hi..do you mean that if you're using 'incremental automatic' then you should only restore the base/full backup and last incremental backup? I thought this method was used if using the 'automatic' option. And if I'm using simply incremental (no automatic keyword).. why won't it work if I restore each incremental backup daily? Thank you!
Reply With Quote
  #4 (permalink)  
Old 10-08-08, 02:00
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
the incremental keeps the modifications from last backup - second incremental has data from first incremental and changes after incremental....
delta keeps modifications from last delta only
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #5 (permalink)  
Old 10-08-08, 07:51
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I suggest you read the manual about restoring from the incremental backup. If you don't use the AUTOMATIC keyword, you have to specify the backup images yourself in the correct order: latest incremental, full (base), first incremental, second..., last incremental. Obviously, you only do a rollforward once, when the entire restore is complete.
Reply With Quote
  #6 (permalink)  
Old 10-08-08, 17:02
db2user db2user is offline
Registered User
 
Join Date: Dec 2002
Posts: 123
thanks for the replies.. am aware that if you don't use the AUTOMATIC keyword, then all the backup images between the full and last incremental must be restored in order.. the problem is that I want to do a restore of the latest incremental on a daily basis on our backup server... it seems like the delta option might work in this case?
Reply With Quote
  #7 (permalink)  
Old 10-08-08, 17:12
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
The INCREMENTAL DELTA backups will work absolutely in the same manner as the INCREMENTAL, because they _are_ incremental.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On