我们今天主要向大家讲述的是DB2恢复误删除表的实际操作代码,你如果对DB2恢复误删除表的实际操作代码有兴趣的话你就可以点击以下的文章进行观看了,以下就是文章对其实际操作代码段的描述,望大家在浏览之后会对其有更深的了解。
删除删除
做了一次恢复误删除表的测试,具体过程如下:
- DB2 ALTER TABLESPACE USERSPACE2 DROPPED TABLE RECOVERY ON
- DB2 "list history dropped table all for cdbiold"
- DB2 backup db cdbiold to /databk with 2 buffers buffer 512
- DB2 "delete from DC_BILL_STATUS where count_time='20080731'"
- DB2 drop table DC_BILL_STATUS
- DB2 "select TBSPACE,DROP_RECOVERY from syscat.tablespaces where owner='DB2ADMIN'"
- DB2 "list history dropped table all for cdbiold"
- Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID
- D T 20090317165133 000000000039210b00020006
- "DB2ADMIN"."DC_BILL_STATUS" resides in 1 tablespace(s):
- 00001 USERSPACE1
- Comment: DROP TABLE
- Start Time: 20090317165133
- End Time: 20090317165133
- Status: A
- EID: 39
- DDL: CREATE TABLE "DB2ADMIN"."DC_BILL_STATUS" ( "COUNT_TIME" VARCHAR(8) NOT NULL ,
- "ORG_CODE" VARCHAR(8) NOT NULL , "BILL_TYPE" VARCHAR(40) NOT NULL , "FLAG" CHAR(1) NOT NULL WITH DEFAULT 'N' ,
- "OPER" VARCHAR(64) NOT NULL WITH DEFAULT ' ' , "UP_FLAG" CHAR(1) NOT NULL WITH DEFAULT 'N' ) IN "USERSPACE1" ;
- DB2 force applications all
- DB2 restore db cdbiold from /databk taken at 20090317
- DB2 rollforward db cdbiold to end of logs and stop recover dropped table 000000000039210b00020006 to /databk
- DB2 "select count(*) from DC_BILL_STATUS where count_time='20080731'"
- DB2 import from /databk/NODE0000/data of del insert into DC_BILL_STATUS
以上的相关内容就是对DB2恢复误删除表的介绍,望你能有所收获。
【编辑推荐】