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 > Backup

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-30-09, 06:10
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Backup

Hi Experts,

What are all the types of backup in DB2?
Is it possible to take differential backup?

TIA
Reply With Quote
  #2 (permalink)  
Old 07-30-09, 06:16
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Please tell how to restore the backups

TIA
Reply With Quote
  #3 (permalink)  
Old 07-30-09, 08:38
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
There are online and offline backups. Then there are full backups, incremental (everything that changed since the last full), and incremental delta (everything that changed since the last backup of any kind).

You restore using the, believe it or not, RESTORE command.

IBM DB2 9.5 Information Center for Linux, UNIX, and Windows

IBM DB2 9.5 Information Center for Linux, UNIX, and Windows

Andy
Reply With Quote
  #4 (permalink)  
Old 07-30-09, 09:56
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Thanks Andy,

How to configure a database to take incremental backup?

TIA
Reply With Quote
  #5 (permalink)  
Old 07-30-09, 09:59
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Reply With Quote
  #6 (permalink)  
Old 07-30-09, 13:00
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Thanks AGAIN Saurabh,

I am getting the error
SQL2426N The database has not been configured to allow the incremental backup
operation. Reason code = "1".

I am using DB2 9.5C Express and I didn't find TRACKMOD in database configuration manager.

Is it possible to take incremantal backup or delta backup in DB2 9.5C EXPRESS & 9.7C EXPRESS

TIA
Reply With Quote
  #7 (permalink)  
Old 07-30-09, 23:36
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
I think the best is to follow Marcus's advice from your other post and ask this question on the DB2 Express-C forum. If you don't see trackmod in the db cfg output, then I guess incremental backups are not supported in your free version.
Reply With Quote
  #8 (permalink)  
Old 07-30-09, 23:42
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Double check that you're looking at the db cfg and not dbm cfg.
Reply With Quote
  #9 (permalink)  
Old 07-31-09, 01:49
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Thanks Bella,


You are right I was checking dbm cfg..

enabled trackmod ...
Reply With Quote
  #10 (permalink)  
Old 07-31-09, 02:44
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Hi Bella,

I have restore the fullbackup and then restore the incremental backup with incremental option now am getting the error below.

A connection to or activation of database "DBA" cannot be made
because a previous restore is incomplete or still in progress.

Can you please tell how to restore the backups if i have a full backup and seven incremental backups?

TIA
Reply With Quote
  #11 (permalink)  
Old 07-31-09, 07:18
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
You need to restore full followed by incremental and full again. The incremental parameter has to be used with all commands. Or just let db2 determine the sequence and restore the required images using the incremental + automatic parameters. Please check the following links:

Using DB2 Incremental Backup

IBM DB2 9.5 Information Center for Linux, UNIX, and Windows
Reply With Quote
  #12 (permalink)  
Old 07-31-09, 08:31
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
There have been many replies, directing to info center...
could you not find it ? or is it easier to request the info from forum than read it in info center ????
__________________
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
  #13 (permalink)  
Old 08-06-09, 05:20
ratheeshknair ratheeshknair is offline
Registered User
 
Join Date: Jan 2009
Posts: 153
Hi Guy Przytula,

I didnt see any proper example/any proper description on how to restore an incremental backup .May be i dint understand from all those stuff.

I have taken a full backup then an incremental

I need to restore to another database with i did but am not able to access the database as its giving error that the restore is not complete..i checked with the error number but didnt get a proper writings.
Reply With Quote
  #14 (permalink)  
Old 08-06-09, 11:37
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Here is an example of how to perform incremental restore. My test was done in a multi-partitioned env so just skip the second node. The easiest is to use automatic incremental restore process. If you want to learn how to do it manually, then use db2ckrst to help you with the sequence.


I have 2 nodes:

- Enable incremental backup and take a full backup on every node

test@panipuri /home/test > export DB2NODE=1
test@panipuri /home/test > db2 terminate
DB20000I The TERMINATE command completed successfully.

test@panipuri /home/test > db2 update db cfg for sample using trackmod on
DB20000I The UPDATE DATABASE CONFIGURATION command completed
successfully.

test@panipuri /home/test > db2 backup db sample

Backup successful. The timestamp for this backup image is :
20070703112524


test@panipuri /home/test > export DB2NODE=2
test@panipuri /home/test > db2 terminate
DB20000I The TERMINATE command completed successfully.

test@panipuri /home/test > db2 update db cfg for sample using trackmod on
DB20000I The UPDATE DATABASE CONFIGURATION command completed
successfully.

test@panipuri /home/test > db2 backup db sample

Backup successful. The timestamp for this backup image is :
20070703112748

test@panipuri /home/test > ls -l SAMPLE*
-rw-r----- 1 test build 18116608 Jul 03 11:25 SAMPLE.0.test.NODE0001.CATN0002.20070703112524.001
-rw-r----- 1 test build 54308864 Jul 03 11:28 SAMPLE.0.test.NODE0002.CATN0002.20070703112748.001


- Take incremental backup

test@panipuri /home/test > export DB2NODE=1
test@panipuri /home/test > db2 terminate
DB20000I The TERMINATE command completed successfully.

test@panipuri /home/test > db2 backup db sample incremental

Backup successful. The timestamp for this backup image is :
20070703112926


test@panipuri /home/test > export DB2NODE=2
test@panipuri /home/test > db2 terminate
DB20000I The TERMINATE command completed successfully.

test@panipuri /home/test > db2 backup db sample incremental

Backup successful. The timestamp for this backup image is :
20070703112953

test@panipuri /home/test > ls -l SAMPLE*
-rw-r----- 1 test build 18116608 Jul 03 11:25 SAMPLE.0.test.NODE0001.CATN0002.20070703112524.001
-rw-r----- 1 test build 9068544 Jul 03 11:29 SAMPLE.0.test.NODE0001.CATN0002.20070703112926.001
-rw-r----- 1 test build 54308864 Jul 03 11:28 SAMPLE.0.test.NODE0002.CATN0002.20070703112748.001
-rw-r----- 1 test build 9068544 Jul 03 11:30 SAMPLE.0.test.NODE0002.CATN0002.20070703112953.001


- Let's say, I want to restore my incremental backup.

To restore, you need to start with the final image (incremental backup), then restore full offline backup followed by an incremental image again. The final image has to be restored twice. You can use the db2ckrst utility to determine the sequence of backup images that you need to restore. For example:

test@panipuri /home/test > db2ckrst -d sample -t 20070703112953

Suggested restore order of images using timestamp 20070703112953 for
database sample.
================================================== ==================
restore db sample incremental taken at 20070703112953
restore db sample incremental taken at 20070703112748
restore db sample incremental taken at 20070703112953
================================================== ==================

This is the sequence of backup images you need to restore if you were to do it manually. You can also use automatic incremental restore and in this case you only need to specify the target image on the restore command and DB2 will determine the required backup images and restore them. For example:

test@panipuri /home/test > export DB2NODE=1
test@panipuri /home/test > db2 terminate
DB20000I The TERMINATE command completed successfully.

test@panipuri /home/test > db2 restore db sample incremental automatic taken at 20070703112926
SQL2539W Warning! Restoring to an existing database that is the same as
the backup image database. The database files will be deleted.
Do you want to continue ? (y/n) y
DB20000I The RESTORE DATABASE command completed successfully.


test@panipuri /home/test > export DB2NODE=2
test@panipuri /home/test > db2 terminate
DB20000I The TERMINATE command completed successfully.

test@panipuri /home/test > db2 restore db sample incremental automatic taken at 20070703112953
SQL2539W Warning! Restoring to an existing database that is the same as
the backup image database. The database files will be deleted.
Do you want to continue ? (y/n) y
DB20000I The RESTORE DATABASE command completed successfully.
Reply With Quote
  #15 (permalink)  
Old 08-06-09, 11:40
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
maybe it is a good time to actually read how restore in DB2 works. It is all there.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
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