HOME   ·Î±×ÀΠ  ȸ¿ø°¡ÀÔ
    
ȸ¿ø°¡ÀÔ
ºñ¹Ð¹øÈ£ ã±â ÀÚµ¿·Î±ä
ÀÌÀü°Ô½ÃÆÇ
   free_board
   °Ç°­°Ô½ÃÆÇ
   ¿À¶óŬDB
   Linux
   HTML/javascript
   Áú¹®°ú ´ä
È£¼­±â
   À̹ÌÁö°Ô½ÃÆÇ  
   °Ç°­°Ô½ÃÆÇ  
   À½¾ÇÀÚ·á  
   ¼ºÁØÀÌ °Ô½ÃÆÇ  
[ÀϹÝ] [¿À¶óŬƩ´×]À¯¿ëÇÑ ¿À¶óŬ tuning scripts (1)
  È£¼® ´Ô²²¼­ ¾´ ±ÛÀÔ´Ï´Ù - 211.¢½.74.31 ÀÐÀ½:4220  
RowCacheÀÇ MissÀ²À» º¸¿©ÁØ´Ù
/* rowCache ÀÇ MissRatio¸¦ Á¶»çÇÏ´Â ½ºÅ©¸³Æ®
** <<¹ÚÁ¦¿ë 99.11>>
** Row chache ÀÇ Miss ratio´Â 15% ÀÌÇÏ·Î À¯ÁöÇÏ´Â °ÍÀÌ ÁÁ´Ù.
** ±×·¸Áö ¾ÊÀ»°æ¿ì shared_pool_size¸¦ ´Ã¸®´Â°ÍÀ» °í·ÁÇØ¾ß ÇÑ´Ù.
*/

select sum(gets) "Gets",
sum(getmisses) "Misses",
(1-(sum(getmisses)/(sum(gets)+sum(getmisses))))*100 "HitRate"
from v$rowcache;



Library CacheÀÇ Hitratio¸¦ º¸¿©ÁØ´Ù.(shared_poolÀÇ size°áÁ¤À»À§ÇØ)
/* library Cache Hitratio Ãâ·Â ½ºÅ©¸³Æ®
** <<¹ÚÁ¦¿ë 99.11>>
** library Cache ÀÇ hitratio °¡ 0.9 ÀÌÇÏÀ̸é
** Shared Pool Size¸¦ ´Ã·ÁÁְųª, SQL ¹®ÀÇ ÀÌ»óÀ»
** Á¶»çÇØ¾ß ÇÑ´Ù.
*/

select sum(pins) Executions,
sum(pinhits) "Execution Hits",
sum(reloads) Misses,
((sum(pins) / (sum(pins) + sum(reloads))) * 100) hitratio
from v$librarycache;



SQL Cursor¸¦ º¸¿©ÁÖ´Â ½ºÅ©¸³Æ®
/* SQL Cursor¸¦ Á¶»çÇÏ´Â ½ºÅ©¸³Æ®.
** <<¹ÚÁ¦¿ë 99.11>>
** SQL Cursor ¸¦ Á¶»çÇÏ¿© ºÎÇÏ°¡ ¸¹ÀÌ °É¸®´Â SQL¹®°ú
** ¸Þ¸ð¸®¸¦ Á¶»çÇÑ´Ù.
** loads : ij½¬¿¡¼­ ³ª°¬´Ù µé¾î¿Â Ƚ¼ö(best=1).
** invalidations : LRU¿¡¼­ ¹«È¿È­µÈ Ƚ¼ö. ÀÌ °ªÀÌ 4ÀÌ»óÀ̸é
** shared_pool_area¸¦ È®ÀåÇؾßÇÑ´Ù.
** parse_calls : ÀÌ Ä¿¼­ÀÇ È£Ãâ ¼ö.
** sorts : ¼öÇàµÈ ¼ÒƮȽ¼ö
** command_type: 2 - insert, 3-select, 4-update, 7-delete
*/

select sql_text, loads, invalidations, parse_calls, sorts
FROM v$sqlarea
WHERE sql_text NOT LIKE '%$%'
AND command_type IN(2,3,6,7);




explainÀ» º¸±â ½±°Ô Ãâ·ÂÇØÁÖ´Â SQL
/*
** expain plan °á°ú¸¦ º¸±â ½±°Ô Ãâ·ÂÇØÁÖ´Â ½ºÅ©¸³Æ®.
**
** 1) expainÀ» óÀ½ »ç¿ëÇÒ °æ¿ì¿£ [ORACLE_HOME]/rdbms/admin/utlxplan.sqlÀ» ½ÇÇà,
** plan_tableÀ» »ý¼ºÇÑ´Ù.
** 2) óÀ½ »ç¿ëÀÌ ¾Æ´Ï¸é delete from plan_table; À» ½ÇÇàÇÏ¿© ÀÌÀü °á°ú¸¦ »èÁ¦.
**
** ½ÇÇà°á°ú ÆĽ̹øÈ£(id)°¡ ±æ¸é SQLÀÌ ºñÈ¿À²ÀûÀ̰ųª, shared_pool_size°¡ ÀÛÀº°ÍÀÌ´Ù.
** ±âŸ SQL¹®ÀÌ À妽º¸¦ »ç¿ëÇÏ´ÂÁö µîµîÀ» ¾Ë¼ö ÀÖ´Ù.
*/

