|
Oracle Wait EventÀÌÇØ ."
Oracle wait events¿¡ ´ëÇÑ ÀÌÇØ
ÀÌ ¹®¼¿¡¼´Â ¾î¶»°Ô wait event¸¦ ÃøÁ¤ÇÏ°í À̵鿡 ´ëÇÑ ÀÇ¹Ì¿Í °£´ÜÇÏ°Ô ÇÒ ¼ö ÀÖ´Â tuning ¹æ¹ýÀ» ¿ä¾àÇÏ°íÀÚ ÇÑ´Ù.
Oracle sessionÀÌ ºñ·Ï CPU¿¡ ´ëÇÑ ÀÚ¿øÀ» ±â´Ù¸®°Å³ª, ¼ÒºñÇÏ°í ÀÖ´Â »óȲ¿¡¼µµ À̵éÀº ¿©·¯ °¡Áö wait eventÁß ÇÑ°¡Áö¸¦ °¡Áö°í ÀÖ´Ù. °¡·É sessionÀÌ I/O ¿¡ ´ëÇÑ ÀÀ´äÀ» ±â´Ù¸°´Ù°Å³ª, SGA¿¡ free space¸¦ ±â´Ù¸°´Ù°Å³ª ȤÀº internalÇÑ ÀÚ¿ø(latch)µî À» ±â´Ù¸°´Ù°Å³ª ÇÏ´Â wait event¸¦ °¡Áö°í ÀÖ°Ô µÈ´Ù.
Wait event Á¤º¸ ¼öÁý
Oracle wait event¿¡ ´ëÇÑ »ó¼¼ÇÑ Á¤º¸¸¦ Á¦°øÇÏ´Â 3°¡Áö performance viewµéÀÌ ÀÖ´Ù.
¡¤V$SYSTEM_EVENT - Oracle database°¡ ½ÃÀÛÇÑ ÈÄ ¸ðµçsessionÀÇÇØ ¹ß»ýµÇ¾îÁø ´Ù¾çÇÑ wait event¿¡ ´ëÇÑ elapsed time,±×¸®°í À¯Çü°ú ¼ö¸¦ ¿ä¾àÇØ ³õÀº view ÀÌ´Ù.
¡¤V$SESSION_WAIT - ÇöÀç ±â´Ù¸®°í ÀÖ´Â session¿¡ ´ëÇÑ wait¸¦ º¸¿© ÁØ´Ù. ÀÌ view´Â ¶ÇÇÑ ÀÌ wait¿¡ ´ëÇÑ »ó¼¼Á¤º¸ ( À§Ä¡ ¹× ÁÖ¼Ò ) µîÀ» Æ÷ÇÔÇÑ´Ù.
¡¤V$SESSION_EVENT – ÇϳªÀÇ process À̸¦ ±â¹ÝÀ¸·Î elapse time, type and numberµî¿¡ ´ëÇÑ ¿ä¾à Á¤º¸¸¦ °¡Áö°í ÀÖ´Ù. ÀÌ view´Â °³ÀÎÀûÀÎ session¿¡ ´ëÇØ °ËÁõÇÒ ¼ö ÀÖµµ·Ï ÇØÁØ´Ù.
ºñ·Ï V$SESSION_EVENT°¡ °³ÀÎÀûÀÎ process waits¿¡ ´ëÇØ ½ÉÃþÀûÀ¸·Î Á¢±ÙÇÒ ¼ö ÀÖµµ·Ï ÇØ ÁØ´Ù. V$SESSION_WAIT´Â °¢°¢ÀÇ wait¿¡ ´ëÇØ Á»´õ ÀÚ¼¼È÷ °ËÁõ ÇÒ ¼ö ÀÖµµ·Ï ÇØÁÖ°í, V$SYSTEM_EVENT´Â Oracle instance¿¡ ´ëÇÑ overallÇÑ °üÁ¡ÀÇ tuning¿¡ ÀÖ¾î ¸Å¿ì À¯¿ëÇÑ Á¤º¸¸¦ Á¦°øÇÑ´Ù. V$SYSTEM_EVENT´Â ´ÙÀ½°ú °°Àº ¼Ó¼ºÀ» Æ÷ÇÔÇÑ´Ù.
Column Description
===================================================
Event EVENT À̸§
Total_waits - Total number of times this event has been waited for since the instance was started.
Total_timeouts - Number of times the wait for the event was terminated by a timeout
Time_waited -Total time, in 1/100ths of a second, spend waiting for this event by all sessions since the instance started
Average_wait - Average time spent waiting on this event in 1/100ths of a second
Oracle¿¡¼ Á¦°øÇÏ´Â utlbstat/utlestat¸¦ »ç¿ëÇÏ¿© report.txt¸¦ º¸°ÔµÇ¸é V$SYSTEM_EVENTÀÇ ´ëÇÑ ³»¿ëÀ» º¼ ¼ö ÀÖ´Ù. ´Ü ÀÌ report´Â ÀÌÇØÇϱⰡ ±×¸® ½±Áö¾ÊÀºµ¥ gury harrisoÀÇ scriptÀÎ wait_stA.sql , wait_stB.sql.À» »ç¿ëÇØ º¼ °ÍÀ» ÃßõÇÑ´Ù. ù¹ø° ¿ä¾àÁ¤º¸´Â database°¡ startupÈÄÀÇ Á¤º¸ÀÌ°í,µÎ¹ø°Á¤º¸´Â ƯÁ¤ ½Ã°£ÀÇ ±â°£µ¿¾ÈÀÇ ¿ä¾à Á¤º¸ÀÌ´Ù.
°¢°¢ÀÇ event¿¡ ´ëÇÑ °£´ÜÇÑ ¼³¸í
"db file" waits
Oracle eventÀÇ À̸§ Áß ¡°db file¡±·Î ½ÃÀ۵Ǵ event À̸§µéÀº (db file parallel write, db file scattered read, db file sequential read, db file single write) Oracle sessionÀÌ oracle datafile¿¡ ´ëÇÑ I/O¿¡ ´ëÇÑ ¹®Á¦·Î ¹ß»ýÇÏ´Â eventµéÀÌ´Ù.
Datafile¿¡ ¾²´Â ÀÛ¾÷Àº database writer¿¡ ÀÇÇÑ ÀÛ¾÷ÀÌ´Ù. °í·Î ¡°db file¡± write wait´Â »ç¿ëÀÚ session¿¡ ÀÇÇؼ´Â Àý´ë·Î °æÇèµÇ¾îÁú ¼ö ¾ø´Ù.±×·¯³ª user sessionÀº database file·ÎºÎÅÍ Á÷Á¢ÀûÀ¸·Î ÀÐ¾î ¿Ã ¼ö´Â ÀÖ´Ù. ±×¸®°í ÀÌ´Â °ÅÀÇ datafile read events¿¡ ´ëÇÑ wait¸¦ °¡Áö°Ô µÈ´Ù.
¸¸¾à database°¡ ¿ÏÀüÈ÷ SGA¿µ¿ª¿¡ cacheµÇ¾îÁöÁö ¾Ê´Â´Ù¸é, datafile I/O¿¡ ´ëÇÑ waitingÀº ÇÇÇÒ ¼ö ¾ø°í ±×¸®°í ÀÌ wait event´Â database ¼º´É¿¡ ´ëÇØ ¾î¶² °Íµµ ¾Æ´Ï´Ù. °¡Àå °ÇÀüÇÑ database¶ó¸é ¡°db file¡± wait´Â ¸ðµç non-idle wait times¿¡ ´ëÇØ 80%~90%·Î ¼³¸íµÇ¾îÁú ¼ö ÀÖ´Ù.
log file sync/write waits
Oracle sessionÀÌ db file I/O¿¡ ´ëÇØ ÇÇÇÒ ¼ö ¾ø´Â °Íó·³ log file I/O¿¡ ´ëÇÑ waitµµ ÇÇÇÒ ¼ö ¾ø´Ù. ÀÌ·± waits´Â commit statement°¡ redo log¿¡ writeÇÒ ¶§¸¶´Ù ¹ß»ý µÇ¾îÁö¸ç, CommitÀ» ¹ßÇàÇÑ sessionÀº log file sync event¸¦ ±â´Ù¸®°Ô µÈ´Ù. LogWriter process°¡ I/O¸¦ ¿ä±¸ÇÒ ¶§ ÀÌ´Â log file parallel write event¸¦ ±â´Ù¸®°Ô µÈ´Ù.
À§ÀÇ µÎ wait event´Â ÇÇÇÒ ¼ö ¾ø°í non-idle wait timesÀÇ 10%~ 20%·Î ¼³¸íµÇ¾îÁö´Â °ÍÀÌ ÁÁ´Ù.
Log file parallel writeÀÇ Æò±Õ ±â´Ù¸²ÀÇ ½Ã°£Àº ¸Å¿ì Áß¿äÇÑ ÃøÁ¤Ä¡ÀÌ´Ù. ÀÌ°ÍÀº ¾ó¸¶³ª ºü¸£°Ô log writer process°¡ redo log buffer¸¦ flush½ÃÅ°´ÂÁö¸¦ ÁöÀûÇÒ ¼ö ÀÖ°í, redo log device¿¡ ´ëÇÑ È¿À²¼ºÀ» ¾Ë¾Æ º¼ ¼ö ÀÖ´Â ¸Å¿ì Áß¿äÇÑ indicatorÀÌ´Ù. 1¹Ì¸¸ÀÇ °ª ( 100ºÐÀÇ 1ÃÊ)°¡ ¸Å¿ì ÁÁÀ¸¸ç 5ÀÌ»óÀÇ °ªÀº ¸Å¿ì unusualÇÑ°ÍÀ̸ç ÀÌ À§ÀÇ °ªÀº redo log device¿¡ ´ëÇÑ °æÇÕÀ» ¾Ë¾Æ º¼ ¼ö ÀÖ°Ô ÇØÁÖ´Â °ÍÀÌ´Ù.
log file space/switch
À§ÀÇ event´Â redo log entry°¡ redo log bufferÀÇ free space°¡ ºÎÁ·Çؼ ȤÀº redo log file¿¡ switch°¡ ÀϾ redo log°¡ ¾²¿©Áú ¼ö ¾ø¾î¼ redo log entry¸¦ ¸¸µé ¼ö ¾øÀ» ¶§ ¹ß»ýÇÏ´Â eventÀÌ´Ù. ÀÌ eventÀÇ ¹ß»ý ºóµµ´Â Àß tuning µÇ¾îÁø database¿¡ ´ëÇؼ´Â ¹«½Ã ÇÒ ¼ö ÀÖ´Ù. Version 7.3 Àü¿¡´Â À̵éÀÌ °ªÀÌ °áÇÕµÈ ÇüÅÂÀÎ ¡°log file space/switch¡±·Î Ç¥ÇöµÇ¾úÀ¸³ª 7.3ºÎÅÍ´Â ´ÙÀ½°ú °°Àº event·Î Á¤ÀÇ µÇ¾îÁø´Ù.
¡¤log buffer space: redo log buffer¿¡¼ free space¸¦ ±â´Ù¸®´Â wait event. ÀÌ´Â LOG_BUFFER parameterÀÇ Å©±â¸¦ Áõ°¡Çϰųª logwriterÀÇ ¼º´ÉÀ» ÃÖÀûÈÇÔÀ¸·Î½á ÁÙÀÏ ¼ö ÀÖ´Ù.
¡¤log file switch (checkpoint incomplete): next redo log°¡ »ç¿ëµÇ¾îÁú ¼ö ¾øÀ» ¶§ ¹ß»ýÇÑ´Ù.ÀÌ´Â log fileÀÌ ¸¶Áö¸·À¸·Î switched µÇ¾úÀ»¶§ ½ÃÀ۵ǾîÁø checkpoint°¡ ¾ÆÁ÷ ³¡³ªÁö ¾Ê¾ÒÀ» ¶§ ¹ß»ýÇÏ°Ô µÈ´Ù.
¡¤log file switch (archiving needed): redo log°¡ ¾ÆÁ÷ archived µÇÁö ¾Ê¾Æ »ç¿ëÇÒ ¼ö ¾øÀ» ¶§ ¹ß»ýÇÏ´Â wait eventÀÌ´Ù.
À̵é waitsµéÀº redo logs°¡ ¸Å¿ì ´À¸° device¿¡ Àִٰųª, Log_buffer°¡ ³Ê¹« ³·Àº °ªÀ¸·Î settingµÇ¾îÁ³°Å³ª ȤÀº ³Ê¹«³ª ÀûÀº ȤÀº ³Ê¹«³ª ÀÛÀº redo log¸¦ °¡Áö°í Àִµ¥ ±âÀÎÇÔÀ» º¸¿©ÁØ´Ù. Redo log¸¦ multiple devices¿¡ ³õ¾Æ log writer±×¸®°í archive log process»çÀÌÀÇ °æÇÕÀ» ÁÙÀÌ´Â ¹æ¾ÈÀ» °í·ÁÇØ º¼¸¸ÇÏ´Ù.
Buffer busy waits
ÀÌ wait event´Â sessionÀÌ SGA¾È¿¡¼ ÇÊ¿ä·Î ÇÏ´Â blockÀÌ ´Ù¸¥ session¿¡ ÀÇÇØ »ç¿ëµÇ¾î¼ accessÇÒ ¼ö ¾øÀ» ¶§ ¹ß»ýÇÏ°Ô µÈ´Ù. °¡Àå ÈçÇÏ°Ô ¹ß»ýÇÏ´Â °øÅëÀûÀÎ µÎ °¡Áö »çÇ×Àº Å×ÀÌºí¿¡ ´ëÇÑ ÃæºÐÄ¡ ¸øÇÑ free lists¿Í ³Ê¹«µµ ÀûÀº rollback segments¶§¹®¿¡ ¹ß»ýÇÒ ¼ö ÀÖ´Ù.
V$WAITSTAT.¿¡ ÀÇÇØ À§ÀÇ µÎ °¡Áö °æ¿ì¿¡ ´ëÇÑ ¿øÀÎÀ» ±¸º°ÇÒ ¼ö ÀÖ´Ù. ¸¸¾à V$WAITSTAT¿¡ ¡°data block¡± ȤÀº ¡°free list¡±¿¡ ´ëÇÑ wait°¡ ½ÉÇÏ´Ù¸é, ÀÌ°ÍÀº multiple freelists( µ¿½Ã¿¡ ¸¹Àº inserts °¡ ÀϾ´Â Å×ÀÌºí¿¡ ´ëÇØ )°¡ ÇÊ¿ä·Î ÇÏ´Â °ÍÀÏ ¼ö°¡ ¸¹´Ù. ¸¸¾à¿¡ ¡°undo header¡± or ¡°undo block¡±°¡ ½ÉÇÏ´Ù¸é ÀÌ´Â Ãß°¡ÀûÀÎ rollback segments°¡ ÇÊ¿ä·Î ÇÏ´Â °ÍÀÏ ¼ö °¡ ¸¹´Ù.
Free buffer waits/write complete waits
À§ÀÇ wait event´Â sessionÀÌ SGA¿¡ ÀÖ´Â ÇϳªÀÇ block¿¡ insert³ª modifyÇÏ·Á°í ½ÃµµÇϳª ÇÒ ¼ö ¾øÀ» ¶§ ¹ß»ýµÇ´Â wait eventÀÌ´Ù.
¡°write complete waits¡± wait event´Â ¾î´Â ÇÑ sessionÀÌ ¼öÁ¤ÇÏ·Á´Â blockÀÌ ÇöÀç database write process¿¡ ÀÇÇØ disk¿¡ ¾²¿©Áö°í ÀÖÀ» ¶§ ¹ß»ýµÇ´Â wait eventÀÌ´Ù.ÀÌ wait event´Â Ưº°È÷ checkpointÁß¿¡ ¹ß»ýÇÏ´Â °æ¿ì°¡ ¸¹´Ù.
Free buffer waits´Â ¾î´À ÇÑ sessionÀÌ disk»ó¿¡ ÀÖ´Â datafile·ÎºÎÅÍ blockÀ» buffer cache·Î Àоî¿À´Âµ¥ ÀÖ¾î ¹ß»ýÇÏ´Â wait eventÀÌ´Ù. ¸¸¾à¿¡ buffer cache¿¡ clean ( unmodified )ÀÌ ¾øÀ» °æ¿ì sessionÀº database writer process°¡ dirty(modified) blocksÀ» disk¿¡ ¾µ µ¿¾È ±â´Ù·Á¾ß¸¸ ÇÑ´Ù. ÀϹÝÀûÀ¸·Î database writer´Â °è¼ÓÇÏ¿© dirty blocksÀ» disk¿¡ ³»·Á ¾´´Ù. ÀÌ·± Çö»óÀº °ÅÀÇ ¹ß»ýÇÏÁö ¾Ê´Â´Ù.
¸¸¾à À̵é wait eventsµéÀÌ total waitÀÇ ¸¹Àº ºÎºÐÀ» Â÷ÁöÇÑ´Ù¸é ´ÙÀ½°ú °°Àº ¹æ¹ýÀ¸·Î database writer processÀÇ ¼º´ÉÀ» Çâ»ó ½Ãų ¼ö ÀÖ´Ù.
¡¤ Use asynchronous I/O or multiple database writers (DB_WRITERS parameter). Asynchronous I/O is enabled by default under NT. In UNIX you need to set ASYNC_IO=TRUE in your server parameter file and possibly enable asynchronous I/O at the operating system level. Use asynchonous or list I/O in preference to multiple database writers if it is available.
¡¤ Stripe your datafiles across multiple disk devices. The number of devices across which the datafiles are housed and the evenness of the spread determines the ultimate I/O limit of your system. Use operating system striping if possible (RAID-0) but if this is not available alternate datafiles across multiple disk devices.
¡¤ Avoid RAID-5. RAID-5 can be attractive because it spreads I/O across multiple devices and enables fault tolerance more economically than mirroring (RAID-1). However, RAID-5 can more than halve the write capability of your disks, since each local write will require at least two physical writes (additional I/Os are required to read and write the parity block). Many RAID-5 vendors provide large non-volatile disk caches in an attempt to avoid this write penalty. Free buffer or write complete waits may be a sign that these efforts are unsuccessful.
¡¤ Consider raw devices/partitions. The use of raw devices (unformatted disk devices without an overlying fileystem) is somewhat controversial and may not suit all applications. However, the database writer process will usually benefit from raw devices.
enqueue waits
Enqueue´Â sessionÀÌ lockÀ» Àâ°íÀÚ ÇÒ ¶§ ¹ß»ýÇÑ´Ù. ´ëºÎºÐÀÇ case¿¡¼ sessionÀÌ ¼öÁ¤ÇÏ°íÀÚ ÇÏ´Â row³ª table¿¡ ´ëÇØ lockÀ» °É°íÀÚ ÇÒ ¶§ ¹ß»ý ÇÏ°Ô µÈ´Ù. ¾î¶² ȯ°æ ³»¿¡¼´Â °ü·ÃµÈ lockÀÌ oracle internal lockÀÏ °æ¿ìµµ ÀÖ´Ù(eg. Space Transaction enqueue ). ÀϹÝÀûÀ¸·Î excessiveÇÏ°Ô enqueue waits¸¦ ¾ß±âÇÏ´Â ÀϹÝÀûÀÎ °æ¿ì´Â ´ÙÀ½°ú °°´Ù.
¡¤ Database³»¿¡ ƯÁ¤ row¿¡ ´ëÇÑ °æÇÕÀÌ ÀÖÀ» °æ¿ì.¾î¶² ´Ù·®ÀÇ processesµéÀÌ µ¿½Ã¿¡ µ¥ÀÌÅͺ£À̽º ¾È¿¡ °°Àº row¿¡ ´ëÇÏ¿© lockȤÀº update¸¦ ¿ä±¸ÇÒ ¶§..
¡¤ Table locks caused by unindexed foreign keys. If an un-indexed foreign key is updated then the parent table will be subjected to a table lock until the transaction is complete.
¡¤ "Old-style" temporary tablespaces. If the tablespace nominated as the temporary tablespace has not been created with the TEMPORARY clause (introduced in ORACLE 7.3) , then sessions may contend for the "space transaction" lock.
¡¤ The space reserved for transactions within a data block is too small. By default, only one transaction slot for tables or two for indexes is allocated when the table or index is created. The number of transaction slots is determined by the INITRANS clause in the CREATE TABLE or INDEX statement. If additional transaction slots are required they are created - providing there is free space in the block. However, if all transaction slots are in use and there is no free space in the block then a session wishing to lock a row in the block will encounter an enqueue wait, even if the row in question is not actually locked by another process. This phenomenon can occur if both PCTFREE and INITRANS were set too low.
latch free waits
Latch´Â ´Ù·®ÀÇ sessionÀÌ SGS¾È¿¡ ÀÖ´Â µ¿ÀÏÇÑ item¿¡ ´ëÇÏ¿© µ¿½Ã¿¡ update¸¦ ÇÏÁö ¸øÇÏ°Ô ÇÏ´Â internalÇÑ locking mechanismÀÌ´Ù. ¸¸¾à¿¡ sessionÀÌ ´Ù¸¥sessionÀÌ ÀÌ¹Ì °¡Áö°í ÀÖ´Â latch¸¦ ¿ä±¸ÇÑ´Ù¸é À̶§ ÀÌ sessionÀº latch free wait°¡ ¹ß»ýÇÒ °Í ÀÌ´Ù.
¾ÆÁÖ ¸¹Àº latch free wait°¡ Á¸ÀçÇÑ´Ù¸é ÀÌ´Â SGA³»¿¡ bottleneck¿¡ ´ëÇÑ indicator°¡ µÉ ¼ö ÀÖ´Ù. Latch °æÇÕ¿¡ ´ëÇÑ »ó¼¼ÇÑ ³»¿ëÀº ´ÙÀ½¿¡ À̾߱â·Î ÇÏ°í ´Ü¼øÇÑ guide lineÀ» À̾߱â ÇÏ°Ú´Ù.
¡¤ V$LATCH view¸¦ ÀÌ¿ëÇÏ¿© ¾î¶² latch°¡ ¸¹Àº sleepºÎºÐ¿¡ ¿µÇâÀÌ ÀÖ´ÂÁö¸¦ ¾Ë¾Æº»´Ù. °¢°¢ÀÇ sleepÀº latch free wait·Î ÀÌÇصǾî Áú ¼ö ÀÖ´Ù.
¡¤ cache buffer lru chain ±×¸®°í cache buffer chain latches ÀÇ °æÇÕÀº ¸¸¾à database°¡ ³ôÀº ¹°¸®ÀûÀÎ I/O ȤÀº ³í¸®ÀûÀÎ I/O·Î À¯Áö µÇ¾îÁø´Ù¸é ¹ß»ý ÇÒ ¼ö ÀÖ´Ù. ÀÌ·± I/O ºñÀ²Àº SQLÀ» tuningÇÔÀ¸·Î½á ȤÀº buffer cache ÀÇ Å©±â¸¦ Áõ°¡½ÃÅ´À¸·Î ÁÙÀÏ ¼ö ÀÖ´Ù. ¶ÇÇÑ DB_BLOCK_LRU_LATCHES ȤÀº DB_BLOCK_HASH_BUCKETS ÀÇ °ªÀ» Áõ°¡ÇÔÀ¸·Î È¿°ú¸¦ º¼ ¼ö ÀÖ´Ù.
¡¤ the library cache and library cache pin latches¿¡ ´ëÇÑ °æÇÕÀº heavy parsing ȤÀº SQL ½ÇÇàºñÀ²ÀÌ ±²ÀåÈ÷ ³ôÀ» ¶§ ¹ß»ýÇÒ ¼ö ÀÖ´Ù. the library cache latch¿¡ ´ëÇÑ misses´Â ÀϹÝÀûÀ¸·Î non-sharable SQL¿¡ ´ëÇÑ ÃÊ°úÀûÀÎ(excessive) reparsingÀÇ ÀǹÌÀÌ´Ù.SQL statement¿¡¼ literalÇÑ ¹æ¹ýº¸´Ù bind º¯¼ö¸¦ »ç¿ëÇÏ´Â °ÍÀÌ ÁÁ´Ù.
¡¤ the redo allocation latch¿¡ ´ëÇÑ °æÇÕÀº LOG_ENTRY_MAX_SIZE°ªÀ» ÁÙÀÓÀ¸·Î °æÇÕÀ» ÁÙÀÏ ¼ö ÀÖ´Ù. the redo copy latch¿¡ ´ëÇÑ °æÇÕÀº LOG_SIMULTANEOUS_COPIESÀÇ °ªÀ» Áõ°¡ÇÔÀ¸·Î ´Ù·ç¾î Áú ¼ö ÀÖ´Ù.
¡¤ ¸¸¾à latch contention¿¡ Á÷¸é ÇÏ°í spare CPU ¿ë·®ÀÌ ÀÖ´Ù¸é,SPIN_COUNT°ªÀ» Áõ°¡ÇØ º¸´Â °Íµµ °í·ÁÇØ º¼¸¸ ÇÏ´Ù. ¸¸¾à CPU ¿¡ ´ëÇÑ ÀÚ¿øÀÌ ´Ù »ç¿ëµÇ°í ÀÖÀ»°æ¿ì´Â SPIN_COUNTÀÇ °ªÀ» ÁÙ¿© º¸´Â °Íµµ »ý°¢ÇØ º¼ ¼ö ÀÖ´Ù.
SQL*Net waits
Oracle server´Â SQL*NETÀÛµ¿ÀÌ ¸¶Ä¡±â¸¦ ±â´Ù¸®´Â »óȲÀ» ±â·ÏÇϴµ¥, ÀÌ·± wait eventµéÀº SQL*NETÀ¸·Î ½ÃÀÛÇÑ´Ù. À̵é eventµéÀº client process°¡ ¹Ùºü¼ ȤÀº ³×Æ®¿öÅ© ºÎÇÏ ¹®Á¦ÀÎÁö °ËÁõÇϱ⠾î·Æ´Ù. Ưº°È÷ "SQL*Net message from client¡± event´Â server process°¡ client process·ÎºÎÅÍ ´Ù¸¥ Á¶Ä¡¸¦ ±â´Ù¸®´Â µ¿¾È idleÇÑ »óÅÂÀÓÀ» ¸»ÇÑ´Ù. ±×·± ÀÌÀ¯·Î ÀÌ event´Â ¹«½ÃÇÏ¿©µµ ÁÁ´Ù.¸¸¾à ´Ù¸¥ SQL*NET ±â´Ù¸²Àº ¸¹Àº wait Åë°èÄ¡¿¡ ¸¹Àº ºÎºÐÀ» Â÷ÁöÇÑ´Ù¸é networkÂÊÀ» °ËÁõÇØ º¼ ÇÊ¿ä°¡ ÀÖ´Ù.
Events which are safe to ignore
¡¤ Null event
¡¤ SQL*NET message from client
¡¤ SQL*NET more data from client
¡¤ Parallel query dequeue wait
¡¤ client message
¡¤ smon timer
¡¤ rdbms ipc message
¡¤ pmon timer
¡¤ WMON goes to sleep
¡¤ virtual circuit status
¡¤ dispatcher timer
¡¤ pipe get
Where to from here?
°¡²ûÀº wait event¿¡ ´ëÇÑ ¹ß»ý±â°£ ȤÀº ºóµµº¸´Ù ´õ ¸¹Àº °ÍÀ» ¾Ë°íÀÚ ÇÒ ¶§°¡ ÀÖ´Ù. °¡·É buffer busy wait°¡ ºÒÃæºÐÇÑ freelists·Î ÀÎÇØ ¹ß»ýµÇ¾ú´Ù¸é, ¾î¶² tableȤÀº ¾î¶² index¿Í °ü·ÃÀÌ µÇ¾î ÀÖ´ÂÁö ¾Æ´Â °ÍÀÌ ¸¹Àº µµ¿òÀ» ÁÙ ¼ö ÀÖ´Ù. À̸¦ ÇÒ ¼ö ÀÖ´Â ¿©·¯ °¡Áö ¹æ¹ýÀÌ ÀÖ´Ù.
V$SESSION_WAITS´Â ¾î¶² sessionÀÌ ÇöÀç ±â´Ù¸®°í ÀÖ´ÂÁö¸¦ ±×¸®°í p1,p2,p3°¡ ÀÌ wait¿¡ ´ëÇØ º¸´Ù ÀÚ¼¼ÇÑ Á¤º¸¸¦ °¡Áö°í ÀÖ´Ù.°¡·É ¡°db fiel sequential read¡± ¿¡¼ p1Àº Àаí ÀÖ´Â file numberÀÌ°í p2´Â block numberÀÌ´Ù. °í·Î DBA_EXTENTS view¸¦ ÀÌ¿ëÇÏ¿© °ü·ÃµÈ segment¸¦ ¾Ë¾Æ ³¾ ¼ö ÀÖ´Ù.
±×·¯³ª V$SESSIOM_WAITS´Â queriedµÇ¾îÁø ¼ø°£ÀÇ Á¤º¸À̱⠶§¹®¿¡ ¾Ë¾Æ³»°íÀÚ ÇÏ´Â event¿¡ ´ëÇÑ Á¤º¸¸¦ ¾ò±â´Â ±×¸® ½±Áö ¾Ê´Ù. ´ÙÀ½°ú °°ÀÌ trace¸¦ ¶°¼ »ç¿ë ÇÑ´Ù.
ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL n';
ÀÌ ¸í·ÉÀ» »ç¿ëÇÏ°í, wait event Á¤º¸´Â sql trace file¿¡ ´ÙÀ½°ú °°ÀÌ ±â·ÏµÇ¾î Áø´Ù.
WAIT #2: nam='db file sequential read' ela= 0 p1=1 p2=1135 p3=1
Comparing wait times with CPU utilisation
SessionsÀÌ ¾î¶² event¿¡ ´ëÇÑ ±â´Ù¸²ÀÌ ¾øÀ» ¶§, À̵é sessionÀº CPUÀÚ¿ø¿¡ ´ëÇØ »ç¿ëÇϰųª,±â´Ù¸®°í ÀÖ´Ù. ÀÌ·± ÀÌÀ¯·Î CPU»ç¿ëÇÑ ½Ã°£°ú ´Ù¾çÇÑ event¿¡ ´ëÇÑ ±â´Ù¸²ÀÇ ½Ã°£°ú ºñ±³ÇÏ´Â °ÍÀÌ ÁÁÀ» ¼ö ÀÖ´Ù.
ÀüüÀûÀÎ oracle instance¿¡ ´ëÇÑ CPU utilizationÀº V$SYSSTAT¸¦ Á¶È¸ÇÔÀ¸·Î ¾Ë ¼ö ÀÖ´Ù. °¡·É ¡°CPU used by this session¡± or ¡°statistic#=12¡±¸¦ ÀÌ¿ëÇÏÀÚ.
|