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

 
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;      ----&gt该删除的是tab模拟表

表已删除。

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

表已重命名。

已用时间:  00: 00: 00.04
SQL> drop table aa;   ---&gt该表是基于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;   ---------&gt返回的结果证明:recyclebin表2个相同的表闪回机制:后进先出
名称                                                                   是否为空? 类型
-----------------------------------------------------------------------------------------------
DICT_CODE                                                                       VARCHAR2(50)
DICT_DESC                                                                       VARCHAR2(400)

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

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

转载于:http://blog.itpub.net/28602568/viewspace-759532/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值