ITPub博客

首页 > Linux操作系统 > Linux操作系统 > OCP(11g)-----> oracle First In First Out (FIFO)/Last In First Out

OCP(11g)-----> oracle First In First Out (FIFO)/Last In First Out

原创 Linux操作系统 作者:maohaiqing0304 时间:2013-04-29 23:17:17 0 删除 编辑
 
oracle First In First Out (FIFO)/Last In First Out (LIFO)  .....
You discover that your Recycle Bin contains two tables with the same name, MY_TABLE. You also have a table named MY_TABLE in your schema. You execute the following statement:
FLASHBACK TABLE my_table TO BEFORE DROP RENAME TO my_table2;
What will be the result of executing this statement?
A. One of the tables is recovered from the Recycle Bin using a First In First Out (FIFO) approach.
B. One of the tables is recovered from the Recycle Bin using a Last In First Out (LIFO) approach.
C. Both the tables are recovered from the Recycle Bin with one table renamed to MY_TABLE2 and the other to a system-generated name.
D. None of the tables are recovered from the Recycle Bin, and the statement returns an error.
Answer: B
SQL> create table aa1 as select dict_code,dict_desc from base_dict;

表已创建。

已用时间:  00: 00: 00.06
SQL> desc aa1;
名称                                                                         是否为空? 类型
-----------------------------------------------------------------------------------------------
DICT_CODE                                                               VARCHAR2(50)
DICT_DESC                                                               VARCHAR2(400)

SQL> create table aa as select * from tab;

表已创建。

已用时间:  00: 00: 00.14
SQL> drop table aa;      ---->该删除的是tab模拟表

表已删除。

已用时间:  00: 00: 00.07
SQL> rename aa1 to aa; 

表已重命名。

已用时间:  00: 00: 00.04
SQL> drop table aa;   --->该表是基于base_dict创建的表 

表已删除。

已用时间:  00: 00: 00.01
SQL> sho recycle;
ORIGINAL NAME    RECYCLEBIN NAME                OBJECT TYPE  DROP TIME
---------------- ------------------------------ ------------ -------------------
AA               BIN$LdL8XIZ2T9q/VKY/co2S8A==$0 TABLE        2013-04-19:11:40:09
AA               BIN$LVSXxo8OTfyfxTFN+sw8Bg==$0 TABLE        2013-04-19:11:39:55
SQL> FLASHBACK TABLE aa to before drop rename to aa1;

闪回完成。

已用时间:  00: 00: 00.01

SQL> desc aa1;   --------->返回的结果证明:recyclebin表2个相同的表闪回机制:后进先出
名称                                                                   是否为空? 类型
-----------------------------------------------------------------------------------------------
DICT_CODE                                                                       VARCHAR2(50)
DICT_DESC                                                                       VARCHAR2(400)

SQL>当空间压力出现时,Oracle会覆盖些回收站对象从而自动回收表空间。Oracle根据先进先出的原则来选择丢弃对象进行删除,所以最先被丢弃的对象也最先被清除。而对象的清除仅仅是为了解决产生的空间压力问题,所以会尽可能清除少的对象来满足空间压力的要求。这样处理,既最大限度地保证了对象在回收站中的可用时间,又减少了Oracle在事物处理时的性能影响。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28602568/viewspace-759532/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
.

注册时间:2013-03-13

  • 博文量
    117
  • 访问量
    2626251