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 including logs

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-09, 06:17
Mathew_paul Mathew_paul is offline
Registered User
 
Join Date: Oct 2007
Posts: 200
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
Reply With Quote
  #2 (permalink)  
Old 10-21-09, 08:11
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #3 (permalink)  
Old 10-22-09, 03:07
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
Quote:
Originally Posted by Mathew_paul
Kindly correct me on this
No! You're right. An online-backup-image without the logs is useless.
Reply With Quote
  #4 (permalink)  
Old 10-22-09, 18:35
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
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.
Reply With Quote
  #5 (permalink)  
Old 10-24-09, 11:48
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
since 9.5 this is by default : include logs
it does not need to be specified
__________________
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
  #6 (permalink)  
Old 12-23-09, 11:58
hazy_dba hazy_dba is offline
Registered User
 
Join Date: Dec 2009
Posts: 40
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?
Reply With Quote
  #7 (permalink)  
Old 12-23-09, 13:02
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #8 (permalink)  
Old 12-23-09, 15:55
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
"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.
Reply With Quote
  #9 (permalink)  
Old 12-24-09, 06:01
hazy_dba hazy_dba is offline
Registered User
 
Join Date: Dec 2009
Posts: 40
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.
Reply With Quote
  #10 (permalink)  
Old 12-30-09, 07:10
dr_te_z dr_te_z is offline
Registered User
 
Join Date: Jan 2009
Location: Zoetermeer, Holland
Posts: 555
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.
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