Example of DB2 Backup Recovery

Source: Internet
Author: User

The following CMDB is the name of the db2 database. This article has been verified by the test environment.

1. Online Database Backup

Archive not included:
Db2 backup db cmdb online to [path name]

Include archive:
Db2 backup db cmdb online to [path name] include logs

2. offline database backup

Db2 backup db cmdb to [path name]

3. Recovery from different databases (the backup source is offline backup)
Db2 "restore db cmdb from [path name] replace existing without rolling forward"
4. Recovery from different databases (the backup source is online backup)

Use on PATH redirect to relocate the tablespace PATH:
Db2 "restore db cmdb from [path name] on [path name] logtarget/tmp replace existing redirect"
 
View the tablespace and modify the tablespace and data files without redirection:
Db2pd-db cmdb-tablespace

Db2 "set tablespace containers for 3 using
(Path '/db2sys/db2inst1/NODE0000/CMDB/userspace2 ')"

Db2 "set tablespace containers for 5 using
(File '/db2sys/db2inst1/NODE0000/CMDB/CMSEXT001.LRG' 32736, File '/db2sys/db2inst1/NODE0000/CMDB/CMSEXT002.LRG' 32736 )"
 
Start recovery:
Db2 restore db cmdb continue


Restore archived logs:
Db2 "rollforward db cmdb to end of logs and stop overflow log path (/tmp/logs )"

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.