LRU latch °æÇÕ
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2004-03-04 11:54:25
 

* LRU latch °æÇÕ

SQL> select name, sleeps/gets "LRU Miss%"
  2  from v$latch
  3  where name = 'cache buffers lru chain';

NAME                                  LRU Miss%
------------------------------------ ----------
cache buffers lru chain                      0    -->  < 1%°¡ ¸ñÇ¥

À§¿¡¼­ »ÌÀº ¼öÄ¡ LRU Miss% °¡ 1%¸¦ ³Ñ°Ô µÇ¸é db_block_lru_latches ¼ö¸¦ ´Ã·ÁÁØ´Ù.
latchÀÇ ÃÖ´ë ¼ö´Â
- Number of CPUs * 2 * 3    ==> buffer pool´ç 2°³°¡ max, buffer poolÁ¾·ù°¡ 3°¡Áö
                                                                  (keep,recycle,default)
- Number of buffers / 50 

À§ µÎ°ªÁß ÀÛÀº°ªÀ» max·Î Àâ¾Æ¾ß ÇÑ´Ù.

######################################################

¡á Latch

¿À¶óŬ ¿î¿µ ½Ã¿¡ ÇÏÀ§·¹º§¿¡¼­ ³»ºÎÀûÀ¸·Î 󸮵Ǵ ´Ù¾çÇÑ Á¶ÀÛµéÀÌ latchÀÇ °üÇÒ ÇÏ¿¡ ¼öÇàµÇ´Âµ¥ V$LATCHNAMEÀ» Á¶È¸Çغ¸¸é (9i ±âÁØÀ¸·Î) 239 Á¾·ù³ª µÇ´Â Latch°¡ Á¸ÀçÇÏ´Â °ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù. ÀÌ °¡¿îµ¥ ¿ì¸®°¡ ÀÚÁÖ Á¢ÇÏ°Ô µÇ´Â latch´Â ´ÙÀ½°ú °°Àº Á¤µµÀÌ¸ç °¢ LatchÀÇ ±â´ÉÀº °ü·Ã SGAº° Wait¸¦ ´Ù·ê ¶§ °£´ÜÇÏ°Ô³ª¸¶ ¼Ò°³Çϵµ·Ï ÇÏ°Ú´Ù.

Shared pool library cache latch, shared pool latch, row cache objects
Buffer Cache cache buffers chains latch, cache buffers lru latch, cache buffer handle
Redo log redo allocation latch, redo copy latch, redo writing latch
OPS dlm resource hash list




¢¹ Willing to wait ¸ðµå¿Í No-wait ¸ðµå

Latch ȹµæ ¹æ½ÄÀº No-wait°ú Willing to wait ÀÇ µÎ °¡Áö ¸ðµå·Î ±¸ºÐÇÒ ¼ö ÀÖ´Ù. Willing to wait ¸ðµå´Â LatchÀÇ È¹µæ¿¡ ½ÇÆÐÇϸé Á»´õ ½Ã°£À» ²ø¸é¼­ ÇØ´ç Latch¸¦ ÀâÀ» ¶§±îÁö Àç½Ãµµ¸¦ Çغ¸´Â ¹æ½ÄÀ» ¸»ÇÑ´Ù. ÀÏÂ÷ÀûÀ¸·Î´Â CPU¸¦ ³õÁö ¾Ê°í Á¤ÇØÁø Ƚ¼ö¸¸Å­ SpinningÀ» ÇÑ ÈÄ Àç½Ãµµ¸¦ Çغ¸´Ù°¡ ±×·¡µµ ½ÇÆÐÇϸé CPU¸¦ ³õ°í SleepÇÏ´Ù°¡ timeoutµÇ¾î Àç½ÃµµÇÏ´Â ÀÛ¾÷À» ¹Ýº¹Çϸ鼭 LatchÀÇ È¹µæÀ» ³ë·ÂÇÏ°Ô µÈ´Ù. Latch°¡ sleep¿¡ µé¾î°¡°Ô µÇ¸é 'latch free' wait event ´ë±â°¡ ½ÃÀ۵ȴÙ. sleepÀÇ Áö¼Ó½Ã°£Àº sleep Ƚ¼ö°¡ ´Ã¾î°¥¼ö·Ï Á¡Á¡ ±æ¾îÁö°Ô µÇ´Âµ¥, µû¶ó¼­ V$LATCHÀÇ Gets¿Í SleepsÀÇ ºñÀ²°ú ÇÔ²² Sleep1~sleep4 Ç׸ñ¿¡¼­ ¸îÂ÷ Sleep±îÁö ¹ß»ýÇß´ÂÁö ¿©ºÎµµ °¢ Latch WaitÀÇ ½É°¢¼ºÀ» ÆÇ´ÜÇÏ´Â ¿ä¼Ò °¡¿îµ¥ Çϳª°¡ µÈ´Ù.

