首页 > 代码库 > 【练习】flashback基于scn的闪回查询
【练习】flashback基于scn的闪回查询
1.创建表dept1:
13:01:03 SCOTT@ORA11GR2>create table dept1 as select * from dept;
Table created.
13:01:40 SCOTT@ORA11GR2>select * from dept1;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
13:02:22 SCOTT@ORA11GR2>insert into dept1 values(50,‘xxx‘,‘xxxx‘);
1 row created.
2.查看当前的scn:
13:04:12 SYS@ORA11GR2>select current_scn from v$database;
CURRENT_SCN
-----------
1006836
3.删除表dept1:
13:07:51 SCOTT@ORA11GR2>delete from dept1;
4 rows deleted.
13:08:03 SCOTT@ORA11GR2>select * from dept1;
no rows selected
4.基于scn的查询:
13:08:15 SCOTT@ORA11GR2>select * from dept1 as of scn 1006836;
DEPTNO DNAME LOC
---------- -------------- -------------
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
50 xxx xxxx
【练习】flashback基于scn的闪回查询
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。