Oracle中Delete數據之後想恢復?來看這裏[只要三步]

1.查詢數據庫當前時間(目的是爲了檢查數據庫時間是否與你電腦時間相近,避免時間不同而將數據恢復到錯誤時間點)

select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual;

2、查詢刪除數據時間點之前的數據(eg:我想恢復11點之前的數據)

select * from 表名 as of timestamp to_timestamp('2019-11-20 11:00:00','yyyy-mm-dd hh24:mi:ss');

3.開啓用行移動功能

alter table 表名 enable row movement;

4.恢復數據

flashback table 表名 to timestamp to_timestamp('2019-11-20 11:00:00','yyyy-mm-dd hh24:mi:ss');

5.測試

select * from 表名;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章