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

Corporate Oracle Training
Custom Oracle Training
Oracle New Features Training
Advanced Oracle DBA Classes
Oracle Tuning Courses
Oracle Tips & Tricks
Oracle Training Links
Oracle Training Links
Oracle Training Links

We are top for USA Oracle Training Clients


Free Oracle Tips


Free Oracle App Server Tips


Oracle support

Oracle training

Oracle tuning


Remote Oracle

Custom Oracle Training


  Oracle Tips by Burleson

Oracle STATSPACK Tables and KEEP Pool Data

The advanced Oracle professional can run sophisticated scripts to explain the SQL statements stored in the stats$sql_summary table. Using the default level-5 STATSPACK snapshots, the stats$sql_summary table will contain the top SQL statements that were in the library cache at the time of each hourly snapshot.

Alternatively, the plan9i.sql script can simply be modified to use the stats$sql_summary table instead of the v$sqltext.

We have seen that the KEEP pool is an excellent storage location for small-table, full-table scans. It can also be a good place to store data blocks from frequently used segments that consume a lot of block space in the data buffers. These blocks are usually found within small reference tables that are accessed through an index and do not appear in the full-table scan report.

The x$bh internal view is the only window into the internals of the Oracle database buffers. The view contains much detailed information about the internal operations of the data buffer pools. Both the number of objects in a specific type and the number of touches for that object type can be counted in the x$bh table. It can even be used to create a snapshot of all the data blocks in the buffer.

The query shown below utilizes the x$bh view to identify all the objects that reside in blocks averaging over five touches and occupying over twenty blocks in the cache. It finds tables and indexes that are referenced frequently and are good candidates for inclusion in the KEEP pool.

See code depot for full scripts

-- ****************************************************************
-- Display hot buffer detail
-- ****************************************************************

. . .
  AVG(tch) avg_touches
  sys.x$bh a,
  dba_objects b,
  dba_segments s
  . . .
COUNT(1) > 20;

The DBA should note that the hot_buffers.sql script would only run on Oracle8i and subsequent versions. This is because the tch column was not added until Oracle 8.1.6.

The output from the hot_buffers.sql script is shown next. It identifies the active objects within the data buffers based on the number of data blocks and the number of touches.

Type    Name                          BLOCKS  BUFFERS AVG_TOUCHES
------- ------------------------- ---------- -------- -----------
TABLE   PAGE                             104      107          44
TABLE   SUBSCRIPTION                     192       22          52
INDEX   SEQ_KEY_IDX                       40       34          47
TABLE   SEC_SESSIONS                      80      172          70
TABLE   SEC_BROWSER_PROPERTIES            80       81          58
TABLE   EC_USER_SESSIONS                  96       97          77
INDEX   SYS_C008245                       32       29         270

Listing 3.5 – Hot buffer touches in the data buffers

The DBA must now decide whether the hot objects are to be segregated into the KEEP pool. In general, there should be enough RAM available to store the entire table or index. Using the example, if we are considering adding the page table to the KEEP pool, we would need to add 104 blocks to the Oracle buffer_pool_keep parameter.


The above text is an excerpt from "Creating a Self Tuning Oracle Database", by Rampant TechPress.  It is only $9.95 and all scripts in this tips can be immediately downloaded.

Complete Oracle Script Collection Available

BC shares their personal arsenal of Oracle data dictionary scripts in this comprehensive download. With decades of experience using Oracle monitoring scripts and Oracle tuning scripts, we shares our secrets for navigating the Oracle data dictionary.

Packed with more than 680 ready-to-use Oracle scripts, this is the definitive collection for every senior Oracle DBA.

It would take man-years to develop these scripts from scratch, making this download the best value in the Oracle industry.




Oracle performance tuning book



Oracle performance tuning software

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


email BC:

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

Oracle® is the registered trademark of Oracle Corporation.