{"id":92672,"date":"2024-10-19T07:33:16","date_gmt":"2024-10-18T23:33:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/92672\/"},"modified":"2024-10-19T07:33:17","modified_gmt":"2024-10-18T23:33:17","slug":"ora-42001-%e5%9c%a8%e7%b7%9a%e9%87%8d%e6%96%b0%e5%ae%9a%e7%be%a9%e9%81%b8%e9%a0%85%e9%9c%80%e8%a6%81-compatible-%e5%8f%83%e6%95%b8%e7%82%ba-string-%e6%88%96%e6%9b%b4%e9%ab%98-oracle-%e5%a0%b1","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/92672\/","title":{"rendered":"ORA-42001: \u5728\u7dda\u91cd\u65b0\u5b9a\u7fa9\u9078\u9805\u9700\u8981 COMPATIBLE \u53c3\u6578\u70ba string \u6216\u66f4\u9ad8 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-42001-%e5%9c%a8%e7%b7%9a%e9%87%8d%e6%96%b0%e5%ae%9a%e7%be%a9%e9%81%b8%e9%a0%85%e9%9c%80%e8%a6%81-compatible-%e5%8f%83%e6%95%b8%e7%82%ba-string-%e6%88%96%e6%9b%b4%e9%ab%98-oracle-%e5%a0%b1-SQxXhQFjrL\">ORA-42001: \u5728\u7dda\u91cd\u65b0\u5b9a\u7fa9\u9078\u9805\u9700\u8981 COMPATIBLE \u53c3\u6578\u70ba string \u6216\u66f4\u9ad8 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 Oracle \u6578\u64da\u5eab\u6642\uff0c\u958b\u767c\u8005\u548c\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u53ef\u80fd\u6703\u9047\u5230\u5404\u7a2e\u932f\u8aa4\u4ee3\u78bc\uff0c\u5176\u4e2d\u4e4b\u4e00\u4fbf\u662f <code>ORA-42001<\/code>\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u51fa\u73fe\u5728\u5617\u8a66\u9032\u884c\u5728\u7dda\u91cd\u65b0\u5b9a\u7fa9\u64cd\u4f5c\u6642\uff0c\u4e26\u4e14\u63d0\u793a\u9700\u8981\u5c07 <code>COMPATIBLE<\/code> \u53c3\u6578\u8a2d\u7f6e\u70ba\u7279\u5b9a\u7684\u5b57\u7b26\u4e32\u6216\u66f4\u9ad8\u7248\u672c\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u500b\u932f\u8aa4\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u5982\u4f55\u9032\u884c\u6545\u969c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"ora-42001-%e9%8c%af%e8%aa%a4%e7%9a%84%e5%8e%9f%e5%9b%a0-SQxXhQFjrL\">ORA-42001 \u932f\u8aa4\u7684\u539f\u56e0<\/h2>\n<p>\u7576\u60a8\u5728 Oracle \u6578\u64da\u5eab\u4e2d\u57f7\u884c\u5728\u7dda\u91cd\u65b0\u5b9a\u7fa9\u64cd\u4f5c\u6642\uff0c\u7cfb\u7d71\u6703\u6aa2\u67e5\u7576\u524d\u7684 <code>COMPATIBLE<\/code> \u53c3\u6578\u8a2d\u7f6e\u3002\u9019\u500b\u53c3\u6578\u6c7a\u5b9a\u4e86\u6578\u64da\u5eab\u7684\u517c\u5bb9\u6027\u7d1a\u5225\uff0c\u5f71\u97ff\u8457\u6578\u64da\u5eab\u7684\u529f\u80fd\u548c\u7279\u6027\u3002\u5982\u679c <code>COMPATIBLE<\/code> \u53c3\u6578\u7684\u503c\u4f4e\u65bc\u6240\u9700\u7684\u5b57\u7b26\u4e32\uff0c\u5247\u6703\u51fa\u73fe <code>ORA-42001<\/code> \u932f\u8aa4\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u7576\u60a8\u5617\u8a66\u4f7f\u7528 <code>DBMS_REDEFINITION<\/code> \u5305\u9032\u884c\u5728\u7dda\u91cd\u65b0\u5b9a\u7fa9\u6642\uff0c\u82e5\u7576\u524d\u7684 <code>COMPATIBLE<\/code> \u53c3\u6578\u8a2d\u7f6e\u70ba <code>11.2.0<\/code>\uff0c\u800c\u60a8\u5617\u8a66\u4f7f\u7528\u7684\u529f\u80fd\u9700\u8981 <code>12.1.0<\/code> \u6216\u66f4\u9ad8\u7248\u672c\uff0c\u5247\u6703\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002<\/p>\n<h2 id=\"%e5%a6%82%e4%bd%95%e6%aa%a2%e6%9f%a5-compatible-%e5%8f%83%e6%95%b8-SQxXhQFjrL\">\u5982\u4f55\u6aa2\u67e5 COMPATIBLE \u53c3\u6578<\/h2>\n<p>\u8981\u6aa2\u67e5\u7576\u524d\u7684 <code>COMPATIBLE<\/code> \u53c3\u6578\u8a2d\u7f6e\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\uff1a<\/p>\n<pre><code>SELECT value FROM v$parameter WHERE name = 'compatible';<\/code><\/pre>\n<p>\u9019\u5c07\u8fd4\u56de\u7576\u524d\u6578\u64da\u5eab\u7684 <code>COMPATIBLE<\/code> \u53c3\u6578\u503c\u3002\u6839\u64da\u8fd4\u56de\u7684\u503c\uff0c\u60a8\u53ef\u4ee5\u6c7a\u5b9a\u662f\u5426\u9700\u8981\u9032\u884c\u66f4\u6539\u3002<\/p>\n<h2 id=\"%e4%bf%ae%e5%be%a9-ora-42001-%e9%8c%af%e8%aa%a4-SQxXhQFjrL\">\u4fee\u5fa9 ORA-42001 \u932f\u8aa4<\/h2>\n<p>\u8981\u4fee\u5fa9 <code>ORA-42001<\/code> \u932f\u8aa4\uff0c\u60a8\u9700\u8981\u5c07 <code>COMPATIBLE<\/code> \u53c3\u6578\u8a2d\u7f6e\u70ba\u6240\u9700\u7684\u503c\u3002\u9019\u901a\u5e38\u6d89\u53ca\u5230\u4ee5\u4e0b\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u4ee5\u5177\u6709\u8db3\u5920\u6b0a\u9650\u7684\u7528\u6236\u8eab\u4efd\u767b\u9304\u5230 Oracle \u6578\u64da\u5eab\u3002<\/li>\n<li>\u4f7f\u7528\u4ee5\u4e0b SQL \u8a9e\u53e5\u4f86\u4fee\u6539 <code>COMPATIBLE<\/code> \u53c3\u6578\uff1a<\/li>\n<\/ol>\n<pre><code>ALTER SYSTEM SET compatible = '12.1.0' SCOPE=SPFILE;<\/code><\/pre>\n<p>\u8acb\u6839\u64da\u60a8\u7684\u9700\u6c42\u66ff\u63db <code>'12.1.0'<\/code> \u70ba\u6240\u9700\u7684\u7248\u672c\u865f\u3002<\/p>\n<ol start=\"3\">\n<li>\u91cd\u555f\u6578\u64da\u5eab\u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002<\/li>\n<\/ol>\n<p>\u91cd\u555f\u5f8c\uff0c\u60a8\u53ef\u4ee5\u518d\u6b21\u6aa2\u67e5 <code>COMPATIBLE<\/code> \u53c3\u6578\u4ee5\u78ba\u8a8d\u66f4\u6539\u5df2\u6210\u529f\u61c9\u7528\u3002<\/p>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-SQxXhQFjrL\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<p>\u5728\u4fee\u6539 <code>COMPATIBLE<\/code> \u53c3\u6578\u4e4b\u524d\uff0c\u5efa\u8b70\u60a8\u5148\u5099\u4efd\u6578\u64da\u5eab\uff0c\u4ee5\u9632\u6b62\u610f\u5916\u60c5\u6cc1\u767c\u751f\u3002\u6b64\u5916\uff0c\u8acb\u78ba\u4fdd\u6240\u9078\u64c7\u7684\u517c\u5bb9\u6027\u7248\u672c\u4e0d\u6703\u5f71\u97ff\u5230\u73fe\u6709\u7684\u61c9\u7528\u7a0b\u5e8f\u548c\u529f\u80fd\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-SQxXhQFjrL\">\u7d50\u8ad6<\/h2>\n<p>\u5728 Oracle \u6578\u64da\u5eab\u4e2d\u9047\u5230 <code>ORA-42001<\/code> \u932f\u8aa4\u6642\uff0c\u901a\u5e38\u662f\u56e0\u70ba <code>COMPATIBLE<\/code> \u53c3\u6578\u8a2d\u7f6e\u4e0d\u7576\u3002\u901a\u904e\u6aa2\u67e5\u548c\u4fee\u6539\u8a72\u53c3\u6578\uff0c\u60a8\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\uff0c\u4e26\u7e7c\u7e8c\u9032\u884c\u5728\u7dda\u91cd\u65b0\u5b9a\u7fa9\u64cd\u4f5c\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u53ef\u7528\u6027\u548c\u7a69\u5b9a\u6027\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\u53ef\u4ee5\u63d0\u4f9b\u66f4\u597d\u7684\u652f\u6301\u548c\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-42001 \u932f\u8aa4\uff0c\u4e86\u89e3\u5728\u7dda\u91cd\u65b0\u5b9a\u7fa9\u9078\u9805\u9700 COMPATIBLE \u53c3\u6578\u8a2d\u5b9a\uff0c\u63d0\u4f9b\u6545\u969c\u4fee\u5fa9\u8207\u9060\u7a0b\u8655\u7406\u6307\u5357\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-92672","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/92672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=92672"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/92672\/revisions"}],"predecessor-version":[{"id":92673,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/92672\/revisions\/92673"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=92672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=92672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=92672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}