{"id":167037,"date":"2024-11-05T21:50:31","date_gmt":"2024-11-05T13:50:31","guid":{"rendered":"https:\/\/server.hk\/cnblog\/167037\/"},"modified":"2024-11-05T21:50:31","modified_gmt":"2024-11-05T13:50:31","slug":"%e5%88%a9%e7%94%a8mssql%e7%9a%84%e9%8f%88%e6%8e%a5%e6%9c%8d%e5%8b%99%e5%99%a8%e5%b0%87oracle%e9%8f%88%e6%8e%a5%e5%88%b0mssql%e5%af%a6%e7%8f%be%e5%90%8c%e6%ad%a5","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/167037\/","title":{"rendered":"\u5229\u7528MSSQL\u7684\u93c8\u63a5\u670d\u52d9\u5668\u5c07Oracle\u93c8\u63a5\u5230MSSQL\u5be6\u73fe\u540c\u6b65"},"content":{"rendered":"<h1 id=\"%e5%88%a9%e7%94%a8mssql%e7%9a%84%e9%8f%88%e6%8e%a5%e6%9c%8d%e5%8b%99%e5%99%a8%e5%b0%87oracle%e9%8f%88%e6%8e%a5%e5%88%b0mssql%e5%af%a6%e7%8f%be%e5%90%8c%e6%ad%a5-hpLamTYfky\">\u5229\u7528MSSQL\u7684\u93c8\u63a5\u670d\u52d9\u5668\u5c07Oracle\u93c8\u63a5\u5230MSSQL\u5be6\u73fe\u540c\u6b65<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u5546\u696d\u74b0\u5883\u4e2d\uff0c\u6578\u64da\u7684\u6574\u5408\u548c\u540c\u6b65\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u91cd\u8981\u3002\u8a31\u591a\u4f01\u696d\u540c\u6642\u4f7f\u7528\u591a\u7a2e\u6578\u64da\u5eab\u7cfb\u7d71\uff0c\u5176\u4e2d Microsoft SQL Server (MSSQL) \u548c Oracle \u662f\u6700\u5e38\u898b\u7684\u5169\u7a2e\u3002\u70ba\u4e86\u5be6\u73fe\u9019\u5169\u8005\u4e4b\u9593\u7684\u6578\u64da\u540c\u6b65\uff0cMSSQL \u63d0\u4f9b\u4e86\u4e00\u500b\u5f37\u5927\u7684\u529f\u80fd\u2014\u2014\u93c8\u63a5\u670d\u52d9\u5668\u3002\u672c\u6587\u5c07\u63a2\u8a0e\u5982\u4f55\u5229\u7528 MSSQL \u7684\u93c8\u63a5\u670d\u52d9\u5668\u5c07 Oracle \u6578\u64da\u5eab\u9023\u63a5\u5230 MSSQL\uff0c\u4e26\u5be6\u73fe\u6578\u64da\u7684\u540c\u6b65\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af%e9%8f%88%e6%8e%a5%e6%9c%8d%e5%8b%99%e5%99%a8%ef%bc%9f-hpLamTYfky\">\u4ec0\u9ebc\u662f\u93c8\u63a5\u670d\u52d9\u5668\uff1f<\/h2>\n<p>\u93c8\u63a5\u670d\u52d9\u5668\u662f\u4e00\u7a2e\u5141\u8a31 SQL Server \u9023\u63a5\u5230\u5176\u4ed6\u6578\u64da\u6e90\u7684\u529f\u80fd\u3002\u9019\u4e9b\u6578\u64da\u6e90\u53ef\u4ee5\u662f\u5176\u4ed6 SQL Server \u5be6\u4f8b\u3001Oracle \u6578\u64da\u5eab\u3001MySQL\u3001\u751a\u81f3\u662f Excel \u6587\u4ef6\u3002\u901a\u904e\u93c8\u63a5\u670d\u52d9\u5668\uff0c\u4f7f\u7528\u8005\u53ef\u4ee5\u5728\u4e00\u500b\u67e5\u8a62\u4e2d\u540c\u6642\u8a2a\u554f\u591a\u500b\u6578\u64da\u5eab\uff0c\u9019\u5c0d\u65bc\u6578\u64da\u6574\u5408\u548c\u5831\u544a\u975e\u5e38\u6709\u7528\u3002<\/p>\n<h2 id=\"%e8%a8%ad%e7%bd%ae%e9%8f%88%e6%8e%a5%e6%9c%8d%e5%8b%99%e5%99%a8%e7%9a%84%e6%ad%a5%e9%a9%9f-hpLamTYfky\">\u8a2d\u7f6e\u93c8\u63a5\u670d\u52d9\u5668\u7684\u6b65\u9a5f<\/h2>\n<p>\u4ee5\u4e0b\u662f\u5c07 Oracle \u6578\u64da\u5eab\u9023\u63a5\u5230 MSSQL \u7684\u57fa\u672c\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e5%ae%89%e8%a3%9d-oracle-%e5%ae%a2%e6%88%b6%e7%ab%af-hpLamTYfky\">1. \u5b89\u88dd Oracle \u5ba2\u6236\u7aef<\/h3>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5728 MSSQL \u4f3a\u670d\u5668\u4e0a\u5b89\u88dd Oracle \u5ba2\u6236\u7aef\u3002\u9019\u662f\u56e0\u70ba MSSQL \u9700\u8981 Oracle \u5ba2\u6236\u7aef\u4f86\u8207 Oracle \u6578\u64da\u5eab\u9032\u884c\u901a\u4fe1\u3002\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u78ba\u4fdd Oracle \u5ba2\u6236\u7aef\u7684\u74b0\u5883\u8b8a\u91cf\u5df2\u6b63\u78ba\u8a2d\u7f6e\u3002<\/p>\n<h3 id=\"2-%e5%89%b5%e5%bb%ba%e9%8f%88%e6%8e%a5%e6%9c%8d%e5%8b%99%e5%99%a8-hpLamTYfky\">2. \u5275\u5efa\u93c8\u63a5\u670d\u52d9\u5668<\/h3>\n<p>\u5728 SQL Server Management Studio (SSMS) \u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u5275\u5efa\u93c8\u63a5\u670d\u52d9\u5668\uff1a<\/p>\n<ol>\n<li>\u6253\u958b SSMS\uff0c\u9023\u63a5\u5230\u60a8\u7684 SQL Server \u5be6\u4f8b\u3002<\/li>\n<li>\u5728\u201c\u5c0d\u8c61\u8cc7\u6e90\u7ba1\u7406\u5668\u201d\u4e2d\uff0c\u53f3\u9375\u55ae\u64ca\u201c\u93c8\u63a5\u670d\u52d9\u5668\u201d\uff0c\u9078\u64c7\u201c\u65b0\u5efa\u93c8\u63a5\u670d\u52d9\u5668\u201d\u3002<\/li>\n<li>\u5728\u201c\u5e38\u898f\u201d\u9078\u9805\u5361\u4e2d\uff0c\u8f38\u5165\u93c8\u63a5\u670d\u52d9\u5668\u7684\u540d\u7a31\u3002<\/li>\n<li>\u5728\u201c\u4f3a\u670d\u5668\u985e\u578b\u201d\u4e2d\uff0c\u9078\u64c7\u201c\u5176\u4ed6\u6578\u64da\u6e90\u201d\uff0c\u7136\u5f8c\u9078\u64c7\u201cOracle OLE DB Provider\u201d\u3002<\/li>\n<li>\u5728\u201c\u9023\u63a5\u201d\u9078\u9805\u5361\u4e2d\uff0c\u8f38\u5165 Oracle \u6578\u64da\u5eab\u7684\u9023\u63a5\u4fe1\u606f\uff0c\u5305\u62ec\u6578\u64da\u6e90\u3001\u7528\u6236\u540d\u548c\u5bc6\u78bc\u3002<\/li>\n<\/ol>\n<h3 id=\"3-%e6%b8%ac%e8%a9%a6%e9%8f%88%e6%8e%a5%e6%9c%8d%e5%8b%99%e5%99%a8-hpLamTYfky\">3. \u6e2c\u8a66\u93c8\u63a5\u670d\u52d9\u5668<\/h3>\n<p>\u5275\u5efa\u93c8\u63a5\u670d\u52d9\u5668\u5f8c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\u4f86\u6e2c\u8a66\u9023\u63a5\uff1a<\/p>\n<pre><code>SELECT * FROM OPENQUERY(OracleLinkedServer, 'SELECT * FROM OracleTable');<\/code><\/pre>\n<p>\u5982\u679c\u67e5\u8a62\u6210\u529f\u8fd4\u56de\u6578\u64da\uff0c\u5247\u8868\u793a\u93c8\u63a5\u670d\u52d9\u5668\u5df2\u6b63\u78ba\u8a2d\u7f6e\u3002<\/p>\n<h2 id=\"%e6%95%b8%e6%93%9a%e5%90%8c%e6%ad%a5%e7%9a%84%e5%af%a6%e7%8f%be-hpLamTYfky\">\u6578\u64da\u540c\u6b65\u7684\u5be6\u73fe<\/h2>\n<p>\u4e00\u65e6\u93c8\u63a5\u670d\u52d9\u5668\u8a2d\u7f6e\u5b8c\u6210\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 SQL Server \u7684\u5404\u7a2e\u529f\u80fd\u4f86\u5be6\u73fe\u6578\u64da\u540c\u6b65\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u65b9\u6cd5\uff1a<\/p>\n<h3 id=\"1-%e4%bd%bf%e7%94%a8-insert-into-%e8%aa%9e%e5%8f%a5-hpLamTYfky\">1. \u4f7f\u7528 INSERT INTO \u8a9e\u53e5<\/h3>\n<p>\u60a8\u53ef\u4ee5\u4f7f\u7528 INSERT INTO \u8a9e\u53e5\u5c07 Oracle \u6578\u64da\u63d2\u5165\u5230 MSSQL \u4e2d\uff1a<\/p>\n<pre><code>INSERT INTO LocalTable (Column1, Column2)\nSELECT Column1, Column2 FROM OPENQUERY(OracleLinkedServer, 'SELECT Column1, Column2 FROM OracleTable');<\/code><\/pre>\n<h3 id=\"2-%e4%bd%bf%e7%94%a8-sql-server-agent-hpLamTYfky\">2. \u4f7f\u7528 SQL Server Agent<\/h3>\n<p>\u5982\u679c\u9700\u8981\u5b9a\u671f\u540c\u6b65\u6578\u64da\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528 SQL Server Agent \u5275\u5efa\u5b9a\u6642\u4efb\u52d9\u3002\u9019\u6a23\u53ef\u4ee5\u81ea\u52d5\u57f7\u884c\u6578\u64da\u540c\u6b65\u64cd\u4f5c\uff0c\u6e1b\u5c11\u4eba\u5de5\u5e72\u9810\u3002<\/p>\n<h3 id=\"3-%e4%bd%bf%e7%94%a8%e8%a7%b8%e7%99%bc%e5%99%a8-hpLamTYfky\">3. \u4f7f\u7528\u89f8\u767c\u5668<\/h3>\n<p>\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u60a8\u53ef\u80fd\u5e0c\u671b\u5728 MSSQL \u4e2d\u7684\u6578\u64da\u8b8a\u66f4\u6642\u81ea\u52d5\u5c07\u6578\u64da\u540c\u6b65\u5230 Oracle\u3002\u9019\u53ef\u4ee5\u901a\u904e\u5275\u5efa\u89f8\u767c\u5668\u4f86\u5be6\u73fe\uff0c\u7576\u7279\u5b9a\u8868\u4e2d\u7684\u6578\u64da\u88ab\u63d2\u5165\u3001\u66f4\u65b0\u6216\u522a\u9664\u6642\uff0c\u81ea\u52d5\u57f7\u884c\u76f8\u61c9\u7684\u540c\u6b65\u64cd\u4f5c\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-hpLamTYfky\">\u7e3d\u7d50<\/h2>\n<p>\u901a\u904e\u5229\u7528 MSSQL \u7684\u93c8\u63a5\u670d\u52d9\u5668\u529f\u80fd\uff0c\u4f01\u696d\u53ef\u4ee5\u8f15\u9b06\u5730\u5c07 Oracle \u6578\u64da\u5eab\u9023\u63a5\u5230 MSSQL\uff0c\u4e26\u5be6\u73fe\u6578\u64da\u7684\u540c\u6b65\u3002\u9019\u4e0d\u50c5\u63d0\u9ad8\u4e86\u6578\u64da\u7684\u53ef\u7528\u6027\uff0c\u9084\u80fd\u5920\u652f\u6301\u66f4\u8907\u96dc\u7684\u6578\u64da\u5206\u6790\u548c\u5831\u544a\u9700\u6c42\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u6578\u64da\u7ba1\u7406\u7684\u4f01\u696d\u4f86\u8aaa\uff0c\u9019\u662f\u4e00\u500b\u975e\u5e38\u6709\u50f9\u503c\u7684\u89e3\u6c7a\u65b9\u6848\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u53ef\u9760\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\u4f86\u652f\u6301\u60a8\u7684\u6578\u64da\u5eab\u64cd\u4f5c\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\u4ee5\u6eff\u8db3\u60a8\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528MSSQL\u7684\u93c8\u63a5\u670d\u52d9\u5668\u5c07Oracle\u6578\u64da\u5eab\u9023\u63a5\u5230MSSQL\uff0c\u5be6\u73fe\u9ad8\u6548\u6578\u64da\u540c\u6b65\u8207\u7ba1\u7406\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-167037","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/167037","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=167037"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/167037\/revisions"}],"predecessor-version":[{"id":167038,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/167037\/revisions\/167038"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=167037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=167037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=167037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}