No-wait ¸ðµå´Â Willing to wait°ú´Â ´Þ¸® ´õ ÀÌ»ó ¹Ì·ÃÀ» µÎÁö ¾Ê°í ÇØ´ç Latch¿¡ ´ëÇÑ È¹µæÀ» Æ÷±âÇÏ´Â °ÍÀÌ´Ù. No-wait ¸ðµå°¡ »ç¿ëµÇ´Â °æ¿ì´Â µÎ °¡Áö°¡ Àִµ¥, Çϳª´Â µ¿ÀÏÇÑ ±â´ÉÀ» ÇÏ´Â Latch°¡ ¿©·¯ °³ Á¸ÀçÇÏ¿© ±× Áß¿¡ Çϳª¸¸ ȹµæÇϸé ÃæºÐÇÏ¿©¼­ ƯÁ¤ Latch¿¡ ¹Ì·ÃÀ» °¡Áú ÇÊ¿ä°¡ ¾ø´Â °æ¿ìÀÌ´Ù. ¹°·Ð, ÀÌ ¶§¿¡µµ °°Àº ±â´ÉÀÇ ¸ðµç Latch¿¡ ´ëÇÑ ½Ãµµ°¡ ½ÇÆзΠ³¡³¯ °æ¿ì¿¡´Â Willing to wait ¸ðµå·Î ¿äûÀ» ÇÒ °ÍÀÌ´Ù. No-wait ¸ðµå°¡ »ç¿ëµÇ´Â ´Ù¸¥ ÇÑ°¡Áö °æ¿ì´Â dead lockÀ» ÇÇÇϱâ À§Çؼ­ ÀÌ´Ù. ¿À¶óŬÀº ±âº»ÀûÀ¸·Î latch dead lock »óȲÀ» ÇÇÇϱâ À§ÇÏ¿© ¸ðµç Latch¿¡ levelÀ» ºÎ¿©ÇÏ¿© Á¤ÇØÁø ¼ø¼­¸¦ µû¶ó¼­¸¸ Latch¸¦ ȹµæÇϵµ·Ï ÇÏ°í Àִµ¥, ÇÊ¿ä¿¡ ÀÇÇØ ÀÌ ±ÔÄ¢À» ¾î±â°í Latch¸¦ ȹµæÇÏ°íÀÚ ÇÒ °æ¿ì ÀÏ´Ü No-wait ¸ðµå·Î ½Ãµµ¸¦ Çغ¸´Â °ÍÀÌ´Ù. ´ÙÇàÈ÷ Latch¸¦ ÀâÀ¸¸é ÁÁÀº °ÍÀÌ°í ºñ·Ï latch¸¦ ÀâÀ» ¼ö ¾ø´õ¶óµµ ¹«ÇÑÁ¤ ±â´Ù¸²À¸·Î½á dead lock »óÅ¿¡ ºüÁö´Â ÀÏÀº ÇÇÇÒ ¼ö ÀÖ´Â °ÍÀÌ´Ù. No-wait ¸ðµåÀÇ LatchÀÛ¾÷¿¡¼­´Â ´ç¿¬È÷ Latch °ü·Ã waitÀÌ ¹ß»ýÇÏÁö ¾ÊÀ¸¸ç, redo copy latch¸¦ Á¦¿ÜÇÏ°í´Â Willing to wait ¸ðµå·Î Latch¸¦ ȹµæÇÏ´Â °æ¿ì°¡ ÈξÀ ¸¹´Ù.

