0% found this document useful (0 votes)
36 views2 pages

Tuning The Program Global Area and The User Global Area

This document discusses tuning the Program Global Area (PGA) and User Global Area (UGA) for maximum Oracle database performance. It outlines steps to connect to Oracle Enterprise Manager and Memory Advisors to view and adjust the PGA size. It also provides SQL queries to view parameters and statistics related to cursor usage and memory consumption in the session UGA and across all users. The document explains how increasing the OPEN_CURSORS parameter allows more concurrent cursors, but uses more memory, and how setting SESSION_CACHED_CURSORS to cache closed cursors can improve performance with repeated SQL statements.

Uploaded by

Rama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

Tuning The Program Global Area and The User Global Area

This document discusses tuning the Program Global Area (PGA) and User Global Area (UGA) for maximum Oracle database performance. It outlines steps to connect to Oracle Enterprise Manager and Memory Advisors to view and adjust the PGA size. It also provides SQL queries to view parameters and statistics related to cursor usage and memory consumption in the session UGA and across all users. The document explains how increasing the OPEN_CURSORS parameter allows more concurrent cursors, but uses more memory, and how setting SESSION_CACHED_CURSORS to cache closed cursors can improve performance with repeated SQL statements.

Uploaded by

Rama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Tuning the Program Global Area and the User Global Area:

========================================================

In this recipe, we will see the Program Global Area (PGA) and the User Global Area
(UGA) and how to tune them for maximum performance.

The PGA is used to store real values of bind variables, sort areas, and cursor
state information. In a dedicated server environment this area is in private user
memory. Only in a shared-server environment the session stack space remains in the
PGA, while session data and cursor state are moved into the shared pool.

The following steps will demonstrate tuning the PGA and UGA:
1. Connect to Oracle Enterprise Manager as SYSDBA.

2. Go to Advisor Central.

3. Choose Memory Advisors.

4. Choose the PGA palette to show or change the size of PGA.

5. Connect to SQL*Plus as SYSDBA:


CONNECT / AS SYSDBA

6. Show the parameters related to cursors:


SHOW PARAMETER CURSOR

In step 6 and step 7, we query the statistics to see the space used by the current
session and the maximum UGA space used by all users, respectively.

7. Query for the total session memory:


SELECT SUM(VALUE) AS "session uga memory"
FROM V$MYSTAT, V$STATNAME
WHERE V$STATNAME.NAME = 'session uga memory'
AND V$MYSTAT.STATISTIC# = V$STATNAME.STATISTIC#;

8. Query for the session UGA memory:


SELECT SUM(VALUE) AS "session uga memory max"
FROM V$SESSTAT, V$STATNAME
WHERE V$STATNAME.NAME = 'session uga memory max'
AND V$SESSTAT.STATISTIC# = V$STATNAME.STATISTIC#;

Private information about the user session, such as private data and cursor state
are stored in the UGA. The UGA is located in the PGA when using dedicated server
environments, and inside the Shared Pool when using shared servers.

In step 5, we have seen the parameters related to cursor management. Let's explain
their use. OPEN_CURSORS defines the number of concurrent cursors that a user
process can use to reference private SQL areas. Increasing the value associated to
this parameter allows the user to use more cursors simultaneously, but the memory
consumption will be greater.

SESSION_CACHED_CURSORS allows defining the number of session cursors cached.


Setting this parameter to a value greater than zero results in a performance gain,
where there are repeated parse calls to the same SQL statements. Closed cursors
will be cached within the session, ready to be reused.
The last parameter, CURSOR_SHARING, allows us to define whether the cursors are
shared only when they match exactly (using EXACT) or also in other situations
(using FORCE and SIMILAR).

You might also like