Use offline backup to restore Data in DB2.

Source: Internet
Author: User

Use offline backup to restore Data in DB2.

First, the data in the simulated table is damaged. --- Delete the data or clear the table.

DB2 => connect to mydb

 

Database connection information

 

Database Server = DB2/nt64 9.7.4

SQL authorization id = db2admin

Local Database alias = mydb

 

DB2 => select * from test

 

ID

----------

1

 

1 record selected.

 

DB2 => drop Table Test

The db20000i SQL command is successfully completed.

DB2 => select * from test

Sql0204n "db2admin. Test" is an undefined name. Sqlstate = 42704

 

 

Restore the table and its data.

DB2 => Restore database mydatabase fromd: \ backup taken at 20110925085106

Sql2539w warning! Restoring to the same existing database as the backup image database. The database file will be deleted.

 

 

Do you want to continue? (Y/n) y

The db20000i Restore database command is successfully completed.

DB2 => select * from test

Sql1024n does not have a database connection. Sqlstate = 08003

DB2 => connect to mydb

 

Database connection information

 

Database Server = DB2/nt64 9.7.4

SQL authorization id = db2admin

Local Database alias = mydb

 

DB2 => select * from test

 

ID

----------

1

 

1 record selected.

Recovery successful.

 

 

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.