Professional Documents
Culture Documents
� ���
�� �ֹ���
�ִ��س ��Ƭ����ʱ�����������������½����ܻ����ص£�ˢ�¹���
�ָ�����ص���ܡ
���� �� ػ
ʹ�������������ˢ�¹����أ
ALTER SYSTEM FLUSH SHARED_POOL;
Ҫ ���עʱ��ˢ�¹���
��ʹ���е�û��ʹ��DBMS_SHARED_POOL.KEEP����Ķ���ȫ����������Թ���ظո� ˢ� µ� ʱ� � S
QL��PL/SQL��ִ��Ч�ʻ�����½����Ҫ���� װ�غͷ�����ЩSQL ��PL/SQL ������� �ܿ�ϵͳ
�����ܻ��� ������߲ˢ��ǰ��
�����
The DBMS_SHARED_POOL package provides procedures that allow PL/SQL objects and
SQL cursors to be pinned (kept) in the Oracle shared pool. Once pinned, objects are
not subject to the normal aging-out processes of the shared pool��
ORA-04031 errors where insufficient memory is available and the user call fails
to execute.
Pinning large objects into the shared pool when the Oracle instance is first
started can reduce or eliminate these problems. Some DBAs use DBMS_SHARED_POOL in
their database startup scripts to help ensure that shared pool memory is used
efficiently��
This procedure keeps an object in the shared pool. Once an object has been kept in
the shared pool, it is not subject to aging out of the pool. This may be useful for
frequently used large objects. When large objects are brought into the shared pool,
several objects may need to be aged out to create a contiguous area large enough.
Syntax
DBMS_SHARED_POOL.KEEP (
name VARCHAR2,
flag CHAR DEFAULT 'P');
Parameters
name
The value for this identifier is the concatenation of the address and hash_value
columns from the v$sqlarea view. This is displayed by the SIZES procedure.
flag
(Optional) If this is not specified, then the package assumes that the first
parameter is the name of a package/procedure/function and resolves the name.
Set to 'P' or 'p' to fully specify that the input is the name of a
package/procedure/function.
Set to 'T' or 't' to specify that the input is the name of a type.
Set to 'R' or 'r' to specify that the input is the name of a trigger.
Set to 'Q' or 'q' to specify that the input is the name of a sequence.
In case the first argument is a cursor address and hash-value, the parameter should
be set to any character except 'P' or 'p' or 'Q' or 'q' or 'R' or 'r' or 'T' or
't'.
SQL> @?/rdbms/admin/dbmspool.sql
������Ѵ�����
��Ȩ�ɹ���
��ͼ�Ѵ�����
��������Ѵ�����
SQL> @?/rdbms/admin/prvtpool.plb
��ͼ�Ѵ�����
��������Ѵ�����
�ú�
��������� �Ϳ�
ʼ�
���
����
��ˢ�
�
¹ � е 飺
SQL> create sequence seq_test;
�����Ѵ�����
NEXTVAL
----------
1
ϵͳ�Ѹ�ġ�
NEXTVAL
----------
21
��ʾ������flush �����أsequence��cache������ˡ�
PL/SQL ����ѳɹ���ɡ�
SQL>
��ˢ�¹�����������أ
NEXTVAL
----------
22
ϵͳ�Ѹ�ġ�
NEXTVAL
----------
23
����sysdbal����ݿ⣬unkeep�����С�
PL/SQL ����ѳɹ���ɡ�
����ٳˢ��shared_pool��
NEXTVAL
----------
24
ϵͳ�Ѹ�ġ�
NEXTVAL
----------
41