练习闪回表

Posted Tomatoes

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了练习闪回表相关的知识,希望对你有一定的参考价值。

1.删除表dept1:

13:09:30 SCOTT@ORA11GR2>select * from dept1;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
        50 xxx            xxxx

13:09:47 SCOTT@ORA11GR2>delete from dept1;

4 rows deleted.

13:12:51 SCOTT@ORA11GR2>commit;

Commit complete.

2.允许行移动(使用flashback table 必须先允许行移动)

13:12:56 SCOTT@ORA11GR2>alter table dept1 enable row movement;

Table altered.

3.闪回表:

13:13:19 SCOTT@ORA11GR2>flashback table dept1 to timestamp to_timestamp(2016-11-11 13:09:47,yyyy-mm-dd hh24:mi:ss);

Flashback complete.

13:15:28 SCOTT@ORA11GR2>select * from dept1;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON
        50 xxx            xxxx

 

以上是关于练习闪回表的主要内容,如果未能解决你的问题,请参考以下文章