Db2 database restoration command

Source: Internet
Author: User

Db2 database restoration command 1. the names of the backup database (olddb) and the data to be restored (newdb) are different: db2 restore db olddb into newdb; www.2cto.com 2. multiple backup files exist in the current directory. you need to specify the time for db2 restore db olddb taken at 20120819175932 into newdb; 3. you need to specify the directory of the backup file db2 restore database olddb FROM "/media/olddb.0.db2inst1. node.zip catn=.20120819175932.001 "taken at 20120819175932 INTO newdb; 4. you must specify newdb NEWLOGPATH to the db2 restore database olddb FROM "/media/olddb.0.db2inst1. nodedesk.catndesk.20120819175932.001 "taken at 20120819175932 NEWLOGPATH"/opt/log "WITH 2 buffers buffer 1024 INTO newdb; www.2cto.com 5. 1 ). create the folder mkdir/home/db2inst1/db2space/newdb_sp0; mkdir/home/db2inst1/db2space/newdb_sp1; mkdir/home/db2inst1/db2space/newdb_sp2; mkdir/home/db2inst1/db2space/newdb_sp3; mkdir/home/db2inst1/db2space/newdb_sp4; mkdir/home/db2inst1/db2space/newdb_sp5; mkdir/home/db2inst1/db2space/release; 2 ). add the RESTORE command to redirect without rolling forward db2 restore database olddb FROM "/media/olddb.0.db2inst1. nodeapps.catnapps.20120819175932.001 "taken at 20120819175932 NEWLOGPATH"/opt/log "WITH 2 buffers buffer 1024 INTO newdb redirect without rolling forward; 3 ). SET the TABLESPACE directory set tablespace containers for 0 ignore rollforward container operations using (PATH "/home/db2inst1/db2space/newdb_sp0 "); set tablespace containers for 1 ignore rollforward container operations using (PATH "/home/db2inst1/db2space/newdb_sp1 "); set tablespace containers for 2 ignore rollforward container operations using (PATH "/home/db2inst1/db2space/newdb_sp2 "); set tablespace containers for 3 ignore rollforward container operations using (PATH "/home/db2inst1/db2space/newdb_sp3 "); set tablespace containers for 4 ignore rollforward container operations using (PATH "/home/db2inst1/db2space/newdb_sp4 "); set tablespace containers for 5 ignore rollforward container operations using (PATH "/home/db2inst1/db2space/newdb_sp5 "); set tablespace containers for 6 ignore rollforward container operations using (PATH "/home/db2inst1/db2space/newdb_sp6"); 3 ). resume. pay attention to the olddb restore database olddb CONTINUE; 6. the database is restored and returned to the db2 restore db. Note that it is olddb abort 7. after restoration, if NEWLOGPATH needs to change the db2 update db cfg for newdb using newlogpath/db2/db2inst1/db2logpath db2 update db cfg for newdb using logfilsiz 10001 db2 force applications all; db2stop; db2start; send an email to the lyc557@163.com for help

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.