Database recovery is very important. This article will explain how to use the command line tool to restore the DB2 database, including the example of using the command line tool for your reference.
1. Disable "Control Center"
2. Open "IBM DB2"-"
When there is a recovery pending problem, no matter what I do in the control center is useless, but the command line directly to restore the OK, or command powerful
C:\USERS\ADMINISTRATOR>DB2 Rollforward DB FMS to end of logs
sql1119n cannot connect or activate the database "FMS" because the previous restorat
" 12500)----(can be no, if the restore error is added)DB2 Restore DB JMAM_DQ continue4. Copying log filesAfter the last command succeeds, view the directory path, d:\db2\node0000\sql0000*\sqlogdir\, copy the log file in jmam_dq.0 toIn the destination folder. (If the path is
. Disconnect the database
DB2 Force application All
6. Connecting to the database
DB2 Connect to
7. Disconnect the database
Disconnect Current Database connection: DB2 connect reset
Or: DB2 Disconnect current
Disconnect all databases: DB2 disconnect All
8. Ba
When our DB2 database suffers database corruption due to some serious errors (such as storage corruption), we usually need to fix the related errors, use the Restore command to Restore the database (DB2 also supports high system availability through multi-machine fault toler
applications All disconnect all database connections
Viii. Backup Database
1. DB2 Backup DB Btpdbs2, Db2move Btpdbs Export
Copy Code code as follows:
db2look-d btpdbs-e-X [-a]-o crttbl.sql
ix. Recovery of the database
1. DB2 restore DB Btpdbs without rolling forward2, DB2-TVF Crtdb.sqlCrtdb.sql F
Tables for system17. List User Tables#db2 List Tables for user18. List specific user tables#db2 list tables for schema [user]19. Create a new table (T1) with the same structure as a table (T2) in the database#db2 CREATE table T1 like T220. Import data from one table T1 to another table T2#db2 "INSERT INTO T1 select *
command27. Online BACKUP Database#db2-v BACKUP DATABASE 28. Restore the Database#db2 Restore DB 29. Online Recovery Database#db2 "RESTORE DB #db2 "Rollforward DB 30. Export Data File#d
application All6. Connecting to the databaseDB2 Connect to 7. Disconnect the databaseDisconnect Current Database connection: DB2 connect resetOr: DB2 Disconnect currentDisconnect all databases: DB2 disconnect All8. Backing Up the databaseDB2 Backup DB Note: You need to disconnect the database before you perform the above command9. Restoring the DatabaseDB2
Tags: int version su-ble command file copy Ace Eve calculation The database used by the company is Kanakura and DB2 To open the DB2 directly with the command window, you need to enter it in CMD: db2cmd 1: start DB2 database: Db2start 2: Connect to Database:
When you use the restore command to restore a database, the command line shows that the database is restored successfully,
C: Documents and SettingsAdministrator> db2 restore database XXX from "D:
/db2inst1/on_back // perform incremental backup online
11. db2 list history backup all for // view backup records
12. db2 get db cfg for // view the location of the log, cp to a secure directory for rollforward use.
13. db2stop force; db2start; db2 drop db // manually drop the database to simulate disaster recovery
3. Res
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
The following articles mainly describe how to back up and restore the DB2 database, including setting archiving parameters, online database backup, and offline database recovery, I hope you will have a better understanding of it.
Database
Step 1. Set archiving parameters:
1. db2 update db cfg for using implements logpath/home/db2inst1/mirror_log // mirror log
Disconnect the current database connection:
DB2 Connect reset or: DB2 disconnect current
To disconnect all database connections:
DB2 Disconnect All
8. Backing Up the database
DB2 Backup DB
Note: You need to disconnect the database before you perf
1, close DB2.
Db2stop or db2stop force.
Write two of the scripts in general, avoiding the use of Db2stop force commands, such as:
Db2stop
Db2stop Force
2, start DB2
Db2start
3, create the database
DB2 Create DB
or DB2 create DB using CodeSet GBK territory CN
4, delete the database
Be careful to do this.
PS: Need to enter DB2 's account before executing the command: Su db2inst1Modify Password: Change the corresponding operating system password, Windows can change db2admin password, linux change db2inst1 password can be, DB2 's database password is tied to the operating system, as you can say, only need to modify the user's password on the operating system. You wa
The following articles describe how to restore and Delete tables in DB2. In actual operations, the DB2 database stores backups and restores data in historical files, and operations such as loading data and deleting tables. if the database name is sample, you can use the following command to list the records of the tabl
If you want to restore and delete a table while using the DB2 database. What should I do? This document describes how to restore a table in DB2 for your reference.
Here we reprinted an operation to restore the table after the drop operation, similar to the flash back in ora
The following article describes how to back up and restore a DB2 database in a Linux operating system, the following describes how to back up and restore the DB2 database in the Lin operating system environment. I hope this will help you in your future studies.
Linux, environment, database Linux, database, Environment
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.