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 > Verify Backups Automatically?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-05-10, 17:46
ServerGuy ServerGuy is offline
Registered User
 
Join Date: Aug 2010
Posts: 4
Verify Backups Automatically?

Coming from MSSQL DB2 is a huge pain in the ass. Im looking to do a backup of an entire database then verify the backup was successful and the bcakup could actually be restored if needed. I have the backup going automatically and i have noted the db2ckbkp and ran it manually on the backup files which it did complete successfully. BUT i need this to run automatically, i see that the Wizard has a notification feature but i need it at least to run a verify automatically and log it somewhere, i can write a script to check that automatically but because of the dynamic names with the database backups i cant find any way to have it check all database backups in a folder even. I have to manually specify the name of the backup in the check. Ive been trying to find a way to do this but DB2 support on the web seems limited. The guides are nice but the functionality of the program to do simple things seems limited. Any help would be appreciated.

Thanks!
Reply With Quote
  #2 (permalink)  
Old 08-05-10, 19:47
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
What OS are you running? With UNIX/Linux shell scripting, this is not all that difficult, but I don't anything about Windows scripting.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 08-05-10, 21:02
n_i n_i is online now
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
It is probably as easy to do on Windows, especially having installed GNU tools from GnuWin32, but you can't seriously expect database administrators and server guys to do that, can you? There must be a wizard for that.
Reply With Quote
  #4 (permalink)  
Old 08-06-10, 08:57
ServerGuy ServerGuy is offline
Registered User
 
Join Date: Aug 2010
Posts: 4
Windows platform, If someone has a script i can just schedule i can edit it to match my environment. Ive looked for a wizard within DB2 but cannot find one, even the backup option doesnt have a little check box for verify after backup.
Reply With Quote
  #5 (permalink)  
Old 08-06-10, 09:07
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
can anything be wrong with the backup file if backup completed successfully?

the only problems with backup files I get is when they are ftp'ed from other servers and ftp process was not completed successfully (person who does it does not do checks properly). then i check backup file using db2ckbkp in order to prove them that backup file was damaged in ftp process.
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS
Reply With Quote
  #6 (permalink)  
Old 08-06-10, 09:11
ServerGuy ServerGuy is offline
Registered User
 
Join Date: Aug 2010
Posts: 4
You never know, ive had cases where a drive has begun to fail after a backup was completed or it wrote to a bad cluster that was still semi-accessable but then if you tried to do a restore from it it fails. I want to check the file just before we do a file level backup over the network. Jobs have also been known to show successful but obviously did not finish correctly as the backup is only half of the normal size. Just merely need a secondary check to ensure the backup i have is a good one before going through the process of backing it up to another server.

Last edited by ServerGuy; 08-06-10 at 09:17.
Reply With Quote
  #7 (permalink)  
Old 08-06-10, 10:45
MarkhamDBA MarkhamDBA is offline
Registered User
 
Join Date: Dec 2008
Location: Toronto, Canada
Posts: 381
Quote:
Originally Posted by ServerGuy View Post
You never know, ive had cases where a drive has begun to fail after a backup was completed or it wrote to a bad cluster that was still semi-accessable but then if you tried to do a restore from it it fails.
on what platform? it has never happened on our AIX.

Quote:
Originally Posted by ServerGuy View Post
Jobs have also been known to show successful but obviously did not finish correctly as the backup is only half of the normal size.
what 'jobs'? do you mean your backup process finished with return code = 0 when it was not really successful? again i never had cases like this on our AIX.
__________________
DB2 v9.5 ESE on AIX v6.1/ v9./10 on z/OS

Last edited by MarkhamDBA; 08-06-10 at 11:10.
Reply With Quote
  #8 (permalink)  
Old 08-06-10, 11:24
ServerGuy ServerGuy is offline
Registered User
 
Join Date: Aug 2010
Posts: 4
Windows platform, Server 2008 32bit, Task center showed a task completed successfully, we went to restore the database and it failed on the restore, after looking at the most recent backup and past backups, the most recent one was only half the size of the normal daily backups. Besides if backups always worked properly we wouldnt really need the db2ckbkp command.

All I'm really looking to do is backup the entire database on our server to the file system, then have the backup verified that it is a functional backup (i.e. can be restored successfully) then let me know in some way that the verify completed successfully. Then using a 3rd party app I want to pull the file that was backed up from the DB2 server to our backup file server. In MSSQL all i do is check a box that says "Verify backup after completion" Is it really this difficult in DB2?

Also on a side note, the current command we use for backing up the database in question is below, am I correct in thinking that with this command it also packages the logs with the file so that if the entire server fails all we need is this single .001 file?

BACKUP DATABASE dbname ONLINE TO "F:\DBBackup" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 COMPRESS INCLUDE LOGS WITHOUT PROMPTING;
Reply With Quote
  #9 (permalink)  
Old 08-06-10, 11:31
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
I would omit the following parms, since newer versions of DB2 will determine the optimum values for you:
WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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