Veritas NetBackup™ for DB2 Administrator's Guide
- Introduction to NetBackup for DB2
- Installing NetBackup for DB2
- Verifying the operating system and platform compatibility
- About log archiving
- Configuring NetBackup for DB2
- About configuring a backup policy for DB2
- About adding backup selections to a DB2 policy
- About backing up archive log files with the user exit program
- Configuring the run-time environment
- Creating a db2.conf file for use with the user exit program
- Creating a db2.conf file (vendor method)
- Configuring bp.conf files in a cluster environment
- About NetBackup for DB2 templates and shell scripts
- Creating DB2 scripts manually
- Performing backups and restores of DB2
- About user-directed backups
- Performing a database restore
- About an alternate restore
- Using Snapshot Client with NetBackup for DB2
- About NetBackup for DB2 with Snapshot Client operations
- Restoring NetBackup for DB2 from a snapshot backup
- About configuring NetBackup for DB2 block-level incremental backups on UNIX
- Configuring policies for BLI backups with NetBackup for DB2
- About Snapshot Client effects
- Troubleshooting NetBackup for DB2
- About the NetBackup for DB2 log files
- Appendix A. Configuration for a DB2 EEE (DPF) environment
- Appendix B. Using NetBackup for DB2 with SAP®
- Appendix C. Register authorized locations
Recovering a DB2 database - Restoring archive logs
You can use the procedure in this section if you need to restore the archive logs before you perform the roll-forward.
Use the procedure in this section to restore the archive logs manually if the following situations exist:
If the archive logs are not in the standard locations. When this situation exists, NetBackup cannot perform a seamless restore of DB2. You may have moved one or more of the needed archive logs to secondary storage such as tape, network storage, or some other location. For example, if ARCFUNC COPY is in effect and the old archive logs were moved to tape, perform procedure in this section.
If ARCFUNC COPY was in effect in the db2.conf file at the time the archive logs were backed up and the ARCDIR and RETDIR parameters specify two different locations.
If PARTITIONTYPE RAW was in effect in the db2.conf file for some (not all) of the archive log backups.
For more information about the DB2 commands, see your DB2 documentation.
To restore a DB2 database when the archive logs are in a non-standard location
- Restore the database.
Issue the DB2 RESTORE DATABASE command to restore the database itself. For example:
Windows: db2 restore db db_name load install_path\NetBackup\bin\nbdb2.dll
where db_name is the name of the DB2 database you are to restore.
UNIX: db2 restore db db_name load /usr/openv/netbackup/bin/lib
Name of the DB2 database.
Full path to the NBDB2 library.
- Use NetBackup to browse the archive logs.
If a restore requires log files that are backed up from a file system and log files that are backed up from a raw device, retrieve the logs from the file system manually.
You can use the Backup, Archive, and Restore interface or the bplist command to browse the archive logs and find those missing from the restore directories.
If PARTITIONTYPE RAW is specified in the db2.conf file, the user exit program looks for only those logs when you perform the restore. The missing logs are those that were written when PARTITIONTYPE RAW was not in effect.
- Use operating system commands to copy the missing archive logs to the correct locations in your operating system. For example:
On Windows, use your mouse to copy the files from one location to another.
On UNIX, use the cp command.
If ARCFUNC COPY is in effect and the ARCDIR and RETDIR parameters specify different locations, copy the logs in the ARCDIR directory to the RETDIR directory. If ARCDIR and RETDIR specify the same location, you do not have to take any action. If some of the log files have been moved to secondary storage, restore these files to the RETDIR directory.
- Use NetBackup to restore the archive logs.
Use either the NetBackup Backup, Archive, and Restore interface or the bprestore command. For example:
Windows: bprestore install_path\vedb2\db2\v8\db2V82d\NODE0000\SQL0001\SQLOGDIR\S00009.LOG
UNIX: bprestore /vedb2/db2/v8/db2V82d/NODE0000/SQL0001/SQLOGDIR/S00009.LOG
- Bring the database online.
When the roll-forward is initiated, DB2 sends a request to NetBackup to restore the log files it needs. DB2 then reapplies the transaction information in the archive logs since the last full backup was performed. DB2 brings back the database online.
For example, you can use the following command options if PARTITIONTYPE RAW was not specified when any of the log files were backed up:
db2 rollforward db sample to end of logs and stop
The ROLLFORWARD DATABASE command issues messages if it cannot locate all the archive log files it needs. If you receive these messages, browse and restore the missing archive log files, and issue the ROLLFORWARD DATABASE command again.
After the database is successfully restored, the ROLLFORWARD DATABASE command restores and reapplies the transactions that are recorded in the archive log files since the last backup was performed. For example, if the backup image was created 10 days ago and restored today, the log files are used to restore transactions that occurred after the backup.