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

Home
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


 
HTML Text AOL

Free Oracle App Server Tips


 
HTML Text

Oracle support

Oracle training

Oracle tuning

Rednecks!

Remote Oracle

Custom Oracle Training

Sizing the KEEP Pool

Once the tables and indexes have been loaded into the KEEP buffer pool, the buffer_pool_keep  parameter must be increased by the total number of blocks in the migrated tables.

 

The following script will total the number of blocks that the KEEP pool requires, insuring 100 percent data caching.  The script adds 20 percent to the total to allow for growth in the cached objects.  The DBA should run this script frequently to make sure the KEEP pool always has a DBHR of 100 percent.

 

prompt The following will size your init.ora KEEP POOL,

prompt based on Oracle8 KEEP Pool assignment values

prompt

 

select

'BUFFER_POOL_KEEP = ('||trunc(sum(s.blocks)*1.2)||',2)'

from

   dba_segments s

where

   s.buffer_pool = 'KEEP';

;

 

This script outputs the Oracle parameter that resizes the KEEP pool for the next restart of the Oracle instance.  The parameter is placed in the init.ora file.  Oracle10g deprecates buffer_pool_keep and it cannot be modified with an ALTER SYSTEM command.

 

BUFFER_POOL_KEEP=(1456, 3)

 

Now, the database can be bounced and the parameter change will take effect.

Advanced KEEP Pool Candidate Identification

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 hot_buffers.sql 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.

 

          hot_buffers.sql

 

 

-- You MUST connect as SYS to run this script

connect sys/manager;

 

set lines 80;

set pages 999;

 

column avg_touches           format 999

column myname heading 'Name' format a30

column mytype heading 'Type' format a10

column buffers               format 999,999

 

SELECT 

   object_type  mytype,

   object_name  myname,

   blocks,

   COUNT(1)     buffers,

   AVG(tch)     avg_touches

FROM

   sys.x$bh     a,

   dba_objects  b,

   dba_segments s

WHERE

   a.obj = b.data_object_id

and

   b.object_name = s.segment_name

and

   b.owner not in ('SYS','SYSTEM')

GROUP BY

   object_name,

   object_type,

   blocks,

   obj

HAVING

   AVG(tch) > 5

AND

   COUNT(1) > 20;

 

The hot_buffers.sql script will 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

 

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 consideration is given to adding the page table to the KEEP pool, 104 blocks would have to be added to the Oracle buffer_pool_keep parameter.

 

The results from this script will differ every time it is executed because the data buffers are dynamic, and data storage is transient.  Some DBAs schedule this script as often as every minute, if they need to see exactly what is occurring inside the data buffers.


 

SEE CODE DEPOT FOR FULL SCRIPTS


This is an excerpt from my latest book "Oracle Tuning: The Definitive Reference". 

You can buy it direct from the publisher for 50%-off and get instant access to the code depot of Oracle tuning scripts:

http://www.rampant-books.com/book_1002_oracle_tuning_definitive_reference_2nd_ed.htm

 

 

 
 
 

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.