oracle清空表恢复办法

发布时间 2024-01-10 11:10:47作者: xxfcode

今天我不小心把正式库订单表数库都清空了,兄弟们!!!!!!!!!!!!
我强迫自己冷静下来,百度搜索解决办法。希望大家别碰到这种事,太后怕了呜呜呜呜呜

我自己总结一下

1、查询某个时间点之前的数据(如果没数据库,多试几个时间点)

select * from 表名 as of timestamp to_timestamp('2024-01-10 09:09:00','yyyy-mm-dd hh24:mi:ss');

2、开启行移动功能(不然下一步报错)

alter table 表名 enable row movement;

3、恢复某个时间点的数据
flashback table 表名 to timestamp to_timestamp('2024-01-10 09:09:00','yyyy-mm-dd hh24:mi:ss');

4、关闭行移动功能

alter table 表名 disable row movement;