{"id":323,"date":"2011-11-23T23:28:44","date_gmt":"2011-11-23T15:28:44","guid":{"rendered":"https:\/\/yangtingkun.net\/?p=323"},"modified":"2011-11-23T23:41:05","modified_gmt":"2011-11-23T15:41:05","slug":"%e5%8d%95%e4%b8%80%e4%bc%9a%e8%af%9d%e5%bc%95%e5%8f%91%e7%9a%84%e6%ad%bb%e9%94%81","status":"publish","type":"post","link":"https:\/\/yangtingkun.net\/?p=323","title":{"rendered":"\u5355\u4e00\u4f1a\u8bdd\u5f15\u53d1\u7684\u6b7b\u9501"},"content":{"rendered":"<p>\u5ba2\u6237\u73af\u5883\u4e2d\u51fa\u73b0\u4e86ORA-60\u6b7b\u9501\u9519\u8bef\uff0c\u68c0\u67e5\u65e5\u5fd7\u53d1\u73b0\uff0c\u6301\u6709\u9501\u548c\u7b49\u5f85\u9501\u7684\u662f\u540c\u4e00\u4e2a\u4f1a\u8bdd\u3002<br \/>\n\u4e00\u822c\u6765\u8bf4\u6784\u6210\u6b7b\u9501\u81f3\u5c11\u9700\u8981\u4e24\u4e2a\u4f1a\u8bdd\uff0c\u800c\u5f53\u524d\u7684\u95ee\u9898\u662f\u4e00\u4e2a\u4f1a\u8bdd\u5f15\u53d1\u7684\uff1a<\/p>\n<pre lang='SQL'>Wed Nov 23 10:19:46 2011\r\nORA-00060: Deadlock detected. More info in file \/oracle\/admin\/db1\/udump\/db1_ora_3408686.trc.<\/pre>\n<p>\u5bf9\u5e94\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a<\/p>\n<pre lang='SQL'>*** 2011-10-29 10:11:28.970\r\n*** SERVICE NAME:(db1) 2011-10-29 10:11:28.960\r\n*** SESSION ID:(5562.45) 2011-10-29 10:11:28.960\r\nDEADLOCK DETECTED ( ORA-00060 )\r\n[Transaction Deadlock]\r\nThe following deadlock is not an ORACLE error. It is a\r\ndeadlock due to user error in the design of an application\r\nor from issuing incorrect ad-hoc SQL. The following\r\ninformation may aid in determining the deadlock:\r\nDeadlock graph:\r\n                       ---------Blocker(s)--------  ---------Waiter(s)---------\r\nResource Name          process session holds waits  process session holds waits\r\nTX-000c0016-000499ad        16    5562     X             16    5562           X\r\nsession 5562: DID 0001-0010-00000092\tsession 5562: DID 0001-0010-00000092\r\nRows waited on:\r\nSession 5562: obj - rowid = 00009050 - AAAJBQAAWAAArQ6AAG\r\n  (dictionary objn - 36944, file - 22, block - 177210, slot - 6)\r\nInformation on the OTHER waiting sessions:\r\nEnd of information on OTHER waiting sessions.<\/pre>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u7b49\u5f85\u7684\u548c\u6301\u6709\u9501\u7684\u662f\u540c\u4e00\u4e2a\u4f1a\u8bdd\u3002<br \/>\n\u6839\u636etrace\u4fe1\u606f\u8bb0\u5f55\u7684\u5bf9\u8c61\uff0c\u53d1\u73b0\u95ee\u9898\u662f\u81ea\u6cbb\u4e8b\u52a1\u5bfc\u81f4\u7684\u3002<br \/>\n\u5728\u4e3b\u4e8b\u52a1\u4e2d\u5982\u679c\u66f4\u65b0\u4e86\u90e8\u5206\u8bb0\u5f55\uff0c\u8fd9\u662f\u542f\u52a8\u81ea\u6cbb\u4e8b\u52a1\u66f4\u65b0\u540c\u6837\u7684\u8bb0\u5f55\uff0c\u5c31\u4f1a\u9020\u6210\u6b7b\u9501\uff0c\u4e0b\u9762\u901a\u8fc7\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u6a21\u62df\u4e86\u8fd9\u4e2a\u9519\u8bef\u7684\u4ea7\u751f\uff1a<\/p>\n<pre lang='SQL'>SQL> create table t (id number, name varchar2(30));\r\nTable created.\r\nSQL> insert into t select rownum, tname from tab;\r\n4 rows created.\r\nSQL> commit;\r\nCommit complete.\r\nSQL> create or replace procedure p_test as\r\n2 pragma autonomous_transaction;\r\n3 begin\r\n4 update t set name = name where id = 1;\r\n5 commit;\r\n6 end;\r\n7 \/\r\nProcedure created.\r\nSQL> begin\r\n2 update t set name = name where id = 1;\r\n3 p_test;\r\n4 end;\r\n5 \/\r\nbegin\r\n*\r\nERROR at line 1:\r\nORA-00060: deadlock detected while waiting for resource\r\nORA-06512: at \"TEST.P_TEST\", line 4\r\nORA-06512: at line 3<\/pre>\n<p>\u5728\u4f7f\u7528\u81ea\u6cbb\u4e8b\u52a1\u7684\u65f6\u5019\u8981\u907f\u514d\u5f53\u524d\u4e8b\u52a1\u9501\u5b9a\u7684\u8bb0\u5f55\u548c\u81ea\u6cbb\u4e8b\u52a1\u4e2d\u9501\u5b9a\u7684\u8bb0\u5f55\u76f8\u4e92\u51b2\u7a81\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5ba2\u6237\u73af\u5883\u4e2d\u51fa\u73b0\u4e86ORA-60\u6b7b\u9501\u9519\u8bef\uff0c\u68c0\u67e5\u65e5\u5fd7\u53d1\u73b0\uff0c\u6301\u6709\u9501\u548c\u7b49\u5f85\u9501\u7684\u662f\u540c\u4e00\u4e2a\u4f1a\u8bdd\u3002 \u4e00\u822c\u6765\u8bf4\u6784\u6210\u6b7b\u9501\u81f3\u5c11\u9700\u8981\u4e24\u4e2a\u4f1a\u8bdd\uff0c\u800c\u5f53\u524d\u7684\u95ee\u9898\u662f\u4e00\u4e2a\u4f1a\u8bdd\u5f15\u53d1\u7684\uff1a Wed Nov 23 10:19:46 2011 ORA-00060: Deadlock detected. More info in file \/oracle\/admin\/db1\/udump\/db1_ora_3408686.trc. \u5bf9\u5e94\u7684\u8be6\u7ec6\u4fe1\u606f\uff1a *** 2011-10-29 10:11:28.970 *** SERVICE NAME:(db1) 2011-10-29 10:11:28.960 *** SESSION ID:(5562.45) 2011-10-29 10:11:28.960 DEADLOCK DETECTED ( ORA-00060 ) [Transaction Deadlock] The following deadlock is &hellip; <a href=\"https:\/\/yangtingkun.net\/?p=323\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[237,221],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2yiY3-5d","_links":{"self":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/323"}],"collection":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=323"}],"version-history":[{"count":1,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/323\/revisions"}],"predecessor-version":[{"id":324,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/323\/revisions\/324"}],"wp:attachment":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}