col operation format a30
col options format a20
col id format 99
select id, lpad(' ',2*level) || operation ||
decode(id, 0, ' Cost= ' || position )"operation",
options, object_name "object"
from plan_table
connect by prior id=parent_id
start with id =0;



¼¼¼Çº°·Î °úµµÇÑ memory read¸¦ ÇÏ´Â SQL¹®À» ã¾ÆÁÖ´Â ½ºÅ©¸³Æ®
/*
** SQL query Æ©´× ½ºÅ©¸³Æ®.. <¹ÚÁ¦¿ë>
**
** À¯Àúº°·Î °úµµÇÑ logical read¸¦ ¼öÇàÇÏ´Â sql ¹® ã±â
**
**
*/

Break on User_Name On Disk_Reads on Buffer_Gets on Rows_Processed
Select A.User_Name, B.Disk_Reads, B.Buffer_Gets, B.Rows_Processed, C.SQL_Text
From V$Open_Cursor A, V$SQLArea B, V$SQLText C
Where A.User_Name = Upper('&&User') And A.Address = C.Address
And A.Address = B.Address
Order By A.User_Name, A.Address, C.Piece;



°úµµÇÑ memory read¸¦ ÇÏ´Â SQL¹®À» ã¾ÆÁÖ´Â ½ºÅ©¸³Æ®
/*
** SQL query Æ©´× ½ºÅ©¸³Æ®.. <¹ÚÁ¦¿ë>
**
** °úµµÇÑ logical read¸¦ ¼öÇàÇÏ´Â SQL¹®À» V$SQLAREA ¿¡¼­ °Ë»öÇØÁÜ.
**
** ¿øÀÎ => 1) À妽º Ä÷³¿¡ distinctÇÑ °ªÀÌ ÀûÀº, ºÎÀûÀýÇÑ À妽ºÀÇ »ç¿ë. (´ëü·Î À妽º¸¦ Áö¿ö¾ß ÇÒ °æ¿ì)
** 2) ÃÖÀûÈ­ µÇÁö ¾ÊÀº SQL ¹®Àå
*/

select buffer_gets, sql_text from v$sqlarea
where buffer_gets > 200000
order by buffer_gets desc;


°úµµÇÑ disk read¸¦ ÇÏ´Â SQL¹®À» ã¾ÆÁÖ´Â ½ºÅ©¸³Æ®
/*
** SQL query Æ©´× ½ºÅ©¸³Æ®.. <¹ÚÁ¦¿ë>
**
** °úµµÇÑ disk read¸¦ ¼öÇàÇÏ´Â SQL¹®À» V$SQLAREA ¿¡¼­ °Ë»öÇØÁÜ.
**
** ¿øÀÎ => 1) SQL¹®ÀÌ ÃÖÀûÈ­ µÇÁö ¾Ê¾Æ disk read¸¦ ¸¹ÀÌ ÇÒ ¼ö ¹Û¿¡ ¾ø´Â Äõ¸®ÀÏ°æ¿ì.
** (index°¡ ¾ø°Å³ª »ç¿ëµÇÁö ¾ÊÀ»¶§)
** 2) db_block_buffers ¶Ç´Â shared_pool_size °¡ ÀÛÀº °æ¿ì. (¸Þ¸ð¸®°¡ ÀûÀ½)
*/

select disk_reads, sql_text from v$sqlarea
where disk_reads > 10000
order by disk_reads desc;


SGAÀÇ shared pool³»¿¡ ij½¬µÈ objectÁß Å« ¿µ¿ªÀ» Â÷Áö ÇÏ°í ÀÖ´Â °ÍÀ» ã¾ÆÁÖ´Â ½ºÅ©¸³Æ®
/*
** Shared_pool¿¡ ÀúÀåµÈ ³»¿ëº¸±â <¹ÚÁ¦¿ë>
**
** ÇÁ·Î½ÃÁ®³ª ÆÐÅ°ÁöµîÀº shared_pool¿¡ ÀúÀåµÇ¸ç ÀúÀåµÈ °´Ã¼Áß
** ±× Å©±â°¡ 100K °¡ ³Ñ´Â°ÍÀ» º¸¿©ÁØ´Ù.
*/

