DB2 database Backup and Recovery

Source: Internet
Author: User

D The following steps are built in the B2 environment:

1. Su–db2inst Note '-' There will be errors in the back ;

2. DB2 into the DB2 command line mode ;

3. Create DATABASE pb_db on/home/db2inst using codeset GBK territory ZH_CN pagesize 8192--- build library ;

4. Connect to pb_db --- connection ;

5. Create Bufferpool testpool size pagesize 32k-- temporary tablespace buffer pool ;

6. Create temporary tablespace temp pagesize 32k managed by database using (file ' \home\db2inst1\rdl\data ' 500 0) extentsize Bufferpool testpool -- temporary table space ;

7. Create Bufferpool pbloop Immediate size pagesize 32k-- user table space buffer pool ;

8. Create regular tablespace pbxt pagesize 32k managed by database using (file ' \home\db2inst1\rdl\data\user ' 102 4M) AutoResize no extentsize, overhead 10.5 prefetchsize, transferrate 0.14 bufferpool pbloop -- user table space


DB2 Database backup steps are as follows:

1. Make sure no user is using DB2:

DB2 list applications for DB pb_db;

2. Shut down the database and reboot to disconnect all connections:

Db2stop Force

Db2start;

3. Execute backup command: (using TSM as backup media)

DB2 Backup DB pb_db use TSM backups are successful, a timestamp will be returned

DB2 Backup DB pb_db to/home/db2inst1/rdl/data backing up the database in the data folder generates a 001 file

Db2The database recovery steps are as follows:

1. Check the memo history:

DB2 List History backup all for pb_db;

2. Restore data at a point in time:

DB2 RESTORE DATABASE pb_db From/home/db2inst1/rdl/data taken at 20140625141510

A warning will be displayed, and completing the y will restore


Building database backup and recovery for DB2 databases

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.