oracle中關於刪除表purge語句和閃回語句的基本使用

來源:互聯網
上載者:User

標籤:style   color   使用   io   for   資料   div   amp   sp   

文法: drop table ... purge;例子:drop table test purge;purge是直接刪除表,不保留到資源回收筒,10G開始預設drop表式改名移動到資源回收筒;閃回(flashback)語句:1、能在一個語句中把表恢複到指定的時間點;2、恢複表資料連同索引與約束資訊;3、能返回表及其內容到指定時間點或系統變更號(SCN);4、修複表的誤操作閃回簡單樣本:SQL> drop table emp2; Table dropped SQL> select original_name,operation,droptime from recyclebin; ORIGINAL_NAME                    OPERATION DROPTIME-------------------------------- --------- -------------------EMP2                             DROP      2012-11-16:10:49:13 SQL> flashback table emp2 to before drop; Done SQL> select count(*) from emp2;   COUNT(*)----------       107 --恢複誤刪表資料樣本:SQL>  select sysdate 時間, timestamp_to_scn(sysdate) SCN from dual; 時間               SCN----------- ----------2012/11/16     1230043 SQL> delete from emp2; 107 rows deleted SQL> commit; Commit complete SQL> select count(*) from emp2;   COUNT(*)----------         0 SQL> flashback table emp2 to scn 1230043; flashback table emp2 to scn 1230043 ORA-08189: cannot flashback the table because row movement is not enabled SQL> alter table emp2 enable row movement; Table altered SQL> flashback table emp2 to scn 1230043; Done SQL> select count(*) from emp2;   COUNT(*)----------       107 

oracle中關於刪除表purge語句和閃回語句的基本使用

聯繫我們

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