{"id":88096,"date":"2024-10-18T06:33:16","date_gmt":"2024-10-17T22:33:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/88096\/"},"modified":"2024-10-18T06:33:17","modified_gmt":"2024-10-17T22:33:17","slug":"ora-23397-%e5%85%a8%e5%b1%80%e5%90%8d%e7%a8%b1-string-%e8%88%87%e6%95%b8%e6%93%9a%e5%ba%ab%e9%8f%88%e6%8e%a5%e5%90%8d%e7%a8%b1-string-%e4%b8%8d%e5%8c%b9%e9%85%8d-o","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/88096\/","title":{"rendered":"ORA-23397: \u5168\u5c40\u540d\u7a31 \u201cstring\u201d \u8207\u6578\u64da\u5eab\u93c8\u63a5\u540d\u7a31 \u201cstring\u201d \u4e0d\u5339\u914d ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-23397-%e5%85%a8%e5%b1%80%e5%90%8d%e7%a8%b1-string-%e8%88%87%e6%95%b8%e6%93%9a%e5%ba%ab%e9%8f%88%e6%8e%a5%e5%90%8d%e7%a8%b1-string-%e4%b8%8d%e5%8c%b9%e9%85%8d-o-cneGSITVql\">ORA-23397: \u5168\u5c40\u540d\u7a31 \u201cstring\u201d \u8207\u6578\u64da\u5eab\u93c8\u63a5\u540d\u7a31 \u201cstring\u201d \u4e0d\u5339\u914d ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 Oracle \u6578\u64da\u5eab\u7684\u904e\u7a0b\u4e2d\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 ORA-23397\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u51fa\u73fe\u5728\u4f7f\u7528\u5168\u5c40\u540d\u7a31\u548c\u6578\u64da\u5eab\u93c8\u63a5\u6642\uff0c\u8868\u793a\u5b83\u5011\u4e4b\u9593\u5b58\u5728\u4e0d\u5339\u914d\u7684\u60c5\u6cc1\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u4e00\u932f\u8aa4\u7684\u6210\u56e0\u3001\u5f71\u97ff\u53ca\u5176\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n<h2 id=\"ora-23397-%e9%8c%af%e8%aa%a4%e7%9a%84%e6%88%90%e5%9b%a0-cneGSITVql\">ORA-23397 \u932f\u8aa4\u7684\u6210\u56e0<\/h2>\n<p>ORA-23397 \u932f\u8aa4\u7684\u4e3b\u8981\u539f\u56e0\u662f\u5168\u5c40\u540d\u7a31\uff08Global Name\uff09\u8207\u6578\u64da\u5eab\u93c8\u63a5\u540d\u7a31\uff08Database Link Name\uff09\u4e0d\u4e00\u81f4\u3002\u5168\u5c40\u540d\u7a31\u662f\u6307\u6578\u64da\u5eab\u7684\u5b8c\u6574\u540d\u7a31\uff0c\u5305\u62ec\u6578\u64da\u5eab\u7684\u540d\u7a31\u548c\u5176\u6240\u5728\u7684\u7db2\u7d61\u4f4d\u7f6e\uff0c\u800c\u6578\u64da\u5eab\u93c8\u63a5\u5247\u662f\u7528\u4f86\u9023\u63a5\u4e0d\u540c\u6578\u64da\u5eab\u7684\u5de5\u5177\u3002\u7576\u9019\u5169\u8005\u4e0d\u5339\u914d\u6642\uff0cOracle \u5c07\u7121\u6cd5\u6b63\u78ba\u8b58\u5225\u8981\u9023\u63a5\u7684\u6578\u64da\u5eab\uff0c\u5f9e\u800c\u5f15\u767c\u932f\u8aa4\u3002<\/p>\n<h3 id=\"%e5%b8%b8%e8%a6%8b%e6%83%85%e6%b3%81-cneGSITVql\">\u5e38\u898b\u60c5\u6cc1<\/h3>\n<ul>\n<li>\u5728\u5275\u5efa\u6578\u64da\u5eab\u93c8\u63a5\u6642\uff0c\u672a\u6b63\u78ba\u8a2d\u7f6e\u5168\u5c40\u540d\u7a31\u3002<\/li>\n<li>\u6578\u64da\u5eab\u7684\u5168\u5c40\u540d\u7a31\u5728\u4e0d\u540c\u74b0\u5883\u4e2d\u6709\u6240\u8b8a\u66f4\uff0c\u4f46\u6578\u64da\u5eab\u93c8\u63a5\u672a\u96a8\u4e4b\u66f4\u65b0\u3002<\/li>\n<li>\u5728\u9032\u884c\u6578\u64da\u5eab\u9077\u79fb\u6216\u5347\u7d1a\u6642\uff0c\u672a\u80fd\u6b63\u78ba\u914d\u7f6e\u5168\u5c40\u540d\u7a31\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e6%aa%a2%e6%9f%a5%e5%85%a8%e5%b1%80%e5%90%8d%e7%a8%b1%e5%92%8c%e6%95%b8%e6%93%9a%e5%ba%ab%e9%8f%88%e6%8e%a5-cneGSITVql\">\u5982\u4f55\u6aa2\u67e5\u5168\u5c40\u540d\u7a31\u548c\u6578\u64da\u5eab\u93c8\u63a5<\/h2>\n<p>\u8981\u89e3\u6c7a ORA-23397 \u932f\u8aa4\uff0c\u9996\u5148\u9700\u8981\u6aa2\u67e5\u5168\u5c40\u540d\u7a31\u548c\u6578\u64da\u5eab\u93c8\u63a5\u7684\u8a2d\u7f6e\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\u4f86\u6aa2\u67e5\u7576\u524d\u6578\u64da\u5eab\u7684\u5168\u5c40\u540d\u7a31\uff1a<\/p>\n<pre><code>SELECT global_name FROM global_name;<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u6aa2\u67e5\u6578\u64da\u5eab\u93c8\u63a5\u7684\u540d\u7a31\u548c\u8a2d\u7f6e\uff1a<\/p>\n<pre><code>SELECT * FROM user_db_links;<\/code><\/pre>\n<p>\u901a\u904e\u9019\u4e9b\u67e5\u8a62\uff0c\u53ef\u4ee5\u7372\u5f97\u7576\u524d\u6578\u64da\u5eab\u7684\u5168\u5c40\u540d\u7a31\u4ee5\u53ca\u6240\u6709\u6578\u64da\u5eab\u93c8\u63a5\u7684\u8a73\u7d30\u4fe1\u606f\u3002<\/p>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%ad%a5%e9%a9%9f-cneGSITVql\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u4e00\u65e6\u78ba\u5b9a\u4e86\u5168\u5c40\u540d\u7a31\u548c\u6578\u64da\u5eab\u93c8\u63a5\u4e4b\u9593\u7684\u4e0d\u5339\u914d\uff0c\u63a5\u4e0b\u4f86\u7684\u6b65\u9a5f\u662f\u9032\u884c\u4fee\u5fa9\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u4fee\u5fa9\u65b9\u6cd5\uff1a<\/p>\n<h3 id=\"1-%e6%9b%b4%e6%96%b0%e5%85%a8%e5%b1%80%e5%90%8d%e7%a8%b1-cneGSITVql\">1. \u66f4\u65b0\u5168\u5c40\u540d\u7a31<\/h3>\n<p>\u5982\u679c\u5168\u5c40\u540d\u7a31\u4e0d\u6b63\u78ba\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u66f4\u65b0\uff1a<\/p>\n<pre><code>ALTER DATABASE RENAMED GLOBAL NAME TO 'new_global_name';<\/code><\/pre>\n<h3 id=\"2-%e6%9b%b4%e6%96%b0%e6%95%b8%e6%93%9a%e5%ba%ab%e9%8f%88%e6%8e%a5-cneGSITVql\">2. \u66f4\u65b0\u6578\u64da\u5eab\u93c8\u63a5<\/h3>\n<p>\u5982\u679c\u6578\u64da\u5eab\u93c8\u63a5\u7684\u540d\u7a31\u4e0d\u6b63\u78ba\uff0c\u53ef\u4ee5\u522a\u9664\u4e26\u91cd\u65b0\u5275\u5efa\u6578\u64da\u5eab\u93c8\u63a5\uff1a<\/p>\n<pre><code>DROP DATABASE LINK link_name;<\/code><\/pre>\n<pre><code>CREATE DATABASE LINK link_name CONNECT TO user IDENTIFIED BY password USING 'new_global_name';<\/code><\/pre>\n<h3 id=\"3-%e6%b8%ac%e8%a9%a6%e9%80%a3%e6%8e%a5-cneGSITVql\">3. \u6e2c\u8a66\u9023\u63a5<\/h3>\n<p>\u5728\u9032\u884c\u4e0a\u8ff0\u66f4\u6539\u5f8c\uff0c\u61c9\u8a72\u6e2c\u8a66\u6578\u64da\u5eab\u93c8\u63a5\u662f\u5426\u6b63\u5e38\u5de5\u4f5c\uff1a<\/p>\n<pre><code>SELECT * FROM dual@link_name;<\/code><\/pre>\n<p>\u5982\u679c\u80fd\u5920\u6210\u529f\u67e5\u8a62\uff0c\u5247\u8868\u793a\u554f\u984c\u5df2\u7d93\u89e3\u6c7a\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-cneGSITVql\">\u7d50\u8ad6<\/h2>\n<p>ORA-23397 \u932f\u8aa4\u901a\u5e38\u662f\u7531\u65bc\u5168\u5c40\u540d\u7a31\u8207\u6578\u64da\u5eab\u93c8\u63a5\u540d\u7a31\u4e0d\u5339\u914d\u6240\u5f15\u8d77\u7684\u3002\u901a\u904e\u6aa2\u67e5\u548c\u66f4\u65b0\u9019\u4e9b\u8a2d\u7f6e\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\u3002\u5c0d\u65bc\u4f7f\u7528 Oracle \u6578\u64da\u5eab\u7684\u958b\u767c\u8005\u548c\u7ba1\u7406\u54e1\u4f86\u8aaa\uff0c\u4e86\u89e3\u9019\u4e9b\u57fa\u672c\u7684\u6545\u969c\u6392\u9664\u6b65\u9a5f\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002<\/p>\n<p>\u5982\u9700\u9032\u4e00\u6b65\u4e86\u89e3\u5982\u4f55\u512a\u5316\u60a8\u7684\u6578\u64da\u5eab\u74b0\u5883\uff0c\u60a8\u53ef\u4ee5\u8003\u616e\u4f7f\u7528\u6211\u5011\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\uff0c\u9019\u5c07\u70ba\u60a8\u7684\u6578\u64da\u5eab\u63d0\u4f9b\u7a69\u5b9a\u7684\u652f\u6301\u548c\u9ad8\u6548\u7684\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-23397 \u932f\u8aa4\uff0c\u4fee\u5fa9\u5168\u5c40\u540d\u7a31\u8207\u6578\u64da\u5eab\u93c8\u63a5\u4e0d\u5339\u914d\u554f\u984c\uff0c\u63d0\u4f9b\u6709\u6548\u7684\u9060\u7a0b\u8655\u7406\u65b9\u6848\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-88096","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/88096","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=88096"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/88096\/revisions"}],"predecessor-version":[{"id":88097,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/88096\/revisions\/88097"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=88096"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=88096"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=88096"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}