ITPub博客

首页 > 数据库 > Oracle > Oracle OCP 1Z0-053 Q271(Purge Table)

Oracle OCP 1Z0-053 Q271(Purge Table)

原创 Oracle 作者:abstractcyj 时间:2016-03-30 10:40:22 0 删除 编辑
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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
曾从事java方向开发多年。近年已经转入数据库方向。主要擅长SQL优化,Oracle数据库问题诊断,Oracle备份与恢复等。服务于医药物流,医院等行业

注册时间:2010-01-26

  • 博文量
    555
  • 访问量
    837980