The following articles mainly describe the online backup recovery of the DB2 database. If you are interested in the actual online backup recovery operations of the DB2 database, you can click to view the following articles. The following describes the specific solution and hope it will be helpful for your future study.
Database, practice, online database, practice, online
Enable online backup
Enable log Archiving
- db2 update db cfg for test using LOGRETAIN ON
Set the log archiving directory
- db2 update db cfg for test using LOGARCHMETH1 DISK:/db2/data/logs
Make an offline backup; otherwise, the DB2 database will not be able to log on.
- db2 backup db test to /db2/data/backup
Online backup
Online backup-the first activity log in the backup log will be backed up to the backup file together)
- db2 backup db test online to /db2/data/backup/ include logs
Online backup-do not back up logs
- db2 backup db test online to /db2/data/backup/
Recover from a backup set containing logs
Restore
- db2 RESTORE db test
- FROM /db2/data/backup taken at 20100514001917 LOGTARGET /db2/data/logs/
Roll Forward
- db2 "rollforward db test to end of logs and stop overflow log path(/db2/data/logs/)"
Note that other archive logs are generated at intervals from the backup success to database v crash. You can copy these logs to/db2/data/logs, or you can directly roll back from the archive log directory, the same as "Roll Back" in "Backup set recovery without logs ")
Recover a backup set that never contains logs
Restore
- db2 RESTORE db test
- FROM /db2/data/backup taken at 20100514001917
Roll Forward
Db2 "rollforward db test to end of logs and stop overflow log path (/archive log directory /)"
The above content is an introduction to the online backup and recovery practices of the DB2 database. I hope you will have some gains.
The above content is a description of the online backup recovery practices of the DB2 database, hoping to help you in this regard.