{"id":84993,"date":"2024-10-17T12:29:16","date_gmt":"2024-10-17T04:29:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/84993\/"},"modified":"2024-10-17T12:29:16","modified_gmt":"2024-10-17T04:29:16","slug":"ora-12700-%e7%84%a1%e6%95%88%e7%9a%84-nls-%e5%8f%83%e6%95%b8%e5%80%bc-%e5%ad%97%e7%ac%a6%e4%b8%b2%e3%80%82oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0%e7%a8%8b%e8%99%95","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/84993\/","title":{"rendered":"ORA-12700: \u7121\u6548\u7684 NLS \u53c3\u6578\u503c (\u5b57\u7b26\u4e32)\u3002ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-12700-%e7%84%a1%e6%95%88%e7%9a%84-nls-%e5%8f%83%e6%95%b8%e5%80%bc-%e5%ad%97%e7%ac%a6%e4%b8%b2-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86-TLrjyEBgQz\">ORA-12700: \u7121\u6548\u7684 NLS \u53c3\u6578\u503c (\u5b57\u7b26\u4e32) \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 Oracle \u6578\u64da\u5eab\u6642\uff0c\u958b\u767c\u8005\u548c\u7cfb\u7d71\u7ba1\u7406\u54e1\u53ef\u80fd\u6703\u9047\u5230\u5404\u7a2e\u932f\u8aa4\u4ee3\u78bc\uff0c\u5176\u4e2d\u4e4b\u4e00\u4fbf\u662f <code>ORA-12700<\/code>\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8207 NLS\uff08National Language Support\uff09\u53c3\u6578\u6709\u95dc\uff0c\u7279\u5225\u662f\u5728\u8655\u7406\u5b57\u7b26\u96c6\u548c\u8a9e\u8a00\u8a2d\u7f6e\u6642\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e <code>ORA-12700<\/code> \u932f\u8aa4\u7684\u6210\u56e0\u3001\u5f71\u97ff\u53ca\u5176\u4fee\u5fa9\u65b9\u6cd5\u3002<\/p>\n<h2 id=\"ora-12700-%e9%8c%af%e8%aa%a4%e7%9a%84%e6%88%90%e5%9b%a0-TLrjyEBgQz\">ORA-12700 \u932f\u8aa4\u7684\u6210\u56e0<\/h2>\n<p><code>ORA-12700<\/code> \u932f\u8aa4\u7684\u51fa\u73fe\u901a\u5e38\u662f\u56e0\u70ba NLS \u53c3\u6578\u7684\u8a2d\u7f6e\u4e0d\u6b63\u78ba\u3002NLS \u53c3\u6578\u7528\u65bc\u5b9a\u7fa9\u6578\u64da\u5eab\u7684\u8a9e\u8a00\u3001\u5b57\u7b26\u96c6\u548c\u5730\u5340\u8a2d\u7f6e\u3002\u7576\u9019\u4e9b\u53c3\u6578\u7684\u503c\u4e0d\u7b26\u5408 Oracle \u6578\u64da\u5eab\u7684\u8981\u6c42\u6642\uff0c\u5c31\u6703\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u6210\u56e0\uff1a<\/p>\n<ul>\n<li><strong>\u5b57\u7b26\u96c6\u4e0d\u5339\u914d\uff1a<\/strong>\u5982\u679c\u6578\u64da\u5eab\u7684\u5b57\u7b26\u96c6\u8207\u61c9\u7528\u7a0b\u5e8f\u6216\u5ba2\u6236\u7aef\u7684\u5b57\u7b26\u96c6\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u6703\u5c0e\u81f4\u6b64\u932f\u8aa4\u3002<\/li>\n<li><strong>NLS \u53c3\u6578\u8a2d\u7f6e\u932f\u8aa4\uff1a<\/strong>\u5728\u6578\u64da\u5eab\u521d\u59cb\u5316\u6642\uff0cNLS \u53c3\u6578\u7684\u8a2d\u7f6e\u4e0d\u6b63\u78ba\uff0c\u6703\u5c0e\u81f4\u7121\u6548\u7684\u5b57\u7b26\u4e32\u503c\u3002<\/li>\n<li><strong>\u74b0\u5883\u8b8a\u91cf\u554f\u984c\uff1a<\/strong>\u5982\u679c\u64cd\u4f5c\u7cfb\u7d71\u7684\u74b0\u5883\u8b8a\u91cf\u672a\u6b63\u78ba\u8a2d\u7f6e\uff0c\u53ef\u80fd\u6703\u5f71\u97ff NLS \u53c3\u6578\u7684\u8b80\u53d6\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e6%aa%a2%e6%9f%a5-nls-%e5%8f%83%e6%95%b8-TLrjyEBgQz\">\u5982\u4f55\u6aa2\u67e5 NLS \u53c3\u6578<\/h2>\n<p>\u8981\u89e3\u6c7a <code>ORA-12700<\/code> \u932f\u8aa4\uff0c\u9996\u5148\u9700\u8981\u6aa2\u67e5\u7576\u524d\u7684 NLS \u53c3\u6578\u8a2d\u7f6e\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\u4f86\u6aa2\u67e5\u7576\u524d\u7684 NLS \u53c3\u6578\uff1a<\/p>\n<pre><code>SELECT * FROM NLS_SESSION_PARAMETERS;<\/code><\/pre>\n<p>\u9019\u500b\u67e5\u8a62\u5c07\u8fd4\u56de\u7576\u524d\u6703\u8a71\u7684\u6240\u6709 NLS \u53c3\u6578\u53ca\u5176\u503c\u3002\u7279\u5225\u6ce8\u610f <code>NLS_LANGUAGE<\/code>\u3001<code>NLS_TERRITORY<\/code> \u548c <code>NLS_CHARACTERSET<\/code> \u9019\u5e7e\u500b\u53c3\u6578\u3002<\/p>\n<h2 id=\"%e4%bf%ae%e5%be%a9-ora-12700-%e9%8c%af%e8%aa%a4%e7%9a%84%e6%96%b9%e6%b3%95-TLrjyEBgQz\">\u4fee\u5fa9 ORA-12700 \u932f\u8aa4\u7684\u65b9\u6cd5<\/h2>\n<p>\u4e00\u65e6\u78ba\u5b9a\u4e86 NLS \u53c3\u6578\u7684\u554f\u984c\uff0c\u63a5\u4e0b\u4f86\u53ef\u4ee5\u63a1\u53d6\u4ee5\u4e0b\u6b65\u9a5f\u4f86\u4fee\u5fa9 <code>ORA-12700<\/code> \u932f\u8aa4\uff1a<\/p>\n<h3 id=\"1-%e4%bf%ae%e6%94%b9-nls-%e5%8f%83%e6%95%b8-TLrjyEBgQz\">1. \u4fee\u6539 NLS \u53c3\u6578<\/h3>\n<p>\u5982\u679c\u767c\u73fe NLS \u53c3\u6578\u7684\u503c\u4e0d\u6b63\u78ba\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u8a9e\u53e5\u4f86\u4fee\u6539\u5b83\u5011\uff1a<\/p>\n<pre><code>ALTER SESSION SET NLS_LANGUAGE = 'AMERICAN';<\/code><\/pre>\n<pre><code>ALTER SESSION SET NLS_TERRITORY = 'AMERICA';<\/code><\/pre>\n<pre><code>ALTER SESSION SET NLS_CHARACTERSET = 'AL32UTF8';<\/code><\/pre>\n<p>\u6839\u64da\u5be6\u969b\u9700\u8981\u8abf\u6574\u9019\u4e9b\u53c3\u6578\u7684\u503c\u3002<\/p>\n<h3 id=\"2-%e6%aa%a2%e6%9f%a5%e7%92%b0%e5%a2%83%e8%ae%8a%e9%87%8f-TLrjyEBgQz\">2. \u6aa2\u67e5\u74b0\u5883\u8b8a\u91cf<\/h3>\n<p>\u78ba\u4fdd\u64cd\u4f5c\u7cfb\u7d71\u7684\u74b0\u5883\u8b8a\u91cf\u6b63\u78ba\u8a2d\u7f6e\u3002\u53ef\u4ee5\u6aa2\u67e5 <code>NLS_LANG<\/code> \u8b8a\u91cf\uff0c\u78ba\u4fdd\u5b83\u8207\u6578\u64da\u5eab\u7684\u5b57\u7b26\u96c6\u76f8\u5339\u914d\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code>export NLS_LANG=AMERICAN_AMERICA.AL32UTF8<\/code><\/pre>\n<h3 id=\"3-%e9%87%8d%e5%95%9f%e6%95%b8%e6%93%9a%e5%ba%ab-TLrjyEBgQz\">3. \u91cd\u555f\u6578\u64da\u5eab<\/h3>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u4fee\u6539 NLS \u53c3\u6578\u5f8c\u9700\u8981\u91cd\u555f\u6578\u64da\u5eab\u624d\u80fd\u751f\u6548\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u4f86\u5b8c\u6210\uff1a<\/p>\n<pre><code>SHUTDOWN IMMEDIATE;<\/code><\/pre>\n<pre><code>STARTUP;<\/code><\/pre>\n<h2 id=\"%e7%b5%90%e8%ab%96-TLrjyEBgQz\">\u7d50\u8ad6<\/h2>\n<p>\u5728 Oracle \u6578\u64da\u5eab\u4e2d\uff0c<code>ORA-12700<\/code> \u932f\u8aa4\u901a\u5e38\u662f\u7531\u65bc NLS \u53c3\u6578\u8a2d\u7f6e\u4e0d\u7576\u5f15\u8d77\u7684\u3002\u901a\u904e\u6aa2\u67e5\u548c\u4fee\u6539 NLS \u53c3\u6578\u3001\u74b0\u5883\u8b8a\u91cf\u4ee5\u53ca\u5fc5\u8981\u6642\u91cd\u555f\u6578\u64da\u5eab\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u904b\u884c\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u53ca\u6642\u8655\u7406\u9019\u985e\u932f\u8aa4\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002<\/p>\n<p>\u5982\u9700\u9032\u4e00\u6b65\u4e86\u89e3\u5982\u4f55\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2f VPS<\/a> \u670d\u52d9\uff0c\u6216\u6709\u95dc\u6578\u64da\u5eab\u7ba1\u7406\u7684\u66f4\u591a\u8cc7\u8a0a\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-12700 \u932f\u8aa4\uff0c\u7121\u6548\u7684 NLS \u53c3\u6578\u503c\u554f\u984c\uff0c\u63d0\u4f9b Oracle \u6545\u969c\u4fee\u5fa9\u548c\u9060\u7a0b\u8655\u7406\u7684\u5c08\u696d\u6307\u5c0e\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-84993","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/84993","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=84993"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/84993\/revisions"}],"predecessor-version":[{"id":84994,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/84993\/revisions\/84994"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=84993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=84993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=84993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}