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;
名稱 是否為空? 型別
-----------------------------------------------------------------------------------------------
表已建立。
已用時間: 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在事物處理時的效能影響。
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部落格 ” ,連結:http://blog.itpub.net/28602568/viewspace-759532/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 分析函式——NULLS FIRST/LAST函式NullAST
- Oracle集合的first, last , next ,count,existOracleAST
- first oracle sqlOracleSQL
- Oracle分析函式-first_value()和last_value()Oracle函式AST
- [LeetCode] Find First and Last Position of Element in SortedLeetCodeAST
- 分析函式——keep(dense_rank first/last)函式AST
- oracle集合型別的first、next、prior、last方法.TXTOracle型別AST
- jQuery first()jQuery
- jQuery :firstjQuery
- 分析函式——FIRST_VALUE()和LAST_VALUE()函式AST
- :first-child與:first-of-type 區別
- Entity Framework Code-First(2):What is Code-First?Framework
- Entity Framework Code-First(4):Simple Code First ExampleFramework
- Entity Framework Code-First(5):Code First ConventionsFramework
- Leetcode 34 Find First and Last Position of Element in Sorted ArrayLeetCodeAST
- FIRST_ROWS和FIRST_ROWS_n的區別
- FIRST_ROWS和FIRST_ROWS(N)的區別 (zt)
- jQuery :first-of-typejQuery
- jQuery :first-childjQuery
- Annotation for ANDROID ---FirstAndroid
- linux c firstLinux
- raw device, first blockdevBloC
- My first blog!
- 【EF Core】Code first
- My first blog
- CSS E:first-childCSS
- CSS E:first-of-typeCSS
- CSS E::first-letterCSS
- First Missing Positive【hard】
- ZOJ First Digit(瞎搞)Git
- My first Upgrade projectProject
- Patterns and Frameworks (my first topic)Framework
- css選擇器中:first-child與:first-of-type的區別CSS
- Oracle 的 INSERT ALL和INSERT FIRSTOracle
- 兩個SQL語句技巧——NULLS FIRST/LAST和分析函式版AVGSQLNullAST函式
- My First and My Last第一次與最後一次AST
- 學習總結(first week)
- EF Core 的 Code First 模式模式