Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 
 

Optimize your Oracle PGA RAM

Oracle Tips by Burleson Consulting


Update:  Oracle technology is constantly changing, so don't miss my new notes on updates to Oracle PGA behavior.   Also see these important notes on over-riding the Oracle PGA defaults.


Determining the PGA size is a critical part of Oracle RAM tuning. Each PGA RAM region is allocated for every dedicated connection, and the size is determined as follows:  

  • OS Overhead - "Program Global Area (PGA):OS Overhead"  - We reserve 2 meg for Windows and 1 meg for UNIX. 
  • Sort_area_size parameter value - " Program Global Area (PGA): Sort_area_size"  - This RAM is used for data row sorting inside the PGA. 
  • Hash_area_size parameter value - " Program Global Area (PGA) :Hash_area_size "  - This RAM defaults to 1.5 times sort_area_size and is used for performing hash joins of Oracle tables.


 The values for sort_area_size and hash_area_size  are quickly shown with the Oracle show parameters command:

 
 
SQL> show parameters area_size
 
NAME TYPE VALUE
------------------------------------ ----------- ---------
bitmap_merge_area_size               integer 1048576
create_bitmap_area_size              integer 8388608
hash_area_size                       integer 1048576
sort_area_size                       integer 524288
workarea_size_policy                 string MANUAL             
 

A quick dictionary query (pga_size_each.sql) against the v$parameter view will yield the correct value for each PGA RAM region size.
 
The data dictionary query output shows that the Oracle PGA will use 3.6 megabytes of RAM memory for each connected Oracle session.  


PGA_SIZE                         
------------
3,621,440

 
If we now multiply the number of connected users by the PGA demands for each user, we will know exactly how much RAM should be reserved for connected sessions. Alternatively, we could issue an SQL statement to obtain the same result. The script for such a statement is shown below.

A script to compute total PGA RAM

This script reads both the sort_area_size and hash_area_size to compute the total PGA region. The script will display a prompt for the high-water mark of connected users and then computes the total PGA RAM to reserve for dedicated Oracle connections. The MS-Windows PGA session incurs a 2 MB overhead in this example.

set pages 999;
column pga_size format 999,999,999
accept hwm number prompt 'Enter the high-water mark of connected users: '
select
&hwm*(2048576+a.value+b.value) pga_size
from
v$parameter a,
v$parameter b
where
a.name = 'sort_area_size'
and
b.name = 'hash_area_size'
;



Running the script, we see that we are prompted for the high-water mark. We will assume that the HWM of connected sessions to the Oracle database server is 100. Oracle will do the math and display the amount of RAM to reserve for Oracle connections.
 
SQL> @pga_size
 
Enter the high-water mark of connected users: 100

old 2: &hwm*(2048576+a.value+b.value) pga_size
new 2:           100*(2048576+a.value+b.value) pga_size
 
PGA_SIZE
------------  
362,144,000 
                                              
 
This and many related topics are covered in my upcoming new book Oracle Tuning: The Definitive Reference by Rampant TechPress. This book will be printed in just a few weeks, and is available at this link:
 

See my other notes on Oracle PGA tuning:
If you like Oracle tuning, you may enjoy the new book "Oracle Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning tips & scripts. 

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


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.