根据时间来恢复:
1、查询数据库当前时间()
select to_char(sysdate,‘yyyy-mm-dd hh24:mi:ss’) from dual;
2、查询删除数据时间点之前的数据
select * from 表名 as of timestamp to_timestamp(‘2022-02-28 10:12:11’,‘yyyy-mm-dd hh24:mi:ss’);
(若没有数据 ,将时间继续提前)
3、恢复数据
flashback table 表名 to timestamp to_timestamp(‘2022-02-28 10:12:11’,‘yyyy-mm-dd hh24:mi:ss’);
数据恢复成功;
但是也可能会出现问题,比如报错:ORA-08189:未启用行移动功能,不能闪回表;
执行下面操作;
alter table 表名 enable row movement;
然后再次执行上面SQL即可;