V$BH
displays the status and number of pings for every buffer in the SGA. This is a Real Application Clusters view.
Column | Datatype | Description |
|
| Datafile identifier number (to find the filename, query |
|
| Block number |
|
| Class number |
|
| Status of the buffer: · · · · · · · |
|
| Number of PCM x to null lock conversions due to contention with another instance. This column is obsolete and maintained for backward compatibility. |
|
| 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. |
|
| 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. |
|
| 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. |
|
| 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 |
|
| 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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Always set to |
|
| Database object number of the block that the buffer represents |
|
| Tablespace number of block |
Note:
1. select * from V$BH WHERE FILE#=16;
FILE# | BLOCK# | CLASS# | STATUS | XNC | FORCED_ READS | FORCED_ WRITES | LOCK_ ELEMENT_ ADDR | DIRTY | TEMP | | STALE | DIRECT | NEW | OBJD | TS# |
16 | 3 | 12 | xcur | 0 | 0 | 0 | 00 | N | N | N | N | N | N | 4294967295 | 16 |
16 | 2 | 13 | xcur | 0 | 0 | 0 | 00 | N | N | N | N | N | N | 4294967295 | 16 |
2. V$BH shows the contents of the data buffers as well as the number of blocks for each type of segment in the buffer. It is especially useful for showing the amount of table and index caching in databases with multiple data buffer pools. The following script taken from Inside the Oracle data buffer cache analyzes the contents of data buffers.
set pages 999 set lines 92
ttitle 'Contents of Data Buffers'
drop table t1;
create table t1 as select o.owner owner, o.object_name object_name, o.subobject_name subobject_name, o.object_type object_type, count(distinct file# || block#) num_blocks from dba_objects o, v$bh bh where o.data_object_id = bh.objd and o.owner not in ('SYS','SYSTEM') and bh.status != 'free' group by o.owner, o.object_name, o.subobject_name, o.object_type order by count(distinct file# || block#) desc ;
column c0 heading "Owner" format a12 column c1 heading "Object|Name" format a30 column c2 heading "Object|Type" format a8 column c3 heading "Number of|Blocks in|Buffer|Cache" format 99,999,999 column c4 heading "Percentage|of object|blocks in|Buffer" format 999 column c5 heading "Buffer|Pool" format a7 column c6 heading "Block|Size" format 99,999
select t1.owner c0, object_name c1, case when object_type = 'TABLE PARTITION' then 'TAB PART' when object_type = 'INDEX PARTITION' then 'IDX PART' else object_type end c2, sum(num_blocks) c3, (sum(num_blocks)/greatest(sum(blocks), .001))*100 c4, buffer_pool c5, sum(bytes)/sum(blocks) c6 from t1, dba_segments s where s.segment_name = t1.object_name and s.owner = t1.owner and s.segment_type = t1.object_type and nvl(s.partition_name,'-') = nvl(t1.subobject_name,'-') group by t1.owner, object_name, object_type, buffer_pool having sum(num_blocks) > 10 order by sum(num_blocks) desc ; |
Oracle data dictionary views
Oracle dynamic performance views
No comments:
Post a Comment