码迷,mamicode.com
首页 > 其他好文 > 详细

【练习】闪回表

时间:2016-12-11 15:06:52      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:back   delete   bsp   rom   opera   time   flash   ack   删除   

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

 

【练习】闪回表

标签:back   delete   bsp   rom   opera   time   flash   ack   删除   

原文地址:http://www.cnblogs.com/tomatoes-/p/6159440.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!