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 )"