2024-01-31|閱讀時間 ‧ 約 23 分鐘

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

    分享至
    成為作者繼續創作的動力吧!
    從 Google News 追蹤更多 vocus 的最新精選內容從 Google News 追蹤更多 vocus 的最新精選內容

    發表回應

    成為會員 後即可發表留言
    © 2024 vocus All rights reserved.