oracle误删除恢复

1.delete误删除解决

利用闪回查询误删除的数据

1
select * from gas_report_supply as of timestamp to_timestamp('2017-10-31 15:40:00','yyyy-mm-dd hh24:mi:ss')

直接插入误删除的数据

1
2
insert into gas_report_supply
select * from gas_report_supply as of timestamp to_timestamp('2017-10-31 15:40:00','yyyy-mm-dd hh24:mi:ss')

表结构未改变的情况下,直接使用闪回整个表的方式来恢复数据,要有flash any table 权限

1
2
3
4
5
6

alter table gas_report_supply enable row movement
--恢复表数据
flashback table gas_report_supply to timestamp to_timestamp('2017-10-31 15:40:00','yyyy-mm-dd hh24:mi:ss')
--关闭行移动功能
alter table gas_report_supply disable row movement