| 
  • Increase font size
  • Decrease font size
  • Default font size
  • default color
  • red color
  • green color
香农数据安全在线
Mar 12th
首 页 arrow 数据库 arrow DB2 arrow 在DB2中恢复删除表技巧

在DB2中恢复删除表技巧 输出PDF
作者: IBM   
2005-12-17

  DB2在历史文件中保存了备份,恢复,装载数据,删除表等操作. 假设数据库名为sample, 您可以用下面的命令列出删除表的记录:

  db2 "list history dropped table all for sample"

  下一步是从以前的备份中恢复删除表所在的表空间, 备份所在的目录是c:\db2backup. without rolling forward指明不需要前滚.

  db2 "restore db sample tablespace(userspace1) from c:\db2backup taken at 20041102100931 without rolling forward without prompting"

  第三步是把所删除表的数据卸载到某一目录中

  db2 "rollforward db sample to end of logs and complete recover dropped table 00000000000002010002000d to c:\db2backup"

  第四步是用历史文件中保留的该表的DDL语句重建该表

  第五步是重新装载数据到该表. p(1,2)表明装载该表的第一个和第二个字段的内容. recoverme是表名

  db2 "load from c:\db2backup\node0000\data OF DEL METHOD p(1,2) insert into recoverme"


 
< 上一篇