Oracle OCP 1Z0-053 Q271(Purge Table)

abstractcyj發表於2016-03-30
271.Examine the output of the query that you executed to list the objects in the recycle bin:

You verified that no table named SALES_TAB exists in the schema. Then you executed the following
command to purge the objects in the recycle bin:
SQL> PURGE TABLE sales_tab;
What would be the outcome of this command?
A. All three tables in the recycle bin are purged
B. Only the table with the oldest DROPSCN is purged
C. The command returns an error because multiple entries with the same name exist in the recycle bin
D. Only the table with the latest DROPSCN is purged
Answer: B

驗證:從以下實驗可以看出,purge table將最早的版本從回收站中清除了

SQL> conn scott/tiger
Connected.
SQL> create table t1 as select rownum rn from dual connect by rownum <= 10;


Table created.


SQL> drop table t1;


Table dropped.


SQL> create table t1 as select rownum rn from dual connect by rownum <= 100;


Table created.


SQL> drop table t1;


Table dropped.


SQL> select original_name,droptime,dropscn from user_recyclebin;


ORIGINAL_NAME                    DROPTIME               DROPSCN
-------------------------------- ------------------- ----------
T1                               2016-03-24:20:02:57    1208420
T1                               2016-03-24:20:02:32    1208378


SQL> purge table t1;


Table purged.


SQL> select original_name,droptime,dropscn from user_recyclebin;


ORIGINAL_NAME                    DROPTIME               DROPSCN
-------------------------------- ------------------- ----------
T1                               2016-03-24:20:02:57    1208420


SQL> flashback table t1 to before drop;


Flashback complete.


SQL> select count(*) from t1;


  COUNT(*)
----------
       100

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8520577/viewspace-2072203/,如需轉載,請註明出處,否則將追究法律責任。

相關文章