Call (800) 766-1884 for Oracle support & training
Free Oracle Tips

Oracle Consulting Support
Oracle Upgrades
Use New Oracle Features
Oracle Replication Support
Oracle Training
Remote Oracle DBA
System Documentation
Oracle Tips
Oracle Performance

Free Oracle Tips



BC Oracle tuning

Oracle training

Oracle support

Remote Oracle



  Oracle Tips by Burleson

Using V$BH and X$BH to Monitor Buffer Use

In versions prior to Oracle, you may have to run the catparr.sql script, located in ORACLE_HOME/rdbms/admin, to create the v$bh view. The v$bh view, and its parent x$bh, are very important for monitoring buffer usage. Rather then depending on hit ratio, which is prone to miscalculation, problems with nonselective indexes, and other woes, the v$bh and x$bh tables can be used to tell you exactly what is happening with your buffer areas. Look at the report in Source 13.14.

SOURCE 13.14 Block usage script.

rem block_usage.sql


rem Mike Ault


@title80 'Block Usage Inside SGA Block Buffers'

spool rep_out\&db\block_usage

SELECT decode(,null,'UNUSED', ts_name,

       a.file# file_number,

       COUNT(a.block#) Blocks,

       COUNT (DISTINCT a.file# || a.block#) Distinct_blocks

   FROM V$BH a, file$ b, ts$ c

   See Code Depot

       The script in Source 13.14 used the v$bh SYS view to show which tablespaces have blocks inside the SGA and how many blocks are free. An example block usage report is shown in Listing 13.15.

LISTING 13.15 Example block usage report.

Date: 11/09/01                                         Page:   1

Time: 06:05 PM     
Block Usage Inside SGA Block Buffers    SYS

aultdb1 databas

------------------------------ ----------- ------ ---------------

UNUSED        0            7177            3791

SYSTEM        1            3149            3138

RBS           2            707             707

TOOLS         5            441             225

PERFSTAT      8            333             333

TEST_2K       9            2               2

This is an excerpt by Mike Ault’s book “Oracle Administration & Management” .  If you want more current Oracle tips by Mike Ault, check out his new book “Mike Ault’s Oracle Internals Monitoring & Tuning Scripts” or Ault’s Oracle Scripts Download.


Oracle performance tuning software 

Oracle performance tuning book


Oracle performance Tuning 10g reference poster
Oracle training in Linux commands
Oracle training Excel
Oracle training & performance tuning books



Copyright © 1996 -  2014 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation. 

Hit Counter