{"id":985,"date":"2015-12-30T01:40:05","date_gmt":"2015-12-30T01:40:05","guid":{"rendered":"http:\/\/haisins.epac.to\/wordpress\/?p=985"},"modified":"2015-12-30T01:40:05","modified_gmt":"2015-12-30T01:40:05","slug":"latch-lock","status":"publish","type":"post","link":"http:\/\/haisins.synology.me\/wordpress\/?p=985","title":{"rendered":"Latch &#038; Lock"},"content":{"rendered":"<p>Latch &amp; Lock<\/p>\n<p><\/p>\n<p>1. Latch \uac1c\uc694<\/p>\n<p>\uac00\ubcbc\uc6b4 Lock(Light-weight Lock)<\/p>\n<p>\uacf5\uc720 Memory \uc601\uc5ed(SGA)\uc744 \ubcf4\ud638\ud558\uae30 \uc704\ud55c \ub3d9\uae30\ud654 \uac1d\uccb4<\/p>\n<p><\/p>\n<p>1.1 Latch\uac00 \ubcf4\ud638\ud558\ub294 Resource<\/p>\n<p>-Latch\ub294 SGA\uc758 \ubaa8\ub4e0 \ud558\uc704 Memory \uc601\uc5ed\uc744 \ubcf4\ud638<\/p>\n<p>-Cache Buffer<\/p>\n<p>-Shared Pool<\/p>\n<p>-Library Cache<\/p>\n<p>-Redo Buffer<\/p>\n<p><\/p>\n<p>1.2 Memory \uc601\uc5ed\uc758 \uc18d\uc131\uc5d0 \ub530\ub77c \ud558\ub098 \ud639\uc740 \uc5ec\ub7ec \uac1c\uc758 Latch \uc0ac\uc6a9<\/p>\n<p>-\uc5ec\ub7ec \uac1c\uc758 Latch\ub97c \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0 Parent\/Child\uc758 \uad00\uacc4<\/p>\n<p>-Cache Buffer : \uc218\ucc9c \uac1c ~ \uc218 \ub9cc\uac1c\uc758 Latch<\/p>\n<p>-Shared Pool : \ud558\ub098\uc758 Latch<\/p>\n<p>-Library Cache : CPU \uac1c\uc218\uc5d0 \ube44\ub840<\/p>\n<p>-Redo Buffer : \ud558\ub098 ~ \uc5ec\ub7ec \uac1c\uc758 Latch<\/p>\n<p><\/p>\n<p>1.3 Latch \ud68d\ub4dd Mechanism<\/p>\n<p>Spin vs Posting<\/p>\n<p><\/p>\n<p>Spin<\/p>\n<p>-Latch \ud68d\ub4dd \uc2e4\ud328 \uc2dc Spin\uc744 \uc218\ud589\ud558\uba70 \uc7ac\uc2dc\ub3c4<\/p>\n<p>-Spin\uc5d0 \uc758\ud55c \uc7ac\uc2dc\ub3c4\uc5d0\uc11c &nbsp;\uc2e4\ud328 \uc2dc\uc5d0\ub294 Sleep &amp; Wake<\/p>\n<p>-cache buffers chains latch \ub4f1 \ub300\ubd80\ubd84\uc758 Latch\uc5d0\uc11c \uc0ac\uc6a9<\/p>\n<p><\/p>\n<p>Posting<\/p>\n<p>-Latch \ud68d\ub4dd \uc2e4\ud328 \uc2dc Wait List\uc5d0\uc11c \ub300\uae30<\/p>\n<p>-Latch Holder\uac00 Post(\uc54c\ub824\uc90c)\ud574\uc8fc\uba74 Latch \ud68d\ub4dd \ub2e4\uc2dc \uc2dc\ub3c4<\/p>\n<p>-library cache latch, shared pool latch \ub4f1\uc5d0\uc11c \uc0ac\uc6a9<\/p>\n<p><\/p>\n<p>2. latch free<\/p>\n<p>2.1 Event \uc815\uc758&nbsp;<\/p>\n<p>Latch\ub97c \ud68d\ub4dd\ud558\ub294\ub370 \uc2e4\ud328\ud55c \ud6c4 Latch\ub97c \ud68d\ub4dd\ud560 \ub54c\uae4c\uc9c0 \uae30\ub2e4\ub9ac\ub294 \uc774\ubca4\ud2b8<\/p>\n<p><\/p>\n<p>2.2 Spin\uc744 \uc218\ud589\ud558\ub294 \uacbd\uc6b0\uc5d0\ub294 \u201c\ub300\uae30\u201d &nbsp;\uc0c1\ud0dc\uc774\uc9c0\ub9cc &nbsp;CPU\ub97c \uc0ac\uc6a9<\/p>\n<p>-Active Wait\/Busy Wait<\/p>\n<p>-\uc608) latch: cache buffers chains Event \ubc1c\uc0dd \uc2dc \ub192\uc740 CPU \uc0ac\uc6a9\ub960<\/p>\n<p><\/p>\n<p>2.3 Oracle 10g\ubd80\ud130\ub294 Event \uba85 \uc138\ubd84\ud654<\/p>\n<p>-latch: cache buffers chains&nbsp;<\/p>\n<p>-latch: shared pool<\/p>\n<p>-latch: library cache<\/p>\n<p>-latch free<\/p>\n<p><\/p>\n<p>2.4 Dynamic Performance Views<\/p>\n<p>V$LATCH : Latch \ud68d\ub4dd \ud1b5\uacc4. Latch \uc885\ub958 \ub2f9 \ud558\ub098<\/p>\n<p>V$LATCH_PARENT : \ubd80\ubaa8 Latch \ud1b5\uacc4(\uc790\uc2dd\uc774 \uc5c6\ub294 \ubd80\ubaa8\ub9cc)<\/p>\n<p>V$LATCH_CHILDREN : \uc790\uc2dd Latch \ud1b5\uacc4<\/p>\n<p>V$LATCHHOLDER : Latch Holder \uc815\ubcf4<\/p>\n<p>V$LATCH_MISSES : Latch \ud68d\ub4dd \uc2e4\ud328 \uc815\ubcf4<\/p>\n<p><\/p>\n<p>3. Lock<\/p>\n<p>3.1 Lock\uc758 \uac1c\uc694<\/p>\n<p>Latch\ubcf4\ub2e4 \ubb34\uac70\uc6b4 \ub3d9\uae30\ud654 \uac1d\uccb4<\/p>\n<p>Database\uc640 \uad00\ub828\ub41c \uac1d\uccb4(Object)\ub97c \ubcf4\ud638\ud558\ub294 \ub3d9\uae30\ud654 \uac1d\uccb4<\/p>\n<p><\/p>\n<p>3.2 Lock\uc774 \ubcf4\ud638\ud558\ub294 Resource<\/p>\n<p>-Latch\uac00 \ubcf4\ud638\ud558\ub294 Resource \uc678\uc758 \ubaa8\ub4e0 Database Object<\/p>\n<p>&#8211;Tablespace<\/p>\n<p>&#8211;Table<\/p>\n<p>&#8211;Row<\/p>\n<p>&#8211;Transaction<\/p>\n<p>&#8211;LCO(Library Cache Object)<\/p>\n<p>&#8211;RCO(Row Cache Object)<\/p>\n<p><\/p>\n<p>3.3 Lock\uc758 \ubd84\ub958<\/p>\n<p>-Enqueue Lock<\/p>\n<p>&#8211;User Type: TX, TM, UL<\/p>\n<p>&#8211;System Type: US, HW, SQ, SV, TT, WF, \u2026<\/p>\n<p>&#8211;V$LOCK_TYPE \ubdf0 \ucc38\uc870(10g)<\/p>\n<p>-\uae30\ud0c0 Lock<\/p>\n<p>&#8211;library cache lock, library cache pin<\/p>\n<p>&#8211;row cache lock<\/p>\n<p>&#8211;buffer lock<\/p>\n<p><\/p>\n<p>3.4 Lock \ud68d\ub4dd Mode<\/p>\n<p>-6 \ub2e8\uacc4\uc758 Mode \uc815\uc758<\/p>\n<p>&#8211;Null (1, N)<\/p>\n<p>&#8211;Sub-Shared (2, SS, RS)<\/p>\n<p>&#8211;Sub-Exclusive (3, SX, RX)<\/p>\n<p>&#8211;Shared (4, S)<\/p>\n<p>&#8211;Shared-Sub-Exclusive (5, SSX, SRX)<\/p>\n<p>&#8211;Exclusive (6, X)<\/p>\n<p>-\uc608:<\/p>\n<p>&#8211;UPDATE XXX SET \u2026&nbsp;<\/p>\n<p>&#8212;XXX Table\uc5d0 \ub300\ud574 TM Lock\uc744 SX Mode\ub85c \ud68d\ub4dd<\/p>\n<p>&#8212;Transaction\uc5d0 \ub300\ud574 TX Lock\uc744 X Mode\ub85c \ud68d\ub4dd<\/p>\n<p>&#8211;ALTER TABLE XXX \u2026<\/p>\n<p>&#8212;XXX Table\uc5d0 \ub300\ud574 TM Lock\uc744 X Mode\ub85c \ud68d\ub4dd<\/p>\n<p><\/p>\n<p>4. enqueue<\/p>\n<p>Enqueue Lock\uc744 \ud68d\ub4dd\ud558\ub294\ub370 &nbsp;\uc2e4\ud328\ud55c \ud6c4 Enqueue Lock\uc744 \ud68d\ub4dd\ud560 \ub54c\uae4c\uc9c0 \ub300\uae30\ud558\ub294 Event<\/p>\n<p><\/p>\n<p>4.1 Oracle 10g\ubd80\ud130\ub294 Event \uba85 \uc138\ubd84\ud654<\/p>\n<p>-enq: TX \u2013 row lock contention<\/p>\n<p>-enq: TX \u2013 allocate ITL entry<\/p>\n<p>-enq: TM \u2013 contention<\/p>\n<p>-enq: SQ \u2013 contention<\/p>\n<p>-enq: HW \u2013 contention<\/p>\n<p><\/p>\n<p>4.2&nbsp;\uae30\ud0c0 Lock \uad00\ub828 Event<\/p>\n<p>-library cache lock<\/p>\n<p>-library cache pin<\/p>\n<p>-row cache lock<\/p>\n<p>-buffer busy waits<\/p>\n<p><\/p>\n<p>4.3 Dynamic Performance Views<\/p>\n<p>-V$LOCK : Enqueue Lock\uc5d0 \ub300\ud55c \ubaa8\ub4e0 \uc815\ubcf4<\/p>\n<p>-DBA_KGLLOCK : Library cache lock + Library cache pin<\/p>\n<p>-X$KGLLK : Library cache lock<\/p>\n<p>-X$KGLPN : Library cache pin<\/p>\n<p>-X$KGLOB : LCO<\/p>\n<p>-V$ROWCACHE_PARENT : Row cache lock<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Latch &amp; Lock 1. Latch \uac1c\uc694 \uac00\ubcbc\uc6b4 Lock(Light-weight Lock) \uacf5\uc720 Memory \uc601\uc5ed(SGA)\uc744 \ubcf4\ud638\ud558\uae30 \uc704\ud55c \ub3d9\uae30\ud654 \uac1d\uccb4 1.1 Latch\uac00 \ubcf4\ud638\ud558\ub294 Resource -Latch\ub294 SGA\uc758 \ubaa8\ub4e0 \ud558\uc704 Memory \uc601\uc5ed\uc744 \ubcf4\ud638 -Cache Buffer -Shared Pool -Library Cache -Redo Buffer 1.2 Memory \uc601\uc5ed\uc758 \uc18d\uc131\uc5d0 \ub530\ub77c \ud558\ub098 \ud639\uc740 \uc5ec\ub7ec \uac1c\uc758 Latch \uc0ac\uc6a9 -\uc5ec\ub7ec \uac1c\uc758 Latch\ub97c \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0 Parent\/Child\uc758 \uad00\uacc4 -Cache Buffer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"spay_email":""},"categories":[11],"tags":[148,526],"jetpack_featured_media_url":"","amp_enabled":true,"_links":{"self":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/985"}],"collection":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=985"}],"version-history":[{"count":0,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/985\/revisions"}],"wp:attachment":[{"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=985"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/haisins.synology.me\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}