DB2 Recovering data恢复数据

来源:互联网 发布:cad设计软件下载 编辑:程序博客网 时间:2024/05/23 15:42

 

Recovering data恢复数据

Use the RECOVER DATABASE command torecover a database to a specified time, using information found in the recoveryhistory file.

使用RECOVER DATABASE命令去恢复一个数据库到一个指定的时间(使用recovery历史文件中发现的相关信息)。

About this task

The database can be local or remote.数据库是本地或者远程的。

You can invoke the recover utility throughthe command line processor (CLP) or the db2Recover applicationprogramming interface (API).

你可以借助recover工具(通过命令行处理器或者db2Recover应用程序接口)。

The following example shows how to use theRECOVER DATABASE command through the CLP:

下面的例子显示怎样使用RECOVER DATABASE命令(在CLP中)

   db2recover db sample

 

Note: In a partitioned databaseenvironment, the recover utility must be invoked from the catalog partition ofthe database.

注意:在一个分区数据库环境中,recover工具必须被调用(从数据库的目录分区中)

Before you begin

开始之前

If you issue the RECOVER DATABASE commandfollowing an incomplete recover operation that ended during the rollforwardphase, the recover utility will attempt to continue the previous recoveroperation, without redoing the restore phase. If you want to force the recoverutility to redo the restore phase, issue the RECOVER DATABASE command with theRESTART option to force the recover utility to ignore any prior recoveroperation that failed to complete. If you are using the application programminginterface (API), specify the caller action DB2RECOVER_RESTART for theiRecoverAction field to force the recover utility to redo the restore phase.

如果你发起RECOVER DATABASE命令(跟随一个非完整的recover操作,rollforward阶段期间),recover工具将尝试去继续先前的recover操作,没有重做restore阶段。如果你想强制recover工具去redo还原阶段,用restart选项启动RECOVER DATABASE命令去使恢复工具跳过所有级别的恢复操作。如果你正在使用API,指定调用DB2RECOVER_RESTART为iRecoverAction去重做还原阶段。

If the RECOVER DATABASE command isinterrupted during the restore phase, it cannot be continued. You need toreissue the RECOVER DATABASE command.

如果RECOVER DATABASE命令被中断

You should not be connected to thedatabase that is to be recovered: the recover database utility automaticallyestablishes a connection to the specified database, and this connection isterminated at the completion of the recover operation.

  • Recovering data using db2adutl
    You can perform cross-node recovery using the db2adutl command, logarchopt1 and vendoropt database configuration parameters. This recovery is demonstrated in examples from a few different Tivoli® Storage Manager (TSM) environments.
  • Recovering a dropped table
    恢复一个drop的表

You might occasionally drop a table thatcontains data you still need. If this is the case, you should consider makingyour critical tables recoverable following a drop table operation. You couldrecover the table data by invoking a database restore operation, followed by adatabase rollforward operation to a point in time before the table was dropped.This can be time-consuming if the database is large, and your data will beunavailable during recovery. The dropped table recovery feature lets yourecover your dropped table data using table space-level restore and rollforwardoperations. This will be faster than database-level recovery, and your databasewill remain available to users.

你或许偶尔drop一个包含你要想数据的表。如果这发生时,你或许考虑进行恢复表操作。你可以通过调用一个数据库还原操作,紧跟一个数据库的rollforward操作来恢复表的数据恢复表数据到表被删除的时间点。如果数据库巨大,这个工作是耗时的,你的数据在恢复期间将是无效的。Dropped表的恢复功能让你恢复你的dropped表数据(使用表空间级别还原和rollforward操作)。这比数据库级别恢复要快,你的数据库对于用户来说是有效的。

Parent topic: Recover overview

Related reference:

db2Recover API - Restore and roll forward a database

RECOVER DATABASE command

 Task topic

 

0 0