oracle闪回flashback_transaction_query知识点

时间:2023-12-11 14:23:14

查询更新记录:

select t.start_timestamp,
t.commit_timestamp,
t.logon_user,
t.operation,
t.table_name,
t.table_owner,
t.undo_sql
from flashback_transaction_query t
where table_name = 'EMP';

查询N分钟前的数据:

select *
from emp as of timestamp to_timestamp('当前时间-N', 'yyyy-mm-dd hh24:mi:ss');

恢复N分钟前的数据:

alter table emp enable row movement;
flashback table emp to timestamp to_timestamp('当前时间-N', 'yyyy-mm-dd hh24:mi:ss');

恢复删除的表:

flashback table emp to before drop;

查看哪些表可以被恢复:

select * from user_recyclebin;