col name format a30
select name, sharable_mem
from v$db_object_cache
where sharable_mem > 100000
and type in ('PACKAGE', 'PACKAGE BODY', 'FUNCTION', 'PROCEDURE')
and kept = 'NO';


SGAÀÇ shared pool ÀÇ ÇöÀç »ç¿ëµµ¸¦ Ãâ·ÂÇØÁÖ´Â SQL
/*
** shared_pool_sizeÀÇ ÇöÀç »ç¿ë ÇöȲÀ» º¸¿©ÁÜ. <¹ÚÁ¦¿ë>
**
** shared_pool_sizeÀÇ ÇöÀçÀÇ »ç¿ëÇöȲÀ» º¸¿©ÁØ´Ù.
** ÀÌ µ¥ÀÌÅ͸¦ ÁÖ±âÀûÀ¸·Î º¸°üÇÏ¿© ºÐ¼®ÇÑ´Ù.
*/

col value for 999,999,999,999 heading "Shared Pool Size"
col bytes for 999,999,999,999 heading "Free Bytes"
select to_number(v$parameter.value) value, v$sgastat.bytes,
(v$sgastat.bytes/v$parameter.value)*100 "Percent Free"
from v$sgastat, v$parameter
where v$sgastat.name = 'free memory'
and v$parameter.name = 'shared_pool_size' ;


¸ñ·Ï

ºÐ·ù ¼±ÅÃ
27 ÀÏ¹Ý    Linux Oralcle <-> MS SQL 2000 È£¼® 05-11-11 3719
26 ÀÏ¹Ý [¿À¶óŬƩ´×] shared_pool_size sga ¿µ¿ªÀÇ ¼öÁ¤ È£¼® 05-11-08 5158
25 ÀÏ¹Ý PHP¿Í ¿À¶óŬÀÇ ÃÖÀûÈ­ ÇÁ·Î±×·¡¹Ö È£¼® 05-11-04 5855
24 ÀÏ¹Ý [¿À¶óŬƩ´×] Æ©´×Á¤¸®( ÀÌÈ£Çö ) È£¼® 05-11-02 4407
23 ÀÏ¹Ý [¿À¶óŬƩ´×] SQL¹® È¿°úÀûÀ¸·Î ÀÛ¼ºÇϱâ À§ÇÑ 25°¡Áö ¹æ¹ý È£¼® 05-11-02 4164
22 ÀÏ¹Ý [¿À¶óŬƩ´×]À¯¿ëÇÑ ¿À¶óŬ tuning scripts (2) È£¼® 05-11-02 3933
ÀÏ¹Ý [¿À¶óŬƩ´×]À¯¿ëÇÑ ¿À¶óŬ tuning scripts (1) È£¼® 05-11-02 4221
20 ÀÏ¹Ý [¿À¶óŬƩ´×] SGA ³»ÀÇ Á¡À¯µÈ ¸Þ¸ð¸® ¿µ¿ªÀÇ Å©±â°è»ê È£¼® 05-11-02 3569
19 ÀÏ¹Ý [¿À¶óŬƩ´×] BIND º¯¼ö¸¦ »ç¿ëÇÑ Äõ¸®¹® ±¸¼º È£¼® 05-11-02 4895
18 ÀÏ¹Ý [¿À¶óŬƩ´×] È°¿ë (Åäµå¿¡¼­ kill/trace º¸´Â ¹æ¹ý) È£¼® 05-11-02 4328
17 ÀÏ¹Ý Sql Tuning - TKPROF È°¿ëÇϱâ È£¼® 05-11-01 3482
16 ÀÏ¹Ý PRO*C ¿¡¼­ ¶Ç´Â sqlplus ¿¡¼­ ¶óÀ̺귯¸® ¿¡·¯°¡ ¹ß»ý½Ã ȯ°æÆÄÀÏ Ãß°¡ È£¼® 05-10-28 3752
15 ÀÏ¹Ý DBMS_JOBÀÇ È°¿ë - ¿À¶óŬ Àâ¸Å´ÏÀú È£¼® 05-10-26 8267
  ÀÏ¹Ý    DBMS_JOBÀÇ È°¿ë - ¿À¶óŬ Àâ¸Å´ÏÀú È£¼® 05-10-28 3827
  ÀÏ¹Ý    DBMS_JOBÀÇ È°¿ë - ÀâÅ¥ÀÇ È®ÀÎ ¹× ½ÃÀÛ ¹× Á¦°Å È£¼® 05-10-31 3945
óÀ½ÀÌÀü  [1] [2] [3] [4] [5] [6] [7] [8] 9 [10]  ´ÙÀ½¸Ç³¡

 
Copyright © zenos.pe.kr. All rights reserved.