Tuning the Shared pool(4)
2012-01-21 19:26
330 查看
The reserved Pool
如果有一个请求,但shared pool中由于内存过于碎片化,没
有连续一片的chunk,就会请求保留池中的内存。
show parameter shared可以看到保留池大小参数。
Oracle是怎么分配shared pool空间呢?
1.From the unreserved part of the shared pool.
2.From the reserved pool.If there is not enough space
in the unreserved part of the shared pool,then Oracle
checks whether the reserved pool has enough space.
3.From memory,If there is not enough space in the
unreserved and reserved parts of the shared pool,then
Oracle attempts to free enough memory for the
allocation.It then retries the unreserved and reserved
parts of the shared pool.
4:LRU算法交换
SHARED_POOL_RESERVED_SIZE一般是SHARED_POOL_SIZE的5%-
10%。
动态性能视图:v$shared_pool_reserved
SELECT
free_space,requests,request_misses,request_failures
FROM v$shared_pool_reserved;
Keeping Large Objects
1.Decide which packages or cursors to pin in memory.
2.Start up the database.
3.Make the call to DBMS_SHARED_POOL.KEEP to pin your
objects.
固定时希望在instance刚启动时固定,因为这时候没什么碎片
,有更多连续空间供固定。
alter system flush shared_pool;这个命令可以将共享池中
的对象都清空出去,但对固定了的对象没影响。
Find the anonymous PL/SQL blocks and convert them into
small anonymous PL/SQL blocks that call packaged
functions:
查有哪些匿名的PL/SQL块,:
SELECT sql_text FROM v$sqlarea
WHERE command_type = 47
AND length(sql_text) > 500;
Other Parameters
OPEN_CURSORS
CURSOR_SPACE_FOR_TIME
SESSION_CACHED_CURSORS
CURSOR_SHARING
Tuning the DD Cache
一般调整shared pool,首先是library cache,然后是data
dictionary.一般dd一开始是空的,随着查询越来越多,条目
才越来越多。
v$rowcache 包含了数据字典的重要指标。
GETMISSES列一般是不可能为0的,开始时候DD里面什么都没有
,每次查询,这个值都会增加,到了一定程度,就稳定了。
SELECT parameter,gets,getmisses FROM v$rowcache;
调优目标:Avoid Dictionary cache misses
只能调SHARED_POOL_SIZE了。
如果有一个请求,但shared pool中由于内存过于碎片化,没
有连续一片的chunk,就会请求保留池中的内存。
show parameter shared可以看到保留池大小参数。
Oracle是怎么分配shared pool空间呢?
1.From the unreserved part of the shared pool.
2.From the reserved pool.If there is not enough space
in the unreserved part of the shared pool,then Oracle
checks whether the reserved pool has enough space.
3.From memory,If there is not enough space in the
unreserved and reserved parts of the shared pool,then
Oracle attempts to free enough memory for the
allocation.It then retries the unreserved and reserved
parts of the shared pool.
4:LRU算法交换
SHARED_POOL_RESERVED_SIZE一般是SHARED_POOL_SIZE的5%-
10%。
动态性能视图:v$shared_pool_reserved
SELECT
free_space,requests,request_misses,request_failures
FROM v$shared_pool_reserved;
Keeping Large Objects
1.Decide which packages or cursors to pin in memory.
2.Start up the database.
3.Make the call to DBMS_SHARED_POOL.KEEP to pin your
objects.
固定时希望在instance刚启动时固定,因为这时候没什么碎片
,有更多连续空间供固定。
alter system flush shared_pool;这个命令可以将共享池中
的对象都清空出去,但对固定了的对象没影响。
Find the anonymous PL/SQL blocks and convert them into
small anonymous PL/SQL blocks that call packaged
functions:
查有哪些匿名的PL/SQL块,:
SELECT sql_text FROM v$sqlarea
WHERE command_type = 47
AND length(sql_text) > 500;
Other Parameters
OPEN_CURSORS
CURSOR_SPACE_FOR_TIME
SESSION_CACHED_CURSORS
CURSOR_SHARING
Tuning the DD Cache
一般调整shared pool,首先是library cache,然后是data
dictionary.一般dd一开始是空的,随着查询越来越多,条目
才越来越多。
v$rowcache 包含了数据字典的重要指标。
GETMISSES列一般是不可能为0的,开始时候DD里面什么都没有
,每次查询,这个值都会增加,到了一定程度,就稳定了。
SELECT parameter,gets,getmisses FROM v$rowcache;
调优目标:Avoid Dictionary cache misses
只能调SHARED_POOL_SIZE了。
相关文章推荐
- Oracle Concepts - Guidelines for Tuning the Oracle Shared Pool
- Tuning the Shared pool(3)
- Chapter 04-Tuning the shared Pool
- Tuning the Shared pool(1)
- ORACLE9i_性能调优基础三(Tuning the Shared Pool)
- Tuning the shared pool
- Advanced Tuning ofthe Shared Pool
- Tuning the Shared pool(2)
- Troubleshooting: Tuning the Shared Pool and Tuning Library Cache Latch Contention (文档 ID 62143.1)
- Oracle tuning the shared pool
- Getting Contiguous Space Currently in the Shared Pool(Oracle10g Tuning Technology)
- Shows the reason for multiple statement childs in shared pool
- Oracle tuning the oracld shared server
- Oracle Concepts - Disk IO and the Shared Pool
- Diagnosing and Resolving Error ORA-04031 on the Shared Pool or Other Memory Pools (文档 ID 146599.1)
- VIEW: X$KSMLRU - LRU flushes from the shared pool - (7.3 - 8.1) (文档 ID 43600.1)
- Using dbms_shared_pool.purge to remove a single task from the library cache
- How to Pin a Cursor in the Shared Pool using DBMS_SHARED_POOL.KEEP (文档 ID 726780.1)
- Gathering Initial Troubleshooting Information for Analysis of ORA-4031 Errors on the Shared Pool
- Gathering Initial Troubleshooting Information for Analysis of ORA-4031 Errors on the Shared Pool