oracle cache table(6)
第二個特點,CACHE儲存引數無效:
SQL> CREATE TABLE T3 STORAGE(BUFFER_POOL KEEP) AS SELECT * FROM T2;
Table created.
SQL> ALTER TABLE T2 CACHE;
Table altered.
SQL> SELECT COUNT(*) FROM T;
COUNT(*)
----------
334022
SQL> SELECT OBJECT_NAME, A.STATUS, COUNT(*)
2 FROM V$BH A, USER_OBJECTS B
3 WHERE A.OBJD = B.OBJECT_ID
4 AND OBJECT_NAME IN ('T', 'T2', 'T3')
5 GROUP BY OBJECT_NAME, A.STATUS;
OBJECT_NAME STATU COUNT(*)
--------------------------
T xcur 8096
SQL> SELECT COUNT(*) FROM T2;
COUNT(*)
----------
167011
SQL> SELECT OBJECT_NAME, A.STATUS, COUNT(*)
2 FROM V$BH A, USER_OBJECTS B
3 WHERE A.OBJD = B.OBJECT_ID
4 AND OBJECT_NAME IN ('T', 'T2', 'T3')
5 GROUP BY OBJECT_NAME, A.STATUS;
OBJECT_NAME STATU COUNT(*)
---------------------------
T xcur 3267
T2 xcur 4829
SQL> SELECT COUNT(*) FROM T3;
COUNT(*)
----------
167011
SQL> SELECT OBJECT_NAME, A.STATUS, COUNT(*)
2 FROM V$BH A, USER_OBJECTS B
3 WHERE A.OBJD = B.OBJECT_ID
4 AND OBJECT_NAME IN ('T', 'T2', 'T3')
5 GROUP BY OBJECT_NAME, A.STATUS;
OBJECT_NAME STATU COUNT(*)
--------------------------
T2 xcur 3267
T3 xcur 4829
SQL> SELECT COUNT(*) FROM T WHERE ROWNUM < 100000;
COUNT(*)
----------
99999
SQL> SELECT OBJECT_NAME, A.STATUS, COUNT(*)
2 FROM V$BH A, USER_OBJECTS B
3 WHERE A.OBJD = B.OBJECT_ID
4 AND OBJECT_NAME IN ('T', 'T2', 'T3')
5 GROUP BY OBJECT_NAME, A.STATUS;
OBJECT_NAME STATU COUNT(*)
------------------------------
T xcur 3696
T3 xcur 4400
透過測試可以發現,CACHE選項沒有起作用,其實這也不難理解,既然放到單獨的KEEP池中,那麼必然打
算將這個物件快取,因此Oracle對所有KEEP池中的物件採用了預設CACHE的方式。而忽略物件本身的CACHE和NOCACHE選項[@more@]
SQL> CREATE TABLE T3 STORAGE(BUFFER_POOL KEEP) AS SELECT * FROM T2;
Table created.
SQL> ALTER TABLE T2 CACHE;
Table altered.
SQL> SELECT COUNT(*) FROM T;
COUNT(*)
----------
334022
SQL> SELECT OBJECT_NAME, A.STATUS, COUNT(*)
2 FROM V$BH A, USER_OBJECTS B
3 WHERE A.OBJD = B.OBJECT_ID
4 AND OBJECT_NAME IN ('T', 'T2', 'T3')
5 GROUP BY OBJECT_NAME, A.STATUS;
OBJECT_NAME STATU COUNT(*)
--------------------------
T xcur 8096
SQL> SELECT COUNT(*) FROM T2;
COUNT(*)
----------
167011
SQL> SELECT OBJECT_NAME, A.STATUS, COUNT(*)
2 FROM V$BH A, USER_OBJECTS B
3 WHERE A.OBJD = B.OBJECT_ID
4 AND OBJECT_NAME IN ('T', 'T2', 'T3')
5 GROUP BY OBJECT_NAME, A.STATUS;
OBJECT_NAME STATU COUNT(*)
---------------------------
T xcur 3267
T2 xcur 4829
SQL> SELECT COUNT(*) FROM T3;
COUNT(*)
----------
167011
SQL> SELECT OBJECT_NAME, A.STATUS, COUNT(*)
2 FROM V$BH A, USER_OBJECTS B
3 WHERE A.OBJD = B.OBJECT_ID
4 AND OBJECT_NAME IN ('T', 'T2', 'T3')
5 GROUP BY OBJECT_NAME, A.STATUS;
OBJECT_NAME STATU COUNT(*)
--------------------------
T2 xcur 3267
T3 xcur 4829
SQL> SELECT COUNT(*) FROM T WHERE ROWNUM < 100000;
COUNT(*)
----------
99999
SQL> SELECT OBJECT_NAME, A.STATUS, COUNT(*)
2 FROM V$BH A, USER_OBJECTS B
3 WHERE A.OBJD = B.OBJECT_ID
4 AND OBJECT_NAME IN ('T', 'T2', 'T3')
5 GROUP BY OBJECT_NAME, A.STATUS;
OBJECT_NAME STATU COUNT(*)
------------------------------
T xcur 3696
T3 xcur 4400
透過測試可以發現,CACHE選項沒有起作用,其實這也不難理解,既然放到單獨的KEEP池中,那麼必然打
算將這個物件快取,因此Oracle對所有KEEP池中的物件採用了預設CACHE的方式。而忽略物件本身的CACHE和NOCACHE選項[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18921899/viewspace-1017604/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle cache table(轉)Oracle
- oracle cache table(1)Oracle
- oracle cache table(3)Oracle
- oracle cache table(2)Oracle
- oracle cache table(5)Oracle
- oracle cache table(4)Oracle
- MySQL:Table_open_cache_hits/Table_open_cache_misses/Table_open_cache_overflowsMySql
- Oracle 11.2.0.1 Result Cache 測試 - 6Oracle
- MySQL 5.6 Table cache 簡介MySql
- MySQL 關於Table cache設定MySql
- oracle x$bh及v$bh與table cache表快取系列(三)Oracle快取
- oracle x$bh及v$bh與table cache表快取系列(二)Oracle快取
- oracle x$bh及v$bh與table cache表快取系列(一)Oracle快取
- [6 kyu] Multiplication table
- mysql效能最佳化之table_cacheMySql
- db_cache hitratio sql and v$db_cache_advice and create table with storageSQL
- [Oracle] Partition table exchange Heap tableOracle
- oracle temporary tableOracle
- oracle shrink tableOracle
- Oracle Table LocksOracle
- Alter table for ORACLEOracle
- Oracle Table FunctionOracleFunction
- buffer cache實驗6-latch:cache buffers lru chainsAI
- Oracle Library cacheOracle
- Oracle Buffer Cache原理Oracle
- Oracle Query Result CacheOracle
- Oracle database buffer cacheOracleDatabase
- oracle cache快取Oracle快取
- Oracle 普通table 轉換為partition tableOracle
- Oracle table selectOracle
- Oracle:TABLE MONITORINGOracle
- oracle之nalyze tableOracle
- Oracle ASM Allocation TableOracleASM
- 轉:MySQL效能優化配置引數之thread_cache和table_cache詳解MySql優化thread
- table_open_cache引數對mysql效能的影響MySql
- PE教程6: Import Table(引入表Import
- Oracle Cache Buffer ChainsOracleAI
- 淺談Oracle Result CacheOracle