Professional Documents
Culture Documents
6
Last Login: July 7, 2021 1:36 PM GST Nawab (Available) (0) Contact Us Help
PowerView is Off
Dashboard Knowledge Service Requests Patches & Updates
Give Feedback...
Copyright (c) 2021, Oracle. All rights reserved. Oracle Confidential.
NOTE: This article was written for Oracle7 and Oracle8 databases. With
Document Details
the latest versions of Oracle it is best to use the advise information in
Type:
Note:255409.1 SCRIPT Size Shared Pool using V$shared_pool_advice
PROBLEM
Status:
NOte:4061621.8 Bug 4061621 - Shared pool advisory does not consider PLSQL objects
ARCHIVED
Last Major
Jul 25, 2019
Update:
Problem Description:
Jul 25, 2019
Last Update:
====================
the proper size of the shared pool. The following provides some guidelines
Related Products
for this. It should be emphasized that these are just guidelines, there are
Oracle Database - Enterprise
no hard and fast rules here and experimentation will be needed to determine
Edition
a good value.
The shared pool size is highly application dependent. To determine the shared
Information Centers
pool size that will be needed for a production system, it is generally
Database Server/Client
take some measurements. The test system should be run with a very large value
Installation and
for the shared pool size to make the measurements meaningful.
Upgrade/Migration
[1351022.2]
インフォメーション・センタ
This is especially effective because all large pl/sql object should be 'kept'
ー: データベースおよび
Enterprise Manager 日本語ド
in the shared pool at all times.
B) SQL
キュメント [1946305.2]
The amount of memory needed to store sql statements in the shared pool is
Show More
application has no dynamic sql then the amount of memory can simply
Document References
be measured after the application has run for a while by just selecting
The amount of memory for the shared sql can be approximated by the following:
Recently Viewed
need to be budgeted for this also, but there are few rules here.
ORA-04031 or ORA-04036 in
Alert Log File with Large
C) PER-USER PER-CURSOR MEMORY
Amounts of Free Memory in
non-CDBs or when PDB
Reduced [2628582.1]
concurrent user for each open cursor that the user has whether the cursor
is shared or not. During the peak usage time of the production system, you
ORA-4031 due to Huge
can measure this as follows:
"ges resource
dynamic" and
"ges enqueues"
select sum(250 * users_opening) from v$sqlarea;
Show More
You will need to add a minimum of 20-30% overhead to the values calculated
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=343658052221383&parent=DOCUMENT&sourceId=146599.1&id=1012046.6&_afrWind… 1/3
7/8/2021 Document 1012046.6
above to allow for unexpected and unmeasured usage of the shared
pool other than object memory, shared sql or cursor memory. If the system is
making heavy use of dynamic SQL 20% may not be enough, since this will come
---------------------------------
A)If you are using multi-threaded server, then you will need to allow enough
memory for all the shared server users to put their session memory in the
shared pool. This can be measured for one user with the following query:
A more conservative value to use is the maximum session memory that was
To select this value for all the currently logged on users the following query
can be used:
B) OVERHEAD
If the system is making heavy use of dynamic SQL this 20% may not be
enough, since this will come out of the runtime heap in the shared pool.
You will need to add a minimum of 20-30% overhead to the values calculated
pool other than object memory, shared sql or cursor memory. If the system is
making heavy use of dynamic SQL 20% may not be enough, since this will come
Problem Explanation:
====================
Solution Description:
=====================
Here is the script that should give a good indication of shared pool
spool pool_est
/*
*********************************************************
* *
* *
********************************************************/
Rem commands.
declare
object_mem number;
shared_sql number;
cursor_ovh number;
cursor_mem number;
mts_mem number;
used_pool_size number;
free_mem number;
begin
-- assumes 250 bytes per open cursor, for each concurrent user.
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=343658052221383&parent=DOCUMENT&sourceId=146599.1&id=1012046.6&_afrWind… 2/3
7/8/2021 Document 1012046.6
WHERE type='CURSOR';
-- For a test system -- get usage for one user, multiply by # users
-- MTS memory needed to hold session information for shared server users
-- This query computes a total for all currently logged on users (run
-- multiply by # users.
where s.statistic#=n.statistic#
-- Free (unused) memory in the SGA: gives an indication of how much memory
-- For non-MTS add up object, shared sql, cursors and 20% overhead.
used_pool_size := round(1.2*(object_mem+shared_sql));
-- For MTS mts contribution needs to be included (comment out previous line)
-- used_pool_size := round(1.2*(object_mem+shared_sql+mts_mem));
-- Display results
|| to_char(round(object_mem/1024/1024,2)) || 'MB)');
|| to_char(round(shared_sql/1024/1024,2)) || 'MB)');
|| to_char(round(free_mem/1024/1024,2)) || 'MB)');
to_char(round(used_pool_size/1024/1024,2)) || 'MB)');
end;
/
spool off
REFERENCES
Related
Products
Oracle Database Products > Oracle Database Suite > Oracle Database > Oracle Database - Enterprise Edition > RDBMS
Keywords
SIZING
Back to Top
Copyright (c) 2021, Oracle. All rights reserved. Legal Notices and Terms of Use Privacy Statement
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=343658052221383&parent=DOCUMENT&sourceId=146599.1&id=1012046.6&_afrWind… 3/3