ITPub博客

首页 > 数据库 > Oracle > 闪回表

闪回表

原创 Oracle 作者:中奖1000万 时间:2017-06-09 11:47:09 0 删除 编辑
alter table test enable row movement;
flashback table test  to timestamp to_timestamp('2017-05-22 04:12:30','yyyy-mm-dd HH24:MI:SS');
 
时间为需要恢复到的时间节点

SQL> create table test (id int);
Table created.

SQL> insert into test values(1);
1 row created.
SQL> update test set id=999;
4 rows updated.
SQL> alter table test enable row movement;
Table altered.
SQL> flashback table test  to timestamp to_timestamp('2017-05-22 04:12:30','yyyy-mm-dd HH24:MI:SS');
Flashback complete.
SQL> select * from test;
        ID
----------
       999
       999
       999
       999
看来我恢复的时间还没到修改之前。
SQL> update test set id=988;
4 rows updated.
SQL> !date
Mon May 22 04:14:47 CST 2017
SQL> alter table test enable row movement;
Table altered.
SQL> flashback table test  to timestamp to_timestamp('2017-05-22 04:14.40','yyyy-mm-dd HH24:MI:SS');
Flashback complete.
SQL> select * from test;
        ID
----------
       999
       999
       999
       999
SQL>


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31467250/viewspace-2140535/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2017-06-09

  • 博文量
    25
  • 访问量
    40575