亚洲免费日韩av一区,最近2019中文字幕大全视频10,体育生gay自慰网站,麻豆国产精品va在线观看不卡

搜索
Close this search box.

如何恢復刪除的oracle數(shù)據(jù)庫數(shù)據(jù)

作者:admin 發(fā)布日期:2016-10-21 16:38:19

如何恢復刪除的oracle數(shù)據(jù)庫數(shù)據(jù)

在執(zhí)行維護計劃的時候,如果準備備份數(shù)據(jù)庫或者進行數(shù)據(jù)庫例行維護,誤操作導致oracle數(shù)據(jù)庫數(shù)據(jù)被刪除了,想知道有什么辦法能恢復,可以通過scn和時間戳兩種方法進行數(shù)據(jù)恢復。

oracle數(shù)據(jù)庫數(shù)據(jù)恢復

恢復刪除的oracle數(shù)據(jù)分為兩種方法:

一、通過scn恢復刪除且已提交的數(shù)據(jù)

  1、獲得當前數(shù)據(jù)庫的scn號

    select current_scn from v$database; (切換到sys用戶或system用戶查詢) 

    查詢到的scn號為:1499223

  2、查詢當前scn號之前的scn

    select * from 表名 as of scn 1499220; (確定刪除的數(shù)據(jù)是否存在,如果存在,則恢復數(shù)據(jù);如果不是,則繼續(xù)縮小scn號)

  3、恢復刪除且已提交的數(shù)據(jù)

    flashback table 表名 to scn 1499220;

二、通過時間恢復刪除且已提交的數(shù)據(jù)

  1、查詢當前系統(tǒng)時間

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

  2、查詢刪除數(shù)據(jù)的時間點的數(shù)據(jù)

    select * from 表名 as of timestamp to_timestamp('2013-05-29 15:29:00','yyyy-mm-dd hh24:mi:ss');  (如果不是,則繼續(xù)縮小范圍)

  3、恢復刪除且已提交的數(shù)據(jù)

    flashback table 表名 to timestamp to_timestamp('2013-05-29 15:29:00','yyyy-mm-dd hh24:mi:ss');

    注意:如果在執(zhí)行上面的語句,出現(xiàn)錯誤。可以嘗試執(zhí)行 alter table 表名 enable row movement; //允許更改時間戳。


上一篇:TF卡數(shù)據(jù)無法識別怎么解決?

下一篇:硬盤格式化后數(shù)據(jù)如何恢復?

熱門閱讀

你丟失數(shù)據(jù)了嗎!

我們有能力從各種數(shù)字存儲設備中恢復您的數(shù)據(jù)

Scroll to Top