|
* memoryÀÇ ¼³Á¤ --> shared_pool_size °áÁ¤ ¹æ¹ý
ApplicationÀÌ ¾ó¸¶³ª ¸¹Àº memory¸¦ »ç¿ëÇϳª? (Global Space Allocation) ¸¦ »êÁ¤ÇÏÀÚ.
--> ¾Æ·¡¿¡ ±â¼úµÈ ³»¿ëÀ» ÀÚ¼¼È÷ º¸¸é
Shared_pool_size´Â ¾Æ·¡ÀÇ (a)+(b)+(c)+(30%Á¤µµÀÇ free spaceÃß°¡) ·Î Àâ´Â´Ù.
¸ÕÀú init<SID>.ora¿¡¼ shared_pool_size À» ÃæºÐÈ÷ Å©°Ô settingÇصΰí
applicationÀ» µ¹·Áº¸°í ´ÙÀ½À» Á¶È¸ÇØ º¸¸é
a. shared object¿¡ ´ëÇÑ ÇÊ¿äÇÑ °ø°£
SQL> select sum(sharable_mem)
2 from v$db_object_cache
3 where owner is not null;
SUM(SHARABLE_MEM)-----------------
3354299 ---> (a)
Âü°í) Á» ÀÚ¼¼È÷ object typeº°·Î º¸·Á¸é
SQL> select type,sum(sharable_mem)
2 from v$db_object_cache
3 where type='PACKAGE' or type='PACKAGE BODY' or
4 type='FUNCTION' or type='PROCEDURE'
5 group by type;
TYPE SUM(SHARABLE_MEM)---------------------------- -----------------
PACKAGE 301274
PACKAGE BODY 13437
b. ÀÚÁÖ »ç¿ëµÇ´Â memory°ø°£ °è»ê
±×¸®°í ÀÚÁÖ »ç¿ëµÇ´Â(ÀϹÝÀûÀ¸·Î 5ȸÀÌ»ó) applicationÀÇ memory¸¦ Á¶È¸ÇØ º¸¸é
SQL> select sum(sharable_mem)
2 from v$sqlarea where executions > 5;
SUM(SHARABLE_MEM)-----------------
190765 ---> (b)
c. openµÈ cursorÀÇ ¼ö¿¡ µû¸¥ memoryÇÒ´ç
¶Ç user´ç open cursor´ç shared poolÀº 250bytes Á¤µµ ÇÒ´ç Çϴ°ÍÀ» º¸ÅëÀ¸·Î Çϸç
peak time½ÃÀÇ Àüü memory´Â (openµÈ cursor°¹¼ö * 250 bytes)·Î »ý°¢ÇÏ¿© »êÁ¤ÇÑ´Ù.
SQL> select sum(250 * users_opening)
2 from v$sqlarea;
SUM(250*USERS_OPENING)----------------------
250 ---> (c) : ÇöÀç´Â openµÈ cursorÇÏ Çϳª»ÓÀÌ´Ù.
============================================================
* Large Memory Requirements : shared_pool_reserved_size¸¦ »ç¿ëÇϱâ
shared pool ³»¿¡ fragmentationÀÌ ³ªÁö ¾ÊÀº ÀÏÁ¤ °ø°£ »ç¿ë
pl/sql compilationÀ̳ª trigger compilation°ú °°Àº large allocation¿¡ »ç¿ë
init<SID>.ora¿¡
shared_pool_reserved_size¸¦ ¼³Á¤ÇØ Áִµ¥ ÀϹÝÀûÀ¸·Î shared_pool_sizeÀÇ 10%Á¤µµ¸¦ ÃʱⰪÀ¸·Î
¼³Á¤ÇÏ°í ÇÊ¿ä½Ã ´Ã·ÁÁØ´Ù. ´ë½Å shared_pool_size ÀÇ 50%¸¦ ³ÑÀ» ¼ö ¾ø°í ³ÑÀ¸¸é startup½Ã
´ÙÀ½°ú °°Àº error°¡ ³´Ù.
SQL> startup
ORA-01078: ½Ã½ºÅÛ ¸Å°³º¯¼ö ó¸® ¿À·ùÀÔ´Ï´Ù
v$shared_pool_reserved view´Â shared pool ³»¿¡ reserved poolÀ» tuningÇϴµ¥ µµ¿òÀÌ µÈ´Ù.
shared_pool_reserved_size °¡ settingµÇ¾î ÀÖÀ» °æ¿ì¿¡¸¸ columnµéÀÌ À¯È¿ÇÏ´Ù.
Áß¿äÇÑ columnµéÀ» º¸¸é free_space,avg_free_size,max_free_size,request_misses µîÀÌ ÀÖ´Ù.
* reserved space¸¦ tuningÇϱâ
request_misses=0 À¸·Î Çϴ°ÍÀÌ ¸ñÀûÀÌ´Ù.
À§¿¡¼ ¾ð±ÞÇÑ v$shared_pool_reserved view »Ó ¾Æ´Ï¶ó
$ORACLE_HOME/rdbms/admin/dbmspool.sqlÀ» µ¹¸®°í ³ª¼
dbms_shared_pool package³»¿¡ , aborted_request_threshold procedure »ç¿ëÇÏ¿© ÃøÁ¤
a. shared_pool_reserved_size°¡ ÀÛÀ¸¸é : - shared_pool_reserved_size, shared_pool_size ´Ã¸²
- reserved list¿¡¼ ÇÒ´çµÈ memoryÀÇ ¼ö¸¦ ÁÙÀÓ
* Library CacheÀÇ Reloads : reloads/pins < 1% ÀÌÇÏÀÌ¿©¾ß ÁÁ´Ù.
-> 1% À̸é LRU list¿¡¼ aging outµÈ°Í, invalidation check =>shared_pool_size¸¦
Áõ°¡½ÃŲ´Ù.
a. v$librarycache¿¡¼ È®ÀÎ
SQL> select sum(pins) "Executions", sum(reloads) "Cache Misses",
2 sum(reloads/pins)
3 from v$librarycache
4 where pins != 0;
Executions Cache Misses SUM(RELOADS/PINS)---------- ------------ -----------------
8573 7 .000919601 -> 1%ÀÌÇÏÀ̹ǷΠ»óÅ°¡ ¾çÈ£
b. utlbstat/utlestatÈÄ report.txt¿¡¼ È®ÀÎ
LIBRARY GETS GETHITRATIO PINS PINHITRATIO RELOADS --------------- ---------- ----------- ---------- ----------- ----------
INVALIDATIONS -------------
SQL AREA 410 .954 1087 .964 0
1
À§¿¡¼ reloads/pins °¡ 1%º¸´Ù Å©¸é init<SID>.ora¿¡¼ shared_pool_size Áõ°¡½ÃŲ´Ù.
* Data Dicitonary Cache Tuning : v$rowcache
Library cache¿Í ÇÔ²² Shared pool ÀÇ partÀÎ Data Dicitonary Cache¿¡¼ÀÇ Tuning ¿ª½Ã
missÀ²À» ÁÙÀÌ´Â °ÍÀÌ´Ù.
ÁÖÀÇÇØ¾ß ÇÒ Á¡Àº db startup Á÷ÈÄ À̸¦ ÃøÁ¤ÇØ º¸¸é ´ç¿¬È÷ missÀ²ÀÌ ³ô´Ù. Data Dicitonary Cache
¸¦ checkÇϱâ À§Çؼ´Â ¾î´À½Ã°£ »ç¿ëÇÑ ÈÄ¿¡ missÀ²À» ÃøÁ¤Çغ»´Ù.
SQL> select parameter, gets, getmisses, getmisses/gets
2 from v$rowcache
3 where gets !=0;
PARAMETER GETS GETMISSES GETMISSES/GETS-------------------------------- ---------- ---------- --------------
dc_free_extents 144 12 .083333333
dc_segments 29 22 .75862069
dc_tablespaces 7 1 .142857143
dc_users 2118 1 .000472144
dc_rollback_segments 275 8 .029090909
dc_objects 500 221 .442
dc_object_ids 189 22 .116402116
dc_sequences 1 1 1
dc_usernames 31 3 .096774194
À§ °ªµéÀÌ 15% ÀÌ»óÀ̸é shared_pool_size¸¦ ´Ã¸®´Â°ÍÀ» °í·ÁÇغÁ¶ó.
¿©±â¼´Â ¹Ù·Î startup ÈÄ testÇÑ°ÍÀ̶ó »ó´çÈ÷ ³ôÀº ÆíÀÌ´Ù.
¶Ç utlbstat/utlestat ÀÇ report.txt¿¡¼ ´ÙÀ½À» Âü°íÇصµ µÈ´Ù.
NAME GET_REQS GET_MISS SCAN_REQS SCAN_MISS MOD_REQS -------------------------------- -------- -------- --------- --------- --------
COUNT CUR_USAGE -------- ---------
dc_objects 62 20 0 0 0
342 338
dc_synonyms 3 2 0 0 0
4 2
** MTS - User Process:Server Process = 1:1
MTSÀÇ °æ¿ì UGA°¡ Shared Pool ÇÑÀ¸·Î µé¾î¿È
==> MTSÀÇ °æ¿ì µ¿½Ã¿¡ ¸î°³ÀÇ process¸¦ ¿î¿ëÇϴ°¡¿¡ µû¶ó Shared Pool Size¸¦ ´Ã·ÁÁà¾ßÇÔ
Maximum UGA space used by all MTS users :
SQL> select sum(value) ||' bytes' "Total max memory"
2 from v$sesstat,v$statname
3 where name = 'session uga memory max'
4 and v$sesstat.statistic# = v$statname.statistic#;
Total max memory----------------------------------------------
527040 bytes
|