ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 使用闪回查询功能恢复被删除的表数据

使用闪回查询功能恢复被删除的表数据

原创 Linux操作系统 作者:buliaoqingtian 时间:2019-04-26 20:03:04 0 删除 编辑

本人的实验过程


SQL> select count(*) from tjcvs;

COUNT(*)
----------
49811

SQL> delete from tjcvs;

已删除49811行。

SQL> commit;

提交完成。

SQL> select dbms_flashback.get_system_change_number from dual;

GET_SYSTEM_CHANGE_NUMBER
------------------------
1004641

SQL> select count(*) from tjcvs as of scn 1004640;

COUNT(*)
----------
0

SQL> select count(*) from tjcvs as of scn 1004635;

COUNT(*)
----------
0

SQL> ed
已写入 file afiedt.buf

1* select count(*) from tjcvs as of scn 1004630
SQL> /

COUNT(*)
----------
0

SQL> ed
已写入 file afiedt.buf

1* select count(*) from tjcvs as of scn 1004620
SQL> /

COUNT(*)
----------
0

SQL> ed
已写入 file afiedt.buf

1* select count(*) from tjcvs as of scn 1004626
SQL> /

COUNT(*)
----------
0

SQL> ed
已写入 file afiedt.buf

1* select count(*) from tjcvs as of scn 1004627
SQL> /

COUNT(*)
----------
0

SQL> ed
已写入 file afiedt.buf

1* select count(*) from tjcvs as of scn 1004637
SQL> /

COUNT(*)
----------
0

SQL> ed
已写入 file afiedt.buf

1* select count(*) from tjcvs as of scn 1004636
SQL> /

COUNT(*)
----------
0

SQL> ed
已写入 file afiedt.buf

1* select count(*) from tjcvs as of scn 1004615
SQL> /

COUNT(*)
----------
49811


SQL> insert into tjcvs select * from tjcvsd as of scn 1004615;
insert into tjcvs select * from tjcvsd as of scn 1004615
*
第 1 行出现错误:
ORA-00942: 表或视图不存在


SQL> insert into tjcvs select * from tjcvs as of scn 1004615;

已创建49811行。

SQL> commit;

提交完成。

SQL> select count(*) from tjcvs;

COUNT(*)
----------
49811

SQL> spool off;

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

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

注册时间:2005-08-03

  • 博文量
    88
  • 访问量
    106023