今天发现flashback支持system表空间对象我们做个例子
SQL> show user
USER 为 "SYS"
SQL> create table t (id number) tablespace system;
USER 为 "SYS"
SQL> create table t (id number) tablespace system;
表已创建。
SQL> insert into t values(1);
已创建 1 行。
SQL> insert into t values(2);
已创建 1 行。
SQL> commit;
提交完成。
SQL> select dbms_flashback.get_system_change_number scn from dual;
SCN
----------
2470912
----------
2470912
SQL> insert into t values(3);
已创建 1 行。
SQL> commit;
提交完成。
SQL> select * from t;
ID
----------
1
2
3
----------
1
2
3
SQL> select * from t as of scn 2470912;
ID
----------
1
2
----------
1
2
SQL> delete from t;
已删除3行。
SQL> commit;
提交完成。
SQL> select * from t as of scn 2470912;
ID
----------
1
2
----------
1
2
SQL> drop table t;
表已删除。
SQL> show recyclebin;
SQL> flashback table t to before drop;
flashback table t to before drop
*
第 1 行出现错误:
ORA-38305: 对象不在回收站中
SQL> flashback table t to before drop;
flashback table t to before drop
*
第 1 行出现错误:
ORA-38305: 对象不在回收站中
SQL> create table t2 (id number) tablespace test;
表已创建。
SQL> drop table t2;
表已删除。
SQL> show recyclebin;
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
---------------- ------------------------------ ------------ -------------------
T2 BIN$2O/jaaLZQWO65MGOptb4iQ==$0 TABLE 2011-11-11:15:00:01
SQL> select * from 'BIN$2O/jaaLZQWO65MGOptb4iQ==$0';
select * from 'BIN$2O/jaaLZQWO65MGOptb4iQ==$0'
*
第 1 行出现错误:
ORA-00903: 表名无效
ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME
---------------- ------------------------------ ------------ -------------------
T2 BIN$2O/jaaLZQWO65MGOptb4iQ==$0 TABLE 2011-11-11:15:00:01
SQL> select * from 'BIN$2O/jaaLZQWO65MGOptb4iQ==$0';
select * from 'BIN$2O/jaaLZQWO65MGOptb4iQ==$0'
*
第 1 行出现错误:
ORA-00903: 表名无效
SQL> select * from "BIN$2O/jaaLZQWO65MGOptb4iQ==$0";
未选定行
SQL> flashback table t2 to before drop;
闪回完成。
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22374393/viewspace-710805/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22374393/viewspace-710805/