DB2 database online backup recovery practices

Source: Internet
Author: User

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

 
 
  1. db2 update db cfg for test using LOGRETAIN ON 

Set the log archiving directory

 
 
  1. 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.

 
 
  1. 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)

 
 
  1. db2 backup db test online to /db2/data/backup/ include logs 

Online backup-do not back up logs

 
 
  1. db2 backup db test online to /db2/data/backup/ 

Recover from a backup set containing logs

Restore

 
 
  1. db2 RESTORE db test  
  2. FROM /db2/data/backup taken at 20100514001917 LOGTARGET /db2/data/logs/ 

Roll Forward

 
 
  1. 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

 
 
  1. db2 RESTORE db test  
  2. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.