ore drop;
flashback table t2 to before drop
*
ERROR at line 1:
ORA-38312: original name is used by an existing object
hr@ORCL> flashback table t2 to before drop rename to t2_recov;
Flashback complete.
hr@ORCL> select count(*) from t2_recov;
COUNT(*)
----------
19
㈢ 从多次删除中恢复
多个同名表一起进recyclebin,后进先出
[sql]
hr@ORCL> drop table t2;
www.2cto.com
Table dropped.
hr@ORCL> alter table t2_recov rename to t2;
Table altered.
hr@ORCL> drop table t2;
Table dropped.
hr@ORCL> select object_name,original_name,droptime from recyclebin;
OBJECT_NAME ORIGINAL_NAME DROPTIME
------------------------------ -------------------------------- -------------------
BIN$yUcFsAG/oGvgQAB/AQAjTg==$0 T2 2012-09-09:23:47:12
BIN$yUcFsAHBoGvgQAB/AQAjTg==$0 T2 2012-09-09:23:48:42
www.2cto.com
hr@ORCL> flashback table t2 to before drop;
Flashback complete.
hr@ORCL> select object_name,original_name,droptime from recyclebin;
OBJECT_NAME ORIGINAL_NAME DROPTIME
------------------------------ -------------------------------- -------------------
BIN$yUcFsAG/oGvgQAB/AQAjTg==$0 T2 2012-09-09:23:47:12
hr@ORCL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
REGIONS TABLE
COUNTRIES TABLE
LOCATIONS TABLE
DEPARTMENTS TABLE
JOBS TABLE
EMPLOYEES TABLE
JOB_HISTORY TABLE
EMP_DETAILS_VIEW VIEW
LOGMNR_TEST TABLE
BIN$yUcFsAG/oGvgQAB/AQAjTg==$0 TABLE
T2 TABLE
www.2cto.com
11 rows selected.
hr@ORCL> drop table t2;
Table dropped.
hr@ORCL> select object_name,original_name,droptime from recyclebin;
OBJECT_NAME ORIGINAL_NAME DROPTIME
------------------------------ -------------------------------- -------------------
BIN$yUcFsAHDoGvgQAB/AQAjTg==$0 T2 2012-09-09:23:52:39
BIN$yUcFsAG/oGvgQAB/AQAjTg==$0 T2 2012-09-09:23:47:12
hr@ORCL> flashback table "BIN$yUcFsAG/oGvgQAB/AQAjTg==$0" to before drop;
Flashback complete.
hr@ORCL> select count(*) from t2;
www.2cto.com
COUNT(*)
----------
19
hr@ORCL> select object_name,original_name,droptime from recyclebin;
OBJECT_NAME ORIGINAL_NAME DROPTIME
------------------------------ -------------------------------- -------------------
BIN$yUcFsAHDoGvgQAB/AQAjTg==$0 T2 2012-09-09:23:52:39