guoyanxi 发表于 2013-1-25 21:41:30

db2利用离线备份重建数据库

环境:
PRO机器:生产环境,拥有正式数据
IVT机器:已经有数据库,根据PRO机器的离线备份文件重建现在的数据库


--首先断掉所有连接bash-3.00$ db2 force applications allDB20000IThe FORCE APPLICATION command completed successfully.DB21024IThis command is asynchronous and may not be effective immediately.bash-3.00$ db2 list applicationsSQL1611WNo data was returned by Database System Monitor.--使用/tmp下面的备份镜像bash-3.00$ db2 "restore db mtpdb from /tmp replace existing redirect without rolling forward"SQL2539WWarning!Restoring to an existing database that is the same as the backup image database.The database files will be deleted.SQL1277WA redirected restore operation is being performed.Table space configuration can now be viewed and table spaces that do not use automatic storage can have their containers reconfigured.DB20000IThe RESTORE DATABASE command completed successfully.--查看现在恢复状态bash-3.00$ db2 list utilities show detailID                               = 3Type                           = RESTOREDatabase Name                  = MTPDBPartition Number               = 0Description                      = db Start Time                     = 02/16/2011 16:48:46.187310State                            = ExecutingInvocation Type                  = UserProgress Monitoring:      Completed Work             = 17330176 bytes      Start Time               = 02/16/2011 16:48:46.187318--确认恢复bash-3.00$ db2 restore db mtpdb continueDB20000IThe RESTORE DATABASE command completed successfully.--连接数据库bash-3.00$ db2 connect to mtpdb   Database Connection Information Database server      = DB2/AIX64 9.5.5 SQL authorization ID   = A1INMTP Local database alias   = MTPDB--完成
页: [1]
查看完整版本: db2利用离线备份重建数据库