{"id":741,"date":"2012-04-11T23:47:13","date_gmt":"2012-04-11T15:47:13","guid":{"rendered":"https:\/\/yangtingkun.net\/?p=741"},"modified":"2012-04-14T23:55:57","modified_gmt":"2012-04-14T15:55:57","slug":"dml_locks%e8%ae%be%e7%bd%ae%e4%b8%ba0%e5%af%bc%e8%87%b4shutdown-immediate%e5%a4%b1%e8%b4%a5","status":"publish","type":"post","link":"https:\/\/yangtingkun.net\/?p=741","title":{"rendered":"DML_LOCKS\u8bbe\u7f6e\u4e3a0\u5bfc\u81f4SHUTDOWN IMMEDIATE\u5931\u8d25"},"content":{"rendered":"<p>DML_LOCKS\u53c2\u6570\u8bbe\u7f6e\u7cfb\u7edf\u4e2d\u5141\u8bb8DML\u9501\u7684\u6570\u91cf\uff0c\u5982\u679c\u5c06\u8fd9\u4e2a\u53c2\u6570\u8bbe\u7f6e\u4e3a0\uff0c\u4f1a\u7981\u6b62ENQUEUE\u7684\u4ea7\u751f\uff0c\u6709\u53ef\u80fd\u8f7b\u5fae\u7684\u63d0\u5347\u7cfb\u7edf\u7684\u6027\u80fd\u3002<br \/>\n\u4e0d\u8fc7\u5982\u679c\u5c06\u8fd9\u4e2a\u53c2\u6570\u8bbe\u7f6e\u4e3a0\uff0c\u5e26\u6765\u7684\u540e\u679c\u4f1a\u4e25\u91cd\u5f88\u591a\uff1a<\/p>\n<pre lang='SQL'>SQL> show parameter dml_locks\r\nNAME TYPE VALUE\r\n------------------------------------ ----------- ------------------------------\r\ndml_locks integer 264\r\nSQL> alter system set dml_locks = 0 scope = spfile;\r\nSystem altered.\r\nSQL> shutdown immediate\r\nDatabase closed.\r\nDatabase dismounted.\r\nORACLE instance shut down.\r\nSQL> startup\r\nORACLE instance started.\r\nTotal System Global Area 524288000 bytes\r\nFixed Size 2097560 bytes\r\nVariable Size 150998632 bytes\r\nDatabase Buffers 369098752 bytes\r\nRedo Buffers 2093056 bytes\r\nDatabase mounted.\r\nDatabase opened.\r\nSQL> conn test\/test\r\nConnected.\r\nSQL> create table t_dml (id number);\r\nTable created.\r\nSQL> insert into t_dml values (1);\r\n1 row created.\r\nSQL> update t_dml set id = 2;\r\n1 row updated.\r\nSQL> delete t_dml;\r\n1 row deleted.\r\nSQL> commit;\r\nCommit complete.\r\nSQL> create index i_t_dml_id on t_dml(id);\r\ncreate index i_t_dml_id on t_dml(id)\r\n*\r\nERROR at line 1:\r\nORA-00062: DML full-table lock cannot be acquired; DML_LOCKS is 0\r\n\r\nSQL> truncate table t_dml;\r\ntruncate table t_dml\r\n*\r\nERROR at line 1:\r\nORA-00062: DML full-table lock cannot be acquired; DML_LOCKS is 0\r\n\r\nSQL> drop table t_dml purge;\r\ndrop table t_dml purge\r\n*\r\nERROR at line 1:\r\nORA-00062: DML full-table lock cannot be acquired; DML_LOCKS is 0<\/pre>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u5e76\u975e\u662fDML_LOCKS\u8bbe\u7f6e\u4e3a0\uff0c\u5c31\u4e0d\u80fd\u6267\u884cDML\u64cd\u4f5c\u4e86\uff0c\u4e8b\u5b9e\u4e0aDML\u4ecd\u7136\u53ef\u4ee5\u6267\u884c\u3002\u76f8\u53cd\u7531\u4e8e\u5927\u90e8\u5206\u7684DDL\u5728\u6267\u884c\u8fc7\u7a0b\u4e2d\u9700\u8981\u5bf9\u8868\u52a0\u9501\uff0c\u56e0\u6b64\u5927\u90e8\u5206DDL\u8bed\u53e5\u5728DML_LOCKS\u8bbe\u7f6e\u4e3a0\u540e\u4e0d\u80fd\u5728\u8fd0\u884c\u4e86\u3002<br \/>\n\u6536\u5f71\u54cd\u7684\u64cd\u4f5c\u4e0d\u53ea\u662fDDL\u800c\u5df2\uff0c\u8fdeSHUTDOWN IMMEDIATE\u90fd\u4e0d\u80fd\u5e78\u514d\uff1a<\/p>\n<pre lang='SQL'>SQL> conn \/ as sysdba\r\nConnected.\r\nSQL> shutdown immediate\r\nORA-00062: DML full-table lock cannot be acquired; DML_LOCKS is 0\r\nSQL> shutdown abort\r\nORACLE instance shut down.<\/pre>\n<p>\u4e5f\u5c31\u662f\u8bf4\u8bbe\u7f6eDML_LOCKS\u540e\uff0c\u53ea\u80fd\u4f7f\u7528ABORT\u65b9\u5f0f\u5173\u95ed\u6570\u636e\u5e93\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>DML_LOCKS\u53c2\u6570\u8bbe\u7f6e\u7cfb\u7edf\u4e2d\u5141\u8bb8DML\u9501\u7684\u6570\u91cf\uff0c\u5982\u679c\u5c06\u8fd9\u4e2a\u53c2\u6570\u8bbe\u7f6e\u4e3a0\uff0c\u4f1a\u7981\u6b62ENQUEUE\u7684\u4ea7\u751f\uff0c\u6709\u53ef\u80fd\u8f7b\u5fae\u7684\u63d0\u5347\u7cfb\u7edf\u7684\u6027\u80fd\u3002 \u4e0d\u8fc7\u5982\u679c\u5c06\u8fd9\u4e2a\u53c2\u6570\u8bbe\u7f6e\u4e3a0\uff0c\u5e26\u6765\u7684\u540e\u679c\u4f1a\u4e25\u91cd\u5f88\u591a\uff1a SQL> show parameter dml_locks NAME TYPE VALUE &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; dml_locks integer 264 SQL> alter system set dml_locks = 0 scope = spfile; System altered. SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup &hellip; <a href=\"https:\/\/yangtingkun.net\/?p=741\">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":[624,621,526,622,623,451,450,625],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2yiY3-bX","_links":{"self":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/741"}],"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=741"}],"version-history":[{"count":2,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/741\/revisions"}],"predecessor-version":[{"id":746,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=\/wp\/v2\/posts\/741\/revisions\/746"}],"wp:attachment":[{"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yangtingkun.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}