1.timestamp找回数据
select * from student as of timestamp sysdate-5/1440
--利用时间来找回数据,5是天数,1440=24*60,5/1440=5分钟,所以这个是用来找回5分钟之前的数据的
想要恢复数据就可以先删除表中原来的数据,然后
insert into student select * from student as of timestamp sysdate-5/1440
2.SCN找回数据
1 SQL> select dbms_flashback.get_system_change_number from dual; 2 3 GET_SYSTEM_CHANGE_NUMBER 4 ------------------------ 5 3643878 6 7 SQL> select count(*) from emp as of scn 3643000; 8 9 COUNT(*) 10 ---------- 11 14 12 13 SQL> select count(*) from emp; 14 15 COUNT(*) 16 ---------- 17 0 18 SQL> insert into emp select * from emp as of scn 3643000; 19 20 14 rows inserted 21
还有一种快捷方式Ctrl+E来快速查找用户所做的操作,但是如果不是在PL/SQL中直接进行的操作,就查不出来!