更新於 2024/02/01閱讀時間約 1 分鐘

Flashback TABLE

    Oracle可以透過Flashback TABLE將已經commit後的誤刪、誤異動資料給救回來(回到誤異動前的時間點),下面就是整個操作過程。


    SQL> select systimestamp from dual;

    systimestamp

    ----------------------------

    2024/01/29 17:54:47.374414


    --啟用table row movement(flashback需要允許table row movement)

    SQL>alter table HR.employees_test enable row movement;


    --flashback to timestamp

    SQL>flashback table HR.employees_test to

    timestamp to_timestamp('2024/01/29 16.30.00','yyyy/mm/dd hh24.mi.ss');


    --停用table row movement

    SQL>alter table DBNIS.nis_he_contentlist disable row movement;



    ref:

    Oracle 12 SQL Language Reference

    分享至
    成為作者繼續創作的動力吧!
    © 2024 vocus All rights reserved.