Oracle閃回的應用情境

來源:互聯網
上載者:User

應用情境:方便、快速恢複表資料;

閃回表

1.設定表的屬性

alter table aaa enable row movement;

2、恢複表資料到2分鐘以前

flashback table aaa to timestamp sysdate-(1/24/3600)*60*2

閃回資源回收筒

1)、表被drop後,可以在閃回資源回收筒這一邏輯空間找回.

flashback table aaa to before drop;

2)、徹底drop掉表

drop table aaa purge;

3)、資源回收筒

user_recyclebin;

dba_recyclebin;

4)、刪除資源回收筒裡的對象

purge table aaa;

purge index mmm;

5)、清空資源回收筒

purge tablespacetbs;-- 清除資料表空間tbs下的資源回收筒裡的內容;

purge tablespaceusers user scott—清除使用者scott下的資源回收筒裡內容;

purge user_recyclebin—使用者清除自己下面的資源回收筒;

purge dba_recyclebin—清除任何錶空間下的所有資源回收筒;

閃回時間長度

select*from v$parameter wherename='undo_retention'--預設的為900秒

修改閃回保留時間長度

alter system setundo_retention=1800 scope=both;--sys使用者登入,修改保留時間長度為1800秒

注意:

1)對於表結構發生變化的表,無法閃回;

2)閃回表只能恢複表資料,不能恢複表上的約束及索引等對象;

3)若要找回建於表上的其他對象,查詢檢視user_recyclebin,且已經被重新命名了;

本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.