Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2007
    Posts
    246

    Unanswered: backup including logs

    hi all

    Its always safe the use include logs in online backup in case we lose the remaining logs we can bring the db back to working condition with lose of some data. Kindly correct me on this

    My question is if we don,t use the options include logs and my logs files gets corrupted, there is no options to bring the db back to working condition
    i have tried lots of options like
    rollforward db dbname stop
    complete, cancel nothing works
    its just a test envi
    kindly suggest
    redgs
    Paul

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You are correct. When you do an online backup, you will need some logs to be able to rollforward the database after a restore in order to have a workable DB. The "INCLUDE LOGS" option on the backup will insure that you have the minimum logs to be able to rollforward the DB.

    Andy

  3. #3
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Quote Originally Posted by Mathew_paul
    Kindly correct me on this
    No! You're right. An online-backup-image without the logs is useless.

  4. #4
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    You can unload most of the data using db2dart /ddel option. This is in case if you can't connect to the db because it's in a rollforward pending state.

  5. #5
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    since 9.5 this is by default : include logs
    it does not need to be specified
    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

  6. #6
    Join Date
    Dec 2009
    Posts
    43
    Quote Originally Posted by dr_te_z View Post
    No! You're right. An online-backup-image without the logs is useless.
    I am pretty new to db2!

    I am using db2 ver 8.1. I have recently changed a database from circular logging to archive logging so that we can have online backups.

    I have used the Control Center to set up an automated backup task that can run from 10pm onwards and pretty much leaving it to get on with it for now.

    However - how do I know if the backup is including logs or not?

    Also, when you say "An online-backup-image without the logs is useless" do you mean an online backup without the include logs parameter is useless OR an online backup without the include logs parm and any archive logs kept elsewhere to rollforward with is useless?

  7. #7
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by hazy_dba View Post
    However - how do I know if the backup is including logs or not?
    The "INCLUDE LOGS" clause is present in the BACKUP command.

    Quote Originally Posted by hazy_dba View Post
    Also, when you say "An online-backup-image without the logs is useless" do you mean an online backup without the include logs parameter is useless OR an online backup without the include logs parm and any archive logs kept elsewhere to rollforward with is useless?
    If you do not have access to the logs from either including the minimum in the backup image using the INCLUDE LOGS clause, or have access to them by other means then the backup image is useless. You cannot make a usable database from it.

    Andy

  8. #8
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    "include logs" became available with v8.2 (starting with v8 fp7). You can check the backup command, as Andy suggested, or use db2ckbkp. For example:

    db2ckbkp -h <backup image> | grep -i include

    If "Includes Logs" is 0, logs are not included. If 1, logs are included.

  9. #9
    Join Date
    Dec 2009
    Posts
    43
    Andy - thank you for your clarification.

    Quote Originally Posted by db2girl View Post
    "include logs" became available with v8.2 (starting with v8 fp7). You can check the backup command, as Andy suggested, or use db2ckbkp. For example:

    db2ckbkp -h <backup image> | grep -i include

    If "Includes Logs" is 0, logs are not included. If 1, logs are included.
    db2girl - that is a really useful command. I tried it on my backup and it did include the logs.

  10. #10
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Do not forget to specify the location of those logfiles in the restore command (the LOGTARGET keyword). Otherwise they will be left in the backup-image.

Posting Permissions

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