从其他表中导数据时不小心选择了truncate table,执行了sql之后先truncate后又insert,现在使用fy_recover_data恢复不出来数据,prmdul显示该表没有被截断的数据。请问如何才能恢复truncate操作之前的数据呢?后面insert的数据可以舍弃。
1.查询这个时间点的数据是否是需要的数据
比如说你truncate数据是在2019-07-18 上午12点 你可以查询这个上午12点以前 比如11首先看看 11点的时候这个表是不是有删除前的数据
select * from 表名 as of timestamp to_timestamp('2019-07-18 11:00:00', 'yyyy-mm-dd hh24:mi:ss');
2.开启行移动功能 不然无法回退开启行移动功能 不然无法回退
alter table 表名 enable row movement;
3.执行闪回语句
执行下面语句会使表中的数据恢复到2019-07-18 11:00:00时候的数据
flashback table 表名 to timestamp TO_TIMESTAMP('2019-07-18 11:00:00','yyyy-mm-dd hh24:mi:ss');
其中表名为需要回退的表 ,'2018-02-27 16:00:00'为需要回退到的时间节点