ORACLE利用闪回恢复数据 测试表 删除 闪回
select count(1) from students_p as of timestamp systimestamp - interval ‘10’ minute;
SQL> flashback table students_p to timestamp to_date(‘2022-08-01 15:30:00’,‘yyyy-mm-dd hh24:mi:ss’);
Flashback complete.
SQL> select count(*) from students_p;
COUNT(*)
8
利用SCN闪回 SQL> select * from students_p;
ID NAME AGE
2 张帆 16
2 张帆 16
6 林白 41
6 林白 41
4 王八 65
5 张飞 70
4 王八 65
5 张飞 70
8 rows selected.
SQL> delete students_p where id>1;
8 rows deleted.
SQL> select * from students_p;
no rows selected
SQL> select current_scn from v$database;
CURRENT_SCN
257022315
SQL> flashback table students_p to scn 257020842;
Flashback complete.
SQL> select * from students_p;
ID NAME AGE
2 张帆 16
2 张帆 16
6 林白 41
6 林白 41
4 王八 65
5 张飞 70
4 王八 65
5 张飞 70
8 rows selected.
SQL> 加粗样式
|