V$BH:This is a Real Application Clusters view. This view gives the status and number of pings for every buffer in the SGA.
--记录了sga缓冲区中的object及其状态
| Column | Datatype | Description |
|---|---|---|
FILE# | NUMBER | Datafile identifier number (to find the filename, query
DBA_DATA_FILES or V$DBFILE) |
BLOCK# | NUMBER | Block number |
CLASS# | NUMBER | Class number |
STATUS | VARCHAR2(6) | Status of the buffer:
|
XNC | NUMBER | Number of PCM x to null lock conversions due to contention with another instance. This column is obsolete and maintained for backward compatibility. |
LOCK_ELEMENT_ADDR | RAW(4 | 8) | Address of the lock element that contains the PCM lock that is covering the buffer. If more than one buffer has the same address, then these buffers are covered by the same PCM lock. |
LOCK_ELEMENT_NAME | NUMBER | The address of the lock element that contains the PCM lock that is covering the buffer. If more than one buffer has the same address, then these buffers are covered by the same PCM lock. |
LOCK_ELEMENT_CLASS | NUMBER | The address of the lock element that contains the PCM lock that is covering the buffer. If more than one buffer has the same address, then these buffers are covered by the same PCM lock. |
FORCED_READS | NUMBER | Number of times the block had to be reread from the cache because another instance has forced it out of this instance's cache by requesting the lock on the block in exclusive mode |
FORCED_WRITES | NUMBER | Number of times GCS had to write this block to cache because this instance had used the block and another instance had requested the lock on the block in a conflicting mode |
DIRTY | VARCHAR2(1) | Y - block modified |
TEMP | VARCHAR2(1) | Y - temporary block |
PING | VARCHAR2(1) | Y - block pinged |
STALE | VARCHAR2(1) | Y - block is stale |
DIRECT | VARCHAR2(1) | Y - direct block |
NEW | VARCHAR2(1) | Always set to N. This column is obsolete and maintained for backward compatibility. |
OBJD | NUMBER | Database object number of the block that the buffer represents |
TS# | NUMBER | Tablespace number of block |
SQL> select sum(BLOCK#),status from v$bh group by status;
SUM(BLOCK#) STATUS
----------- ---------------------
1.0537E+11 xcur
1.1988E+10 cr
SQL> alter system flush buffer_cache;
System altered.
SQL> select sum(BLOCK#),status from v$bh group by status;
SUM(BLOCK#) STATUS
----------- ---------------------
854666 xcur
1.1735E+11 free
Oracle V$BH 视图解析
本文介绍了Oracle数据库中V$BH视图的详细内容,包括各字段的意义及使用方法。通过示例展示了如何查询缓冲区状态以及如何刷新缓存。
1243

被折叠的 条评论
为什么被折叠?



