{"id":6071,"date":"2024-11-14T13:57:35","date_gmt":"2024-11-14T05:57:35","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6071\/"},"modified":"2024-11-14T13:57:35","modified_gmt":"2024-11-14T05:57:35","slug":"oracle%e5%a6%82%e4%bd%95%e5%bc%80%e5%90%afdblink","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6071\/","title":{"rendered":"oracle\u5982\u4f55\u5f00\u542fdblink"},"content":{"rendered":"<blockquote><p>\n  oracle \u4e2d\u5f00\u542f db link \u7684\u6b65\u9aa4\uff1a\u521b\u5efa db link\uff0c\u6307\u5b9a\u8fde\u63a5\u4fe1\u606f\u3002\u6388\u4e88\u672c\u5730\u6570\u636e\u5e93\u7528\u6237\u8fdc\u7a0b\u6570\u636e\u5e93\u5bf9\u8c61\u6743\u9650\u3002\u6d4b\u8bd5 db link \u4ee5\u9a8c\u8bc1\u8fde\u63a5\u662f\u5426\u6210\u529f\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/12\/2024061221061613156.jpg\" class=\"aligncenter\" title=\"oracle\u5982\u4f55\u5f00\u542fdblink\u63d2\u56fe\" alt=\"oracle\u5982\u4f55\u5f00\u542fdblink\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u5728 Oracle \u4e2d\u5f00\u542f DB Link<\/strong><\/p>\n<p>DB Link \u662f Oracle \u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u7279\u6027\uff0c\u5b83\u5141\u8bb8\u4e00\u4e2a\u6570\u636e\u5e93\u8bbf\u95ee\u53e6\u4e00\u4e2a\u6570\u636e\u5e93\u4e2d\u7684\u5bf9\u8c61\u3002\u5f00\u542f DB Link \u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<p><strong>1. \u521b\u5efa DB Link<\/strong><\/p>\n<pre>CREATE DATABASE LINK &lt;link_name&gt; CONNECT TO &lt;user&gt; IDENTIFIED BY &lt;password&gt;\nUSING '&lt;net_service_name&gt;';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li> \u662f DB Link \u7684\u540d\u79f0\u3002 <\/li>\n<li> \u662f\u8fde\u63a5\u5230\u8fdc\u7a0b\u6570\u636e\u5e93\u7684\u7528\u6237\u540d\u3002 <\/li>\n<li> \u662f\u8fde\u63a5\u5230\u8fdc\u7a0b\u6570\u636e\u5e93\u7684\u5bc6\u7801\u3002 <\/li>\n<li> \u662f\u8fdc\u7a0b\u6570\u636e\u5e93\u7684 Net \u670d\u52a1\u540d\u3002 <\/li>\n<\/ul>\n<p><strong>2. \u5728\u672c\u5730\u6570\u636e\u5e93\u4e2d\u6388\u4e88\u6743\u9650<\/strong><\/p>\n<p>\u8fdc\u7a0b\u6570\u636e\u5e93\u4e2d\u7684\u5bf9\u8c61\uff08\u5982\u8868\u3001\u89c6\u56fe\u548c\u8fc7\u7a0b\uff09\u5fc5\u987b\u6388\u4e88\u7ed9\u672c\u5730\u6570\u636e\u5e93\u7528\u6237\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u8bed\u53e5\u6765\u5b9e\u73b0\uff1a<\/p>\n<pre>GRANT SELECT ON &lt;remote_table&gt; TO &lt;local_user&gt;;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li> \u662f\u8fdc\u7a0b\u6570\u636e\u5e93\u4e2d\u7684\u8868\u540d\u3002 <\/li>\n<li> \u662f\u672c\u5730\u6570\u636e\u5e93\u4e2d\u7684\u7528\u6237\u3002 <\/li>\n<\/ul>\n<p><strong>3. \u6d4b\u8bd5 DB Link<\/strong><\/p>\n<p>\u521b\u5efa\u5e76\u6388\u4e88\u6743\u9650\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u8bed\u53e5\u6d4b\u8bd5 DB Link\uff1a<\/p>\n<pre>SELECT * FROM &lt;link_name&gt;.&lt;remote_table&gt;;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u67e5\u8be2\u6210\u529f\uff0c\u5219\u8bf4\u660e DB Link \u5df2\u6210\u529f\u5f00\u542f\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5f00\u542fdblink\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>oracle \u4e2d\u5f00\u542f db link \u7684\u6b65\u9aa4\uff1a\u521b\u5efa db link\uff0c\u6307\u5b9a\u8fde\u63a5\u4fe1\u606f\u3002\u6388\u4e88\u672c\u5730\u6570\u636e\u5e93\u7528\u6237\u8fdc\u7a0b\u6570\u636e\u5e93\u5bf9\u8c61\u6743\u9650\u3002\u6d4b\u8bd5 db link \u4ee5\u9a8c\u8bc1\u8fde\u63a5\u662f\u5426\u6210\u529f\u3002 \u5982\u4f55\u5728 Oracle \u4e2d\u5f00\u542f DB Link DB Link \u662f Oracle \u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u7279\u6027\uff0c\u5b83\u5141\u8bb8\u4e00\u4e2a\u6570\u636e\u5e93\u8bbf\u95ee\u53e6\u4e00\u4e2a\u6570\u636e\u5e93\u4e2d\u7684\u5bf9\u8c61\u3002\u5f00\u542f DB Link \u7684\u6b65\u9aa4\u5982\u4e0b\uff1a 1. \u521b\u5efa DB Link CREATE DATABASE LINK &lt;link_name&gt; CONNECT TO &lt;user&gt; IDENTIFIED BY &lt;password&gt; USING &#8216;&lt;net_service_name&gt;&#8217;; \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff1a \u662f DB Link \u7684\u540d\u79f0\u3002 \u662f\u8fde\u63a5\u5230\u8fdc\u7a0b\u6570\u636e\u5e93\u7684\u7528\u6237\u540d\u3002 \u662f\u8fde\u63a5\u5230\u8fdc\u7a0b\u6570\u636e\u5e93\u7684\u5bc6\u7801\u3002 \u662f\u8fdc\u7a0b\u6570\u636e\u5e93\u7684 Net \u670d\u52a1\u540d\u3002 2. \u5728\u672c\u5730\u6570\u636e\u5e93\u4e2d\u6388\u4e88\u6743\u9650 \u8fdc\u7a0b\u6570\u636e\u5e93\u4e2d\u7684\u5bf9\u8c61\uff08\u5982\u8868\u3001\u89c6\u56fe\u548c\u8fc7\u7a0b\uff09\u5fc5\u987b\u6388\u4e88\u7ed9\u672c\u5730\u6570\u636e\u5e93\u7528\u6237\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u8bed\u53e5\u6765\u5b9e\u73b0\uff1a GRANT SELECT [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6071","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6071"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6071\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}