Oracle資料刪除後找回

2021-09-01 15:18:10 字數 652 閱讀 1255

--檢視當前scn數值

select dbms_flashback.get_system_change_number from dual;

--scn與時間的對應關係

select to_char(sysdate,』yyyy-mm-dd hh24:mi:ss』, to_char(dbms_flashback.get_system_change_number) as  scn   from dual;

--通過時間flashback query資料

select * from scott.test as of timestamp to_timestamp('2013-11-17 10:25:17', 'yyyy-mm-dd hh:mi:ss'); 

--通過scn 閃回資料

select * from scott.test as of scn 23565583;

--閃回表中誤刪除的資料

flashback table tablename to timestamp *** 

flashback table tablename to scn ***

--閃回表前提條件

--該錶需開啟行移動功能,可在恢復之前開啟再執行恢復

alter table test enable row movement;

找回oracle中刪除的資料

select dbms flashback.get system change number from dual 查詢當前scn號 如果不知道刪除之前的scn號,可以進行閃回查詢 即,數字一直減小,直到找到為止 select count from table1 as of scn 205125720...

Oracle 刪除表資料 找回方法

oracle 有個東西要scn 叫做 system change number 大概就是你對資料庫做的任何改變都會 被oracle 記錄下來 很多概念的東西可以去看看 oracle concept 和官方文件 比如索引 鎖 資料塊 區 表空間,表連線,以及 oracle各個後台程序工作原理 等等 這...

oracle找回被刪除的資料

oracle中如果進行裡的delete如果想要恢復 例如檢視某一張表 select from vts users 發現有2條資料 然後執行刪除表資料操作 delete from vts users 這是檢視scn資料 select dbms flashback.get system change n...