Oracle中flush buffer cache和x$bh
實驗出發點:
今天做關於引數db_file_multiblock_read_count實驗的時候,詳情見http://blog.itpub.net/30174570/viewspace-2140241/,對oracle資料庫執行alter system flush buffer_cache;指令發現,x$bh表中已經存在的資訊並不會被清除。
實驗環境:
1.作業系統
2.資料庫版本
實驗過程:
需要注意的地方:
select file#,dbablk,state from x$bh where obj=(select data_object_id from dba_objects where owner='SYS' and object_name='TEST') order by dbablk;這裡的data_object_id在對錶做move後不能替換成object_id。
具體原因參見我的另一篇博文:http://blog.itpub.net/30174570/viewspace-2140058/
實驗結論:
oracle資料庫執行alter system flush buffer_cache;只能清除資料快取,並不能清除BH資訊。
其他資料:
The possible values of X$BH.STATE are:
今天做關於引數db_file_multiblock_read_count實驗的時候,詳情見http://blog.itpub.net/30174570/viewspace-2140241/,對oracle資料庫執行alter system flush buffer_cache;指令發現,x$bh表中已經存在的資訊並不會被清除。
實驗環境:
1.作業系統
-
[oracle@oracle ~]$ uname -a
-
Linux oracle.example.com 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
-
[oracle@oracle ~]$ lsb_release -a
-
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
-
Distributor ID: RedHatEnterpriseServer
-
Description: Red Hat Enterprise Linux Server release 6.5 (Santiago)
-
Release: 6.5
- Codename: Santiago
-
SYS@proc> select * from v$version where rownum=1;
-
-
BANNER
-
--------------------------------------------------------------------------------
- Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
實驗過程:
-
SYS@proc> drop table test purge;
-
-
Table dropped.
-
-
SYS@proc> create table test as select * from dba_objects;
-
-
Table created.
-
-
SYS@proc> select file#,dbablk,state from x$bh where obj=(select data_object_id from dba_objects where owner='SYS' and object_name='TEST') order by dbablk;
-
-
FILE# DBABLK STATE
-
---------- ---------- ----------
-
1 93952 1
-
-
SYS@proc> shutdown immediate;
-
Database closed.
-
Database dismounted.
-
ORACLE instance shut down.
-
SYS@proc> startup;
-
ORACLE instance started.
-
-
Total System Global Area 521936896 bytes
-
Fixed Size 2254824 bytes
-
Variable Size 159385624 bytes
-
Database Buffers 356515840 bytes
-
Redo Buffers 3780608 bytes
-
Database mounted.
-
Database opened.
-
SYS@proc> select file#,dbablk,state from x$bh where obj=(select data_object_id from dba_objects where owner='SYS' and object_name='TEST') order by dbablk;
-
-
no rows selected
-
-
SYS@proc> select count(*) from test;
-
-
COUNT(*)
-
----------
-
86991
-
- SYS@proc> select file#,dbablk,state from x$bh where obj=(select data_object_id from dba_objects where owner='SYS' and object_name='TEST') order by dbablk;
-
-
FILE# DBABLK STATE
-
---------- ---------- ----------
-
1 93952 1
-
1 93952 3
-
1 93952 3
-
1 94668 1
-
...省略部分內容...
-
FILE# DBABLK STATE
-
---------- ---------- ----------
-
1 97609 1
-
1 97743 1
-
1 97744 1
-
1 97745 1
-
-
318 rows selected.
-
SYS@proc> alter system flush buffer_cache;
-
-
System altered.
-
-
SYS@proc> select file#,dbablk,state from x$bh where obj=(select data_object_id from dba_objects where owner='SYS' and object_name='TEST') order by dbablk;
-
-
FILE# DBABLK STATE
-
---------- ---------- ----------
-
1 93952 0
-
1 93952 0
-
1 93952 0
-
1 94668 0
-
...省略部分內容...
-
FILE# DBABLK STATE
-
---------- ---------- ----------
-
1 97609 0
-
1 97654 0
-
1 97738 0
-
1 97739 0
需要注意的地方:
select file#,dbablk,state from x$bh where obj=(select data_object_id from dba_objects where owner='SYS' and object_name='TEST') order by dbablk;這裡的data_object_id在對錶做move後不能替換成object_id。
具體原因參見我的另一篇博文:http://blog.itpub.net/30174570/viewspace-2140058/
實驗結論:
oracle資料庫執行alter system flush buffer_cache;只能清除資料快取,並不能清除BH資訊。
其他資料:
The possible values of X$BH.STATE are:
0, FREE, no valid block image
1, XCUR, a current mode block, exclusive to this instance
2, SCUR, a current mode block, shared with other instances
3, CR, a consistent read (stale) block image
4, READ, buffer is reserved for a block being read from disk
5, MREC, a block in media recovery mode
6, IREC, a block in instance (crash) recovery mode
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30174570/viewspace-2140062/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- X$BH與Buffer HeaderHeader
- oracle x$bh及v$bh與table cache表快取系列(三)Oracle快取
- oracle x$bh及v$bh與table cache表快取系列(二)Oracle快取
- oracle x$bh及v$bh與table cache表快取系列(一)Oracle快取
- buffer cache實驗2-詳解Buffer Header--DUMP buffer結合X$BH檢視各欄位Header
- Oracle Buffer Cache原理Oracle
- Oracle database buffer cacheOracleDatabase
- Oracle內部檢視:X$BHOracle
- 詳解Buffer Header--DUMP buffer結合X$BH檢視各欄位Header
- Oracle中Buffer Cache記憶體結構Oracle記憶體
- Oracle Cache Buffer ChainsOracleAI
- Oracle內部檢視:X$BH與X$LEOracle
- linux系統中的Cache和BufferLinux
- 【FLUSH】將Buffer Cache內容強制寫出到資料檔案
- [Oracle Script] Buffer Cache Hit RatioOracle
- 【BUFFER】Oracle buffer cache之 latch 學習記錄Oracle
- oracle buffer cache管理機制_buffer cache dump與lru機制小記Oracle
- Buffer和Cache的區別
- Cache 和 Buffer的區別
- Oracle Buffer Cache原理總結(一)Oracle
- Oracle Buffer Cache原理總結(二)Oracle
- x$le及x$bh詳解
- X$BH筆記<一>筆記
- cr塊和latch buffer cache chainAI
- Buffer Cache 原理
- cache buffer chainAI
- 執行alter system flush buffer_cache一定會產生檢查點嗎?
- latch free 中 cache buffer chain 的整理AI
- Ask Hoegh(5)——buffer cache和buffer有什麼區別?
- Cache 和 Buffer 有什麼區別?
- Cache 和 Buffer 的區別在哪裡?
- Oracle 11g buffer cache的設定Oracle
- oracle dml與block xcurrent_cr及x$bh小記OracleBloC
- IO之核心buffer----"buffer cache"
- [20231023]備庫與alter system flush buffer_cache.txt
- Buffer Cache Hit Ratio
- CACHE BUFFER CHAINSAI
- Database Buffer Cache (79)Database