¢¹ Parent latch¿Í Child latch

Latch °¡¿îµ¥¿¡´Â µ¿ÀÏ ±â´ÉÀ» ÇÏ´Â Child latchµéÀÇ setÀ¸·Î ¿î¿µµÇ´Â Latchµµ ÀÖÀ¸¸ç ÇϳªÀÇ Latch·Î¸¸ ¿î¿µµÇ´Â Latchµµ ÀÖ´Ù. ÀüÀÚÀÇ ´ëÇ¥ÀûÀÎ ¿¹·Î´Â cache buffers chains (¹öÆÛij½¬ ºí·Ï µéÀ» °°Àº À̸§ÀÇ ´Ù¼öÀÇ Latch°¡ ³ª´©¾î ´ã´ç)°¡ ÀÖÀ¸¸ç, ÈÄÀÚÀÇ ¿¹·Î´Â shared pool latch (shared pool³»¿¡¼­ ¸Þ¸ð¸® ÇÒ´çÀ» À§ÇØ È¹µæÇØ¾ß ÇÏ´Â Latch·Î ½Ã½ºÅÛ¿¡ Çϳª¸¸ Á¸Àç)°¡ ÀÖ´Ù. ÀÌ¿Í °°Àº Latch °ü·Ã Åë°è Á¤º¸´Â Parent latch¿Í Child latchÀÇ °³³äÀ¸·Î °ü¸®°¡ µÇ´Âµ¥ Latch set¿¡¼­ °³º° Child latch¿¡ ´ëÇÑ Åë°èÁ¤º¸´Â V$LATCH_CHILDREN ºä¸¦ ÅëÇØ Á¶È¸ÇÒ ¼ö ÀÖÀ¸¸ç, ´ÜÀÏ Latch ȤÀº Latch setÀÇ ¸¶½ºÅÍ Latch (parent)¿¡ ´ëÇÑ Åë°èÁ¤º¸´Â V$LATCH_PARENT ºä¸¦ ÅëÇØ Á¶È¸ÇÒ ¼ö ÀÖ´Ù.

Áö±Ý±îÁö ÇÑ È¸ ºÐ·®À» ÇÒ¾ÖÇÏ¿© Enqueue¿Í Latch¿¡ ´ëÇØ ¿ä¾àÇغ» ÀÌÀ¯´Â, ¸¹Àº WaitingÀÌ SGA³»ÀÇ °øÀ¯ÀÚ¿ø (Block, Cursor µî)¿¡ ´ëÇÑ °æÇÕÀ¸·Î ÀÎÇØ ¹ß»ýÇϸç ÀÌ·¯ÇÑ °æÇÕÀº ´Ù½Ã ÇØ´ç ÀÚ¿ø¿¡ ´ëÇÑ µ¿½Ã ¾×¼¼½º¸¦ Á¦¾îÇÏ´Â Enqueue¿Í Latch¿¡ ´ëÇÑ °æÇÕÀ¸·Î ÈçÈ÷ µå·¯³ª°Ô µÇ¹Ç·Î ¿À¶óŬÀÇ Wait Event¸¦ ¸ð´ÏÅ͸µÇϱâ À§Çؼ­´Â Enqueue¿Í LatchÀÇ ±¸Á¶¿Í ÀÛµ¿¿ø¸®¿¡ ´ëÇØ ÀÌÇØÇÏ´Â °ÍÀÌ ÇʼöÀûÀ̱⠶§¹®ÀÌ´Ù


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