|
Wait ÀÎÅÍÆäÀ̽º
10gÀÇ wait ÀÎÅÍÆäÀ̽º´Â ADDM¿¡ ÀÇÇØ ¾ÆÁ÷ ĸó µÇÁö ¾ÊÀº Çö ½ÃÁ¡ÀÇ ¼º´É ¹®Á¦¸¦ Áø´ÜÇÏ°í ÇØ°áÇϱâ À§ÇÑ À¯¿ëÇÑ Á¤º¸¸¦ Á¦°øÇÕ´Ï´Ù.
"µ¥ÀÌŸº£À̽º°¡ ³Ê¹« ´À¸®³×¿ä!"
¼º´É¿¡ ºÒ¸¸À» °¡Áø »ç¿ëÀÚµéÀº ÀÌ·¸°Ô ¸»ÇÏ°ï ÇÕ´Ï´Ù. ¿©·¯ºÐµéµµ ÇÊÀÚ¿Í °°´Ù¸é, DBA·Î ±Ù¹«ÇÏ¸é¼ ÀÌ·± À̾߱⸦ ¼ö¾øÀÌ µé¾î¿ÔÀ» °ÍÀÔ´Ï´Ù.
±×·¸´Ù¸é ¼º´É ¹®Á¦¸¦ ÇØ°áÇϱâ À§ÇØ ¾î¶»°Ô ´ëóÇϽʴϱî? »ç¿ëÀÚÀÇ ºÒ¸¸À» ¹«½ÃÇÏ´Â ¹æ¹ýµµ ÀÖ°ÚÁö¸¸(´ëºÎºÐÀÇ DBA¿¡°Ô ÀÌ·± »çÄ¡´Â Çã¿ëµÇÁö ¾ÊÀ¸¹Ç·Î), µ¥ÀÌŸº£À̽º ³»ºÎ ¶Ç´Â ¿ÜºÎ¿¡ ¼¼¼Ç wait À̺¥Æ®°¡ ¹ß»ýÇß´ÂÁö È®ÀÎÇÏ´Â °ÍÀÌ Ã¹ ¹ø°·Î ÇÏ´Â ÀÏÀÌ µÉ °ÍÀÔ´Ï´Ù.
¿À¶óŬÀº À̸¦ À§ÇØ ´Ü¼øÇϸ鼵µ °·ÂÇÑ ¸ÞÄ¿´ÏÁòÀ» Á¦°øÇÕ´Ï´Ù. V$SESSION_WAIT ºä°¡ ¹Ù·Î ±×°ÍÀÔ´Ï´Ù. V$SESSION_WAIT ºä¸¦ ÅëÇØ ¼¼¼ÇÀÌ ´ë±â ÁßÀÎ À̺¥Æ®°¡ ¹«¾ùÀÌ°í ¾ó¸¶³ª ÀÚÁÖ, ¾ó¸¶³ª ¿À·§µ¿¾È ´ë±âÇß´ÂÁö µîÀÇ Á¤º¸¸¦ È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î ƯÁ¤ ¼¼¼ÇÀÌ ¡°db file sequential read¡± À̺¥Æ®¸¦ ´ë±âÇÏ°í ÀÖ´Â °æ¿ì, Ä÷³ P1°ú P2´Â ¼¼¼ÇÀÌ ´ë±â ÁßÀÎ ºí·ÏÀÇ file_id¿Í block_id¸¦ °¢°¢ Ç¥½ÃÇÏ°Ô µË´Ï´Ù. ´ëºÎºÐÀÇ °æ¿ì, V$SESSION_WAIT ºä¸¸À¸·Î wait À̺¥Æ®¿¡ °ü·ÃÇÑ ÃæºÐÇÑ Á¤º¸¸¦ È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù. ÇÏÁö¸¸ ´ÙÀ½°ú °°Àº µÎ °¡Áö ¾àÁ¡ÀÌ ÀÖ½À´Ï´Ù:
For most wait events this view is sufficient, but it is hardly a robust tuning tool for at least two important reasons:
V$SESSION_WAIT ºä´Â Çö ½ÃÁ¡ÀÇ »óŸ¸À» Ç¥½ÃÇÕ´Ï´Ù. wait À̺¥Æ®°¡ Á¾·áµÇ¸é, ±× È÷½ºÅ丮 Á¤º¸ ¿ª½Ã ¼Ò½ÇµÇ¾î ¹ö¸³´Ï´Ù. ¶Ç V$SESSION_EVENT ºä´Â ¼¼¼ÇÀÌ ½ÃÀÛµÈ ÀÌÈÄÀÇ ´©ÀûµÈ Á¤º¸¸¦ Á¦°øÇÏÁö¸¸ ±× Á¤º¸°¡ »ó¼¼ÇÏÁö ¾Ê½À´Ï´Ù.
V$SESSION_WAIT ºä´Â wait À̺¥Æ®¿¡ ´ëÇÑ Á¤º¸¸¸À» Æ÷ÇÔÇÏ°í ÀÖ½À´Ï´Ù. ±× ¹ÛÀÇ ´Ù¸¥ Á¤º¸(userid, terminal µî)¸¦ È®ÀÎÇÏ·Á¸é V$SESSION ºä¿Í Á¶ÀÎÇØ¾ß ÇÕ´Ï´Ù.
Oracle Database 10g´Â ÃÖ¼ÒÇÑÀÇ ÀÛ¾÷À¸·Î º¸´Ù ¸¹Àº Á¤º¸¸¦ ¾òÀ» ¼ö ÀÖµµ·Ï wait ÀÎÅÍÆäÀ̽º¸¦ Çõ½ÅÀûÀ¸·Î °³¼±ÇÏ¿´½À´Ï´Ù. À̹ø ¿¬Àç¿¡¼´Â, wait ÀÎÅÍÆäÀ̽º¿Í °ü·ÃÇÏ¿© Oracle Database 10g°¡ Á¦°øÇÏ´Â »õ·Î¿î ±â´ÉÀ» ¼Ò°³ÇÏ°í ¼º´É ¹®Á¦ ÇØ°áÀ» À§ÇÑ È°¿ë ¹æ¾ÈÀ» ¼³¸íÇÕ´Ï´Ù. ´ëºÎºÐÀÇ °æ¿ì ADDM(Automatic Database Diagnostic Manager)ÀÌ ¼º´É ºÐ¼® Åø·Î È°¿ëµÇ°ÚÁö¸¸, ADDM¿¡ ÀÇÇØ ¾ÆÁ÷ ¼öÁýµÇÁö ¾ÊÀº Çö ½ÃÁ¡ÀÇ ¼º´É ¹®Á¦¸¦ ºÐ¼®ÇÏ´Â µ¥¿¡´Â wait ÀÎÅÍÆäÀ̽º°¡ À¯¿ëÇÕ´Ï´Ù.
Session Wait ºäÀÇ ±â´É Çâ»ó
¸ÕÀú V$SESSION_WAITÀÇ °³¼±µÈ ±â´É¿¡ ´ëÇØ ¿¹¸¦ ÅëÇØ ¼³¸íÇϵµ·Ï ÇÏ°Ú½À´Ï´Ù.
»ç¿ëÀÚÀÇ ¼¼¼ÇÀÌ °©Àڱ⠴À·ÁÁ³´Ù´Â ºÒ¸¸ÀÌ Á¦±âµÈ °æ¿ì¸¦ °¡Á¤ÇØ º¾½Ã´Ù. ¸ÕÀú »ç¿ëÀÚ ¼¼¼ÇÀÇ SID¸¦ È®ÀÎÇÏ°í, ÇØ´ç SID¿¡ ´ëÇØ V$SESSION_WAIT ºä¸¦ Á¶È¸ÇÕ´Ï´Ù. ±× °á°ú°¡ ¾Æ·¡¿Í °°½À´Ï´Ù:
SID : 269
SEQ# : 56
EVENT : enq: TX - row lock contention
P1TEXT : name|mode
P1 : 1415053318
P1RAW : 54580006
P2TEXT : usn<<16 | slot
P2 : 327681
P2RAW : 00050001
P3TEXT : sequence
P3 : 43
P3RAW : 0000002B
WAIT_CLASS_ID : 4217450380
WAIT_CLASS# : 1
WAIT_CLASS : Application
WAIT_TIME : -2
SECONDS_IN_WAIT : 0
STATE : WAITED UNKNOWN TIME
±½Àº ±Û¾¾Ã¼·Î Ç¥½ÃµÈ Ä÷³À» ÁÖ¸ñÇϽñ⠹ٶø´Ï´Ù. WAIT_CLASS_ID, WAIT_CLASS#, WAIT_CLASS µîÀº ¸ðµÎ 10g¿¡¼ »õ·Î Ãß°¡µÈ Ä÷³µéÀÔ´Ï´Ù. WAIT_CLASS´Â waitÀÇ À¯ÇüÀ» ±¸ºÐÇØ ÁÖ´Â Ä÷³À¸·Î, idleÇÑ waitÀ̹ǷΠ¹«½ÃÇصµ µÇ´ÂÁö ¶Ç´Â À¯È¿ÇÑ waitÀÎÁö¸¦ ÆÇ´ÜÇÏ´Â Áß¿äÇÑ ±âÁØÀ¸·Î È°¿ëµË´Ï´Ù. À§ÀÇ ¿¹¿¡¼´Â wait class°¡ ¡°Application¡±À¸·Î Ç¥½ÃµÇ°í ÀÖÀ¸¸ç, µû¶ó¼ ÁÖ¸ñÇÒ ¸¸ÇÑ ÀÌÀ¯°¡ ÃæºÐÇÑ °ÍÀ¸·Î ÆÇ´ÜÇÒ ¼ö ÀÖ½À´Ï´Ù.
ÀÌ·¯ÇÑ Ä÷³µéÀº Æ©´× °úÁ¤¿¡¼ ¸Å¿ì ¿ä±äÇÏ°Ô È°¿ëµË´Ï´Ù. ¿¹¸¦ µé¾î ´ÙÀ½°ú °°Àº Äõ¸®¸¦ ÀÛ¼ºÇÏ¿© ¼¼¼Ç wait¿¡ °ü·ÃÇÑ Á¤º¸¸¦ ¾òÀ» ¼ö ÀÖ½À´Ï´Ù.
select wait_class, event, sid, state, wait_time, seconds_in_wait
from v$session_wait
order by wait_class, event, sid
/
Äõ¸® ½ÇÇà °á°úÀÇ ¿¹°¡ ´ÙÀ½°ú °°½À´Ï´Ù:
WAIT_CLASS EVENT SID STATE WAIT_TIME SECONDS_IN_WAIT
---------- -------------------- ---------- ------------------- ---------- ---------------
Application enq: TX - 269 WAITING 0 73
row lock contention
Idle Queue Monitor Wait 270 WAITING 0 40
Idle SQL*Net message from client 265 WAITING 0 73
Idle jobq slave wait 259 WAITING 0 8485
Idle pmon timer 280 WAITING 0 73
Idle rdbms ipc message 267 WAITING 0 184770
Idle wakeup time manager 268 WAITING 0 40
Network SQL*Net message to client 272 WAITED SHORT TIME -1 0
¿©±â ¸î °¡Áö À̺¥Æ®(Queue Monitor Wait, JobQueue Slaveµî)°¡ ¡°Idle¡± À̺¥Æ®·Î Ç¥½ÃµÇ°í ÀÖÀ½À» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ·¯ÇÑ Ç׸ñµéÀº nonblocking wait·Î °£ÁÖÇÏ°í °í·Á ´ë»ó¿¡¼ Á¦¿ÜÇÒ ¼öµµ ÀÖ½À´Ï´Ù. ÇÏÁö¸¸ ¡°idle¡± À̺¥Æ®°¡ ´Ù¸¥ ¹®Á¦¸¦ ¾Ï½ÃÇÏ´Â °æ¿ìµµ ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î, ¡°idle¡±·Î Ç¥½ÃµÇ´Â SQL*Net °ü·Ã À̺¥Æ®´Â ³×Æ®¿öÅ© Áö¿¬À²ÀÌ ³ôÀ½À» ³ªÅ¸³¾ ¼öµµ ÀÖ½À´Ï´Ù.
WAIT_TIMEÀÌ -2ÀÇ °ªÀ» °®´Â °æ¿ìµµ Âü°íÇÒ ÇÊ¿ä°¡ ÀÖ½À´Ï´Ù. Windows¿Í °°Àº ÀϺΠÇ÷§ÆûÀº fast timing mechanismÀ» Áö¿øÇÏÁö ¾Ê½À´Ï´Ù. ÇØ´ç Ç÷§Æû¿¡ ÃʱâÈ ¸Å°³º¯¼ö TIMED_STATISTICS °¡ ¼³Á¤µÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì, Á¤È®ÇÑ ½Ã°£ Åë°è¸¦ ¾òÀ» ¼ö ¾ø½À´Ï´Ù. ÀÌ °æ¿ì Oracle9i¿¡¼´Â °ü·ÃµÈ Ä÷³¿¡ ºñÁ¤»óÀûÀ¸·Î ³ôÀº ¼ýÀÚ°¡ Ç¥½ÃµÇ¸ç, ÀÌ·Î ÀÎÇØ ¼º´É ¹®Á¦ÀÇ Áø´ÜÀÌ ´õ¿í ¾î·Á¿öÁú ¼ö ÀÖ½À´Ï´Ù. 10g¿¡¼´Â ÀÌ·¯ÇÑ °æ¿ì ÀÏ·üÀûÀ¸·Î -2ÀÇ °ªÀ» Ç¥½ÃÇÕ´Ï´Ù. Áï, -2´Â Ç÷§ÆûÀÌ fast timing mechanismÀ» Áö¿øÇÏÁö ¾ÊÀ¸¸ç TIMED_STATISTICS ¸Å°³º¯¼ö°¡ ¼³Á¤µÇ¾î ÀÖÁö ¾ÊÀ½À» ÀǹÌÇÕ´Ï´Ù. (ÀÌ ¹®¼ÀÇ µÞºÎºÐ¿¡¼´Â fast timing mechanismÀÌ »ç¿ë °¡´ÉÇÑ °ÍÀ¸·Î °¡Á¤ÇÏ°í ¼³¸íÀ» ÁøÇàÇÕ´Ï´Ù.)
Session ºä¿Í Session Wait ºäÀÇ ÅëÇÕ
¼¼¼Ç¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ Á¤º¸¸¦ ¾ò±â À§Çؼ V$SESSION_WAIT¸¦ V$SESSION°ú Á¶ÀÎÇؾ߸¸ Çß´ø »ç½ÇÀ» ±â¾ïÇÏ°í °è½Ç °Ì´Ï´Ù. 10g¿¡¼´Â V$SESSION ºä ¾È¿¡ V$SESSION_WAITÀÇ Á¤º¸°¡ ±âº»ÀûÀ¸·Î Æ÷ÇԵ˴ϴÙ. V$SESSIONÀÌ wait À̺¥Æ®¿¡ °ü·ÃÇÏ¿© Ãß°¡·Î Á¦°øÇÏ´Â Ä÷³ÀÌ ¾Æ·¡¿Í °°½À´Ï´Ù:
EVENT# NUMBER
EVENT VARCHAR2(64)
P1TEXT VARCHAR2(64)
P1 NUMBER
P1RAW RAW(4)
P2TEXT VARCHAR2(64)
P2 NUMBER
P2RAW RAW(4)
P3TEXT VARCHAR2(64)
P3 NUMBER
P3RAW RAW(4)
WAIT_CLASS_ID NUMBER
WAIT_CLASS# NUMBER
WAIT_CLASS VARCHAR2(64)
WAIT_TIME NUMBER
SECONDS_IN_WAIT NUMBER
STATE VARCHAR2(19)
ÀÌ Ä÷³µéÀº V$SESSION_WAIT¿¡¼ Á¦°øµÇ´Â °Íµé°ú µ¿ÀÏÇÑ À̸§À» °¡Áö¸ç µ¿ÀÏÇÑ Á¤º¸¸¦ Á¦°øÇÕ´Ï´Ù. °á±¹ À̺¥Æ®¿¡ ´ëÇÑ ¼¼¼Ç wait Á¤º¸¸¦ È®ÀÎÇϱâ À§ÇØ V$SESSION_WAIT¸¦ µû·Î Á¶È¸ÇÒ ÇÊ¿ä°¡ ¾ø°Ô µÈ °ÍÀÔ´Ï´Ù.
±×·³ ´Ù½Ã óÀ½¿¡ ¼³¸íÇÑ ¿¹·Î µ¹¾Æ°¡ º¾½Ã´Ù. SID 269ÀÇ ¼¼¼ÇÀÌ ¡°enq: TX - row lock contention¡±À̺¥Æ®¸¦ ´ë±â ÁßÀ̸ç, ÀÌ´Â ÀÌ ¼¼¼ÇÀÌ ´Ù¸¥ ¼¼¼ÇÀÌ Á¡À¯ÇÏ°í ÀÖ´Â ¶ô(lock)À» ´ë±â ÁßÀÓÀ» ÀǹÌÇÕ´Ï´Ù. ¹®Á¦¸¦ Áø´ÜÇϱâ À§Çؼ´Â ¡°´Ù¸¥¡± ¼¼¼ÇÀÌ ¹«¾ùÀÎÁö È®ÀÎÇØ¾ß ÇÕ´Ï´Ù. ±×·¸´Ù¸é ¾î¶² ¹æ¹ýÀ» ½á¾ß ÇÒ±î¿ä?
Oracle9i¿Í ÀÌÀü ¹öÀü¿¡¼´Â ¸Å¿ì º¹ÀâÇÑ Äõ¸®¸¦ ½ÇÇàÇؾ߸¸ ¶ôÀ» ¼ÒÀ¯ÇÑ ¼¼¼ÇÀÇ SID¸¦ ¾Ë¾Æ³¾ ¼ö ÀÖ¾ú½À´Ï´Ù. 10g¿¡¼´Â ´ÙÀ½°ú °°Àº °£´ÜÇÑ Äõ¸®·Î ÇØ°á °¡´ÉÇÕ´Ï´Ù:
select BLOCKING_SESSION_STATUS, BLOCKING_SESSION
from v$session
where sid = 269
BLOCKING_SE BLOCKING_SESSION
----------- ----------------
VALID 265
ÀÌ·¸°Ô °£´ÜÇÑ ÀÛ¾÷¸¸À¸·Î SID 265 ¼¼¼ÇÀÌ ¼¼¼Ç 269¸¦ ºí·ÎÅ·ÇÏ°í ÀÖÀ½ÀÌ È®ÀεǾú½À´Ï´Ù.
¾ó¸¶³ª ¸¹Àº Wait°¡ ¹ß»ýÇߴ°¡?
¾ÆÁ÷µµ »ç¿ëÀÚ¸¦ ¸¸Á·½ÃÅ°±â¿¡´Â À̸¨´Ï´Ù. »ç¿ëÀÚÀÇ ¼¼¼ÇÀÌ ´À·ÁÁø ÀÌÀ¯´Â µµ´ëü ¹«¾ùÀϱî¿ä? ´ÙÀ½°ú °°Àº Äõ¸®¸¦ ¸ÕÀú ½ÇÇàÇØ º¾½Ã´Ù:
select * from v$session_wait_class where sid = 269;
°á°ú´Â ´ÙÀ½°ú °°ÀÌ Ç¥½ÃµË´Ï´Ù:
SID SERIAL# WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS TOTAL_WAITS TIME_WAITED
---- ------- ------------- ----------- ------------- ----------- -----------
269 1106 4217450380 1 Application 873 261537
269 1106 3290255840 2 Configuration 4 4
269 1106 3386400367 5 Commit 1 0
269 1106 2723168908 6 Idle 15 148408
269 1106 2000153315 7 Network 15 0
269 1106 1740759767 8 User I/O 26 1
À§ °á°ú´Â ¼¼¼Ç wait¿¡ ´ëÇÑ ¸Å¿ì »ó¼¼ÇÑ Á¤º¸¸¦ Á¦°øÇÏ°í ÀÖ½À´Ï´Ù. À§ °á°ú¸¦ ÅëÇØ ¾ÖÇø®ÄÉÀ̼ǿ¡ °ü·ÃÇÑ ¼¼¼Ç wait À̺¥Æ®°¡ 873ȸ, ÃÑ 261,537 centi-second¿¡ °ÉÃÄ ¹ß»ýµÇ¾úÀ¸¸ç, ³×Æ®¿öÅ© °ü·ÃÇÑ wait À̺¥Æ®°¡ 15ȸ ¹ß»ýµÇ¾úÀ½À» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.
ÀÌ ¹æ¹ýÀ» ÀÀ¿ëÇÏ¿©, wait class¿¡ °ü·ÃÇÑ ½Ã½ºÅÛÀÇ Àü¹ÝÀûÀÎ Åë°è¸¦ È®ÀÎÇÒ ¼öµµ ÀÖ½À´Ï´Ù. (¿©±â¿¡¼µµ ½Ã°£Àº centi-second ´ÜÀ§·Î Ç¥½ÃµË´Ï´Ù.)
select * from v$system_wait_class;
WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS TOTAL_WAITS TIME_WAITED
------------- ----------- ------------- ----------- -----------
1893977003 0 Other 2483 18108
4217450380 1 Application 1352 386101
3290255840 2 Configuration 82 230
3875070507 4 Concurrency 80 395
3386400367 5 Commit 2625 1925
2723168908 6 Idle 645527 219397953
2000153315 7 Network 2125 2
1740759767 8 User I/O 5085 3006
4108307767 9 System I/O 127979 18623
´ëºÎºÐÀÇ ¼º´É ¹®Á¦´Â µ¶¸³ÀûÀ¸·Î Á¸ÀçÇÏÁö ¾ÊÀ¸¸ç, ¹®Á¦ÀÇ ÆÐÅÏÀ» ¾Ï½ÃÇÏ´Â ´Ü¼·Î¼ Çؼ®µÇ´Â °ÍÀÌ ÀϹÝÀûÀÔ´Ï´Ù. ÀÌ·¯ÇÑ ÆÐÅÏÀ» È®ÀÎÇÏ·Á¸é wait classÀÇ È÷½ºÅ丮 ºä¸¦ Á¶È¸ÇØ¾ß ÇÕ´Ï´Ù:
select * from v$waitclassmetric;
V$WAITCLASSMETRIC ºä´Â Áö³ 1ºÐ µ¿¾ÈÀÇ wait class Åë°è¸¦ Á¦°øÇÕ´Ï´Ù.
select wait_class#, wait_class_id,
average_waiter_count "awc", dbtime_in_wait,
time_waited, wait_count
from v$waitclassmetric
/
WAIT_CLASS# WAIT_CLASS_ID AWC DBTIME_IN_WAIT TIME_WAITED WAIT_COUNT
----------- ------------- ---- -------------- ----------- ----------
0 1893977003 0 0 0 1
1 4217450380 2 90 1499 5
2 3290255840 0 0 4 3
3 4166625743 0 0 0 0
4 3875070507 0 0 0 1
5 3386400367 0 0 0 0
6 2723168908 59 0 351541 264
7 2000153315 0 0 0 25
8 1740759767 0 0 0 0
9 4108307767 0 0 8 100
10 2396326234 0 0 0 0
11 3871361733 0 0 0 0
WAIT_CLASS_ID Ä÷³À» ÁÖ¸ñÇϽñ⠹ٶø´Ï´Ù. Áö³ 1ºÐ µ¿¾È 4217450380ÀÇ WAIT_CLASS_ID °ªÀ» °®´Â wait class¸¦ 2°³ÀÇ ¼¼¼ÇÀÌ ÃÑ 5ȸ, 1,499 centi-second¿¡ °ÉÃÄ ´ë±âÇÏ¿´À½À» ¾Ë ¼ö ÀÖ½À´Ï´Ù. ±×·¸´Ù¸é ÀÌ wait class´Â ¹«¾ùÀϱî¿ä? V$SYSTEM_WAIT_CLASS¸¦ Á¶È¸Çϸé ÀÌ wait class°¡ ¹Ù·Î "Application¡± classÀÓÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.
DBTIME_IN_WAIT Ä÷³µµ ¸Å¿ì À¯¿ëÇÏ°Ô È°¿ëµË´Ï´Ù. Automatic Workload Repository(AWR)¸¦ ÁÖÁ¦·Î ÇÑ Á¦ 6 ÁÖ ¿¬Àç¿¡¼, 10g°¡ ÇÑÃþ ¼¼ºÐÈµÈ ½Ã°£ Åë°è¸¦ Á¦°øÇϸç, µ¥ÀÌŸº£À̽º ³»ºÎ¿¡¼ ½ÇÁ¦·Î »ç¿ëµÈ ½Ã°£À» Á¤È®ÇÏ°Ô È®ÀÎÇÒ ¼ö ÀÖÀ½À» ¼³¸íÇÑ ¹Ù ÀÖ½À´Ï´Ù. DBTIME_IN_WAIT°¡ ¹Ù·Î µ¥ÀÌŸº£À̽º ³»ºÎ¿¡¼ »ç¿ëµÈ ½Ã°£À» Ç¥½ÃÇÏ´Â Ä÷³ÀÔ´Ï´Ù.
´Ü¼´Â Ç×»ó ³²´Â´Ù
ÇØ´ç »ç¿ëÀÚÀÇ ¼¼¼ÇÀÌ Á¾·áµÇÀÚ DBA´Â ¾ÈµµÀÇ ÇѼûÀ» ³»½±´Ï´Ù. ÇÏÁö¸¸ µµ´ëü ¾î¶² wait ¶§¹®¿¡ ¼¼¼Ç¿¡ ¼º´É ¹®Á¦°¡ ¹ß»ýÇß´ÂÁö¿¡ ´ëÇÑ ±Ã±ÝÁõÀÌ °¡½ÃÁö ¾Ê½À´Ï´Ù. V$SESSION_WAIT¸¦ Á¶È¸ÇÏ¸é ½±°Ô ÇØ´äÀ» ¾òÀ» ¼ö ÀÖ°ÚÁö¸¸, ÀÌÁ¦ wait À̺¥Æ®°¡ Á¾·áµÈ »óȲÀ̹ǷΠÀÌ ºä¿¡´Â ´õ ÀÌ»ó ±â·ÏÀÌ ³²¾ÆÀÖÁö ¾ÊÀ» °ÍÀÔ´Ï´Ù. ÀÌ·± °æ¿ì ¾î¶»°Ô ÇϽðڽÀ´Ï±î?
10g´Â ¾×Ƽºê ¼¼¼ÇÀÇ ¸¶Áö¸· 10°³ À̺¥Æ®¿¡ °ü·ÃÇÑ session wait È÷½ºÅ丮 Á¤º¸¸¦ ÀÚµ¿ ÀúÀåÇÏ°í °ü¸®Çϸç, ÀÌ °á°ú´Â V$SESSION_WAIT_HISTORY ºä¸¦ ÅëÇØ Á¶È¸ÇÒ ¼ö ÀÖ½À´Ï´Ù:
select event, wait_time, wait_count
from v$session_wait_history
where sid = 265
/
EVENT WAIT_TIME WAIT_COUNT
------------------------------ ---------- ----------
log file switch completion 2 1
log file switch completion 1 1
log file switch completion 0 1
SQL*Net message from client 49852 1
SQL*Net message to client 0 1
enq: TX - row lock contention 28 1
SQL*Net message from client 131 1
SQL*Net message to client 0 1
log file sync 2 1
log buffer space 1 1
¼¼¼ÇÀÌ inactive »óÅ°¡ µÇ°Å³ª ¿¬°áÀÌ ²÷¾îÁø °æ¿ì, °ü·ÃµÈ ±â·Ïµµ ºä¿¡¼ »èÁ¦µË´Ï´Ù. ÇÏÁö¸¸ È÷½ºÅ丮 Á¤º¸´Â AWR Å×ÀÌºí¿¡ º°µµ·Î ÀúÀåµË´Ï´Ù. AWRÀÇ V$ACTIVE_SESSION_HISTORY ºä´Â session wait¿¡ °ü·ÃÇÑ Á¤º¸¸¦ Á¦°øÇÕ´Ï´Ù. (AWR¿¡ °ü·ÃÇÑ ÀÚ¼¼ÇÑ Á¤º¸´Â º» ½Ã¸®ÁîÀÇ Á¦ 6 ÁÖ ¿¬À縦 Âü°íÇϽñ⠹ٶø´Ï´Ù.)
°á·Ð
Oracle Database 10gÀÇ Çâ»óµÈ wait ¸ðµ¨À» »ç¿ëÇÏ¿© ÇÑÃþ ½±°Ô ¼º´É ºÐ¼® ÀÛ¾÷À» ÁøÇàÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼¼¼Ç È÷½ºÅ丮 Á¤º¸¸¦ ÀÌ¿ëÇÏ¸é ¹®Á¦ÀÇ Â¡ÈÄ°¡ »ç¶óÁø ÀÌÈÄ¿¡µµ ¹®Á¦ ¿øÀÎÀ» Áø´ÜÇÒ ¼ö ÀÖ½À´Ï´Ù. ¶Ç wait¸¦ wait class·Î ±¸ºÐÇÔÀ¸·Î½á, °¢ wait À¯Çüº° ¿µÇâÀ» ÀÌÇØÇÏ°í È¿À²ÀûÀ¸·Î ´ëóÇÒ ¼ö ÀÖ°Ô µË´Ï´Ù.
wait À̺¥Æ® °ü·Ã ´ÙÀ̳»¹Í ¼º´É ºä¿¡ ´ëÇÑ º¸´Ù ÀÚ¼¼ÇÑ Á¤º¸´Â Oracle Database Performance Tuning Guide 10g Release 1 (10.1)ÀÇ Á¦ 10 ÀåÀ» È®ÀÎÇϽñ⠹ٶø´Ï´Ù.
|