Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Backup

  1. #1
    Join Date
    Jan 2009
    Posts
    153

    Unanswered: Backup

    Hi Experts,

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

    TIA

  2. #2
    Join Date
    Jan 2009
    Posts
    153
    Please tell how to restore the backups

    TIA

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

  4. #4
    Join Date
    Jan 2009
    Posts
    153
    Thanks Andy,

    How to configure a database to take incremental backup?

    TIA

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5

  6. #6
    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

  7. #7
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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.

  8. #8
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Double check that you're looking at the db cfg and not dbm cfg.

  9. #9
    Join Date
    Jan 2009
    Posts
    153
    Thanks Bella,


    You are right I was checking dbm cfg..

    enabled trackmod ...

  10. #10
    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

  11. #11
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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

  12. #12
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  13. #13
    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.

  14. #14
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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.

  15. #15
    Join Date
    Nov 2005
    Location
    IL
    Posts
    557
    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.7.0.6 os 6.1.0.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •