oracle恢複刪除的表或表記錄的方法__oracle

來源:互聯網
上載者:User
oracle恢複刪除的表或表記錄的方法

文章分類:資料庫

一:表的恢複

     對誤刪的表,只要沒有使用PURGE永久刪除選項,那麼從flash back區恢複回來希望是挺大的。一般步驟有:

1、從flash back裡查詢被刪除的表

    select * from recyclebin

2.執行表的恢複

   flashback table  tb  to before drop,這裡的tb代表你要恢複的表的名稱。

二:表資料恢複

    對誤刪的表記錄,只要沒有truncate語句,就可以根據事務的提交時間進行選擇恢複,一般步驟有:

     1、先從flashback_transaction_query視圖裡查詢,視圖提供了供查詢用的表名稱、事務提交時間、UNDO_SQL等欄位。

     如:select * from flashback_transaction_query where table_name='TEST';
     2、執行表記錄恢複

     一般先根據時間進行查詢,查詢語句模式為select * from tb as of timestamp to_timestamp(time,'yyyy-mm-dd hh24:mi:ss'); tb指表名稱,time指某個時間點

      如select * from scott.test as of timestamp to_timestamp('2009-12-11 20:53:57','yyyy-mm-dd hh24:mi:ss');

    若有資料,恢複極為簡單了,語句為flashback table tb to timestamp to_timestamp(time,'yyyy-mm-dd hh24:mi:ss');

   如flashback table scott.test to timestamp to_timestamp('2009-12-11 20:47:30','yyyy-mm-dd hh24:mi:ss');

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.