{"id":5342,"date":"2024-11-14T08:16:05","date_gmt":"2024-11-14T00:16:05","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5342\/"},"modified":"2024-11-14T08:16:05","modified_gmt":"2024-11-14T00:16:05","slug":"oracle%e6%80%8e%e4%b9%88%e9%85%8d%e7%bd%ae%e8%bf%9c%e7%a8%8b%e8%bf%9e%e6%8e%a5","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5342\/","title":{"rendered":"oracle\u600e\u4e48\u914d\u7f6e\u8fdc\u7a0b\u8fde\u63a5"},"content":{"rendered":"<blockquote><p>\n  oracle \u8fdc\u7a0b\u8fde\u63a5\u914d\u7f6e\u6b65\u9aa4\uff1a\u542f\u7528\u8fdc\u7a0b\u8fde\u63a5\u5e76\u91cd\u542f\u6570\u636e\u5e93\u3002\u521b\u5efa\u6570\u636e\u5e93\u94fe\u63a5\uff0c\u6307\u5b9a\u8fdc\u7a0b\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u6388\u4e88\u8fdc\u7a0b\u7528\u6237\u5bf9\u6240\u9700\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u8bbf\u95ee\u6743\u9650\u3002\u4f7f\u7528\u521b\u5efa\u7684\u6570\u636e\u5e93\u94fe\u63a5\u6d4b\u8bd5\u8fdc\u7a0b\u8fde\u63a5\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/26\/2024052619542080430.jpg\" class=\"aligncenter\" title=\"oracle\u600e\u4e48\u914d\u7f6e\u8fdc\u7a0b\u8fde\u63a5\u63d2\u56fe\" alt=\"oracle\u600e\u4e48\u914d\u7f6e\u8fdc\u7a0b\u8fde\u63a5\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u914d\u7f6e Oracle \u8fdc\u7a0b\u8fde\u63a5<\/strong><\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u542f\u7528\u8fdc\u7a0b\u8fde\u63a5<\/strong><\/p>\n<ul>\n<li>\u5728 Oracle \u6570\u636e\u5e93\u670d\u52a1\u5668\u4e2d\uff0c\u4ee5 SYSDBA \u7528\u6237\u8eab\u4efd\u8fde\u63a5\u3002<\/li>\n<li>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>ALTER SYSTEM SET remote_login_passwordfile=NONE scope=spfile;\nALTER SYSTEM SET remote_login_passwordfile=NONE;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ul>\n<li>\u91cd\u65b0\u542f\u52a8\u6570\u636e\u5e93\uff1a<\/li>\n<\/ul>\n<pre>SHUTDOWN IMMEDIATE;\nSTARTUP;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u521b\u5efa\u6570\u636e\u5e93\u94fe\u63a5<\/strong><\/p>\n<ul>\n<li>\u5148\u5728\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8fdc\u7a0b\u7528\u6237\u3002<\/li>\n<li>\u5728\u8981\u8fdc\u7a0b\u8fde\u63a5\u7684\u6570\u636e\u5e93\u4e2d\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>CREATE DATABASE LINK dblink_name\nCONNECT TO remote_user IDENTIFIED BY remote_password\nUSING 'tns_alias_or_connect_string';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>dblink_name \u662f\u6570\u636e\u5e93\u94fe\u63a5\u7684\u540d\u79f0\u3002<\/li>\n<li>remote_user \u662f\u8fdc\u7a0b\u6570\u636e\u5e93\u4e2d\u7684\u7528\u6237\u3002<\/li>\n<li>remote_password \u662f\u8fdc\u7a0b\u6570\u636e\u5e93\u7528\u6237\u7684\u5bc6\u7801\u3002<\/li>\n<li>tns_alias_or_connect_string \u662f\u6307\u5411\u8fdc\u7a0b\u6570\u636e\u5e93\u7684 TNS \u522b\u540d\u6216\u8fde\u63a5\u5b57\u7b26\u4e32\u3002<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4 3\uff1a\u6388\u4e88\u8fdc\u7a0b\u8bbf\u95ee\u6743\u9650<\/strong><\/p>\n<ul>\n<li>\u6839\u636e\u9700\u8981\uff0c\u5411\u8fdc\u7a0b\u7528\u6237\u6388\u4e88\u5bf9\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u8bbf\u95ee\u6743\u9650\u3002<\/li>\n<li>\u5728\u8fdc\u7a0b\u6570\u636e\u5e93\u4e2d\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>GRANT SELECT ON table_name TO remote_user;\nGRANT EXECUTE ON procedure_name TO remote_user;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>\u6b65\u9aa4 4\uff1a\u6d4b\u8bd5\u8fdc\u7a0b\u8fde\u63a5<\/strong><\/p>\n<ul>\n<li>\u4f7f\u7528\u521b\u5efa\u7684\u6570\u636e\u5e93\u94fe\u63a5\uff0c\u8fde\u63a5\u5230\u8fdc\u7a0b\u6570\u636e\u5e93\u3002<\/li>\n<li>\u5728\u672c\u5730\u6570\u636e\u5e93\u4e2d\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/li>\n<\/ul>\n<pre>SELECT * FROM table_name@dblink_name;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u67e5\u8be2\u6210\u529f\u6267\u884c\uff0c\u5219\u8868\u660e\u8fdc\u7a0b\u8fde\u63a5\u5df2\u6210\u529f\u914d\u7f6e\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u914d\u7f6e\u8fdc\u7a0b\u8fde\u63a5\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 \u8fdc\u7a0b\u8fde\u63a5\u914d\u7f6e\u6b65\u9aa4\uff1a\u542f\u7528\u8fdc\u7a0b\u8fde\u63a5\u5e76\u91cd\u542f\u6570\u636e\u5e93\u3002\u521b\u5efa\u6570\u636e\u5e93\u94fe\u63a5\uff0c\u6307\u5b9a\u8fdc\u7a0b\u7528\u6237\u540d\u3001\u5bc6\u7801\u548c\u8fde\u63a5\u5b57\u7b26\u4e32\u3002\u6388\u4e88\u8fdc\u7a0b\u7528\u6237\u5bf9\u6240\u9700\u6570\u636e\u5e93\u5bf9\u8c61\u7684\u8bbf\u95ee\u6743\u9650\u3002\u4f7f\u7528\u521b\u5efa\u7684\u6570\u636e\u5e93\u94fe\u63a5\u6d4b\u8bd5\u8fdc\u7a0b\u8fde\u63a5\u3002 \u5982\u4f55\u914d\u7f6e Oracle \u8fdc\u7a0b\u8fde\u63a5 \u6b65\u9aa4 1\uff1a\u542f\u7528\u8fdc\u7a0b\u8fde\u63a5 \u5728 Oracle \u6570\u636e\u5e93\u670d\u52a1\u5668\u4e2d\uff0c\u4ee5 SYSDBA \u7528\u6237\u8eab\u4efd\u8fde\u63a5\u3002 \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a ALTER SYSTEM SET remote_login_passwordfile=NONE scope=spfile; ALTER SYSTEM SET remote_login_passwordfile=NONE; \u767b\u5f55\u540e\u590d\u5236 \u91cd\u65b0\u542f\u52a8\u6570\u636e\u5e93\uff1a SHUTDOWN IMMEDIATE; STARTUP; \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa4 2\uff1a\u521b\u5efa\u6570\u636e\u5e93\u94fe\u63a5 \u5148\u5728\u8981\u8fde\u63a5\u7684\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u4e00\u4e2a\u8fdc\u7a0b\u7528\u6237\u3002 \u5728\u8981\u8fdc\u7a0b\u8fde\u63a5\u7684\u6570\u636e\u5e93\u4e2d\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a CREATE DATABASE LINK dblink_name CONNECT TO remote_user IDENTIFIED BY remote_password USING &#8216;tns_alias_or_connect_string&#8217;; \u767b\u5f55\u540e\u590d\u5236 \u5176\u4e2d\uff1a dblink_name \u662f\u6570\u636e\u5e93\u94fe\u63a5\u7684\u540d\u79f0\u3002 remote_user \u662f\u8fdc\u7a0b\u6570\u636e\u5e93\u4e2d\u7684\u7528\u6237\u3002 remote_password \u662f\u8fdc\u7a0b\u6570\u636e\u5e93\u7528\u6237\u7684\u5bc6\u7801\u3002 tns_alias_or_connect_string \u662f\u6307\u5411\u8fdc\u7a0b\u6570\u636e\u5e93\u7684 TNS [&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-5342","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5342","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=5342"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5342\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}