表闪回
误操作
不小心删除了表数据,或者更新了表数据。这时候记下操作的大致时间。
1 2 3 4
| SELECT * FROM PS_C_RE_STATUS_TBL
delete from PS_C_RE_STATUS_TBL
|
备份误操作后产生的数据(最新的数据)
1 2 3
| create table PS_C_RE_STATUS_TBL_back as select * from PS_C_RE_STATUS_TBL SELECT * FROM PS_C_RE_STATUS_TBL_back
|
开启表闪回功能,并且闪回表到指定时间
1 2 3 4 5 6 7 8
| alter table PS_C_RE_STATUS_TBL enable row movement;
FLASHBACK TABLE PS_C_RE_STATUS_TBL TO TIMESTAMP TO_TIMESTAMP('2020-12-21 11:11:00', 'YYYY-MM-DD HH24:MI:SS');
alter table PS_C_RE_STATUS_TBL disable row movement;
|
快照恢复
1 2 3 4 5 6 7
| INSERT INTO PSPCMTXT SELECT * FROM (SELECT * FROM PSPCMTXT AS OF TIMESTAMP(SYSTIMESTAMP - 1 / 48)) WHERE OBJECTID1 = 104 AND OBJECTVALUE1 = '包名';
|