--全备份
db2 backup db testdb online to /data/backup/testdb compress
备份成功。此备份映像的时间戳是:20131218084437
--删除表
db2 drop table emp1
--列出备份中已经删除的表,包含建表语句
db2 list history dropped table all for testdb
--使用删除表之前的全备份进行恢复
db2 "restore db testdb from /data/backup/testdb tablespace(tbs_data2) taken at 20131218084437"
--前滚,并将表的数据导出到 /data/backup 目录下
db2 rollforward db testdb to end of logs and stop recover dropped table 000000000800b42200070010 to /data/backup
cat /data/backup/NODE0000/data
111,"zhangming ",1
--创建被删除的表
db2 "create table db2inst1.emp1(empno integer not null, empname char(20) , deptno integer) in tbs_data2"
--导入数据
db2 import from /data/backup/NODE0000/data of del insert into db2inst1.emp1
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22661144/viewspace-1450992/
,如需转载,请注明出处,否则将追究法律责任。