{"id":151575,"date":"2024-11-01T17:44:40","date_gmt":"2024-11-01T09:44:40","guid":{"rendered":"https:\/\/server.hk\/cnblog\/151575\/"},"modified":"2024-11-01T17:44:41","modified_gmt":"2024-11-01T09:44:41","slug":"%e5%b9%ab%e5%8a%a9%e5%af%a6%e7%8f%be%e6%95%b8%e6%93%9a%e5%ae%8c%e6%95%b4%e6%80%a7%e7%9a%84%e5%85%ad%e5%80%8b%e6%95%b8%e6%93%9a%e5%ba%ab%e9%81%b7%e7%a7%bb%e5%b7%a5%e5%85%b7","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/151575\/","title":{"rendered":"\u5e6b\u52a9\u5be6\u73fe\u6578\u64da\u5b8c\u6574\u6027\u7684\u516d\u500b\u6578\u64da\u5eab\u9077\u79fb\u5de5\u5177"},"content":{"rendered":"<h1 id=\"%e5%b9%ab%e5%8a%a9%e5%af%a6%e7%8f%be%e6%95%b8%e6%93%9a%e5%ae%8c%e6%95%b4%e6%80%a7%e7%9a%84%e5%85%ad%e5%80%8b%e6%95%b8%e6%93%9a%e5%ba%ab%e9%81%b7%e7%a7%bb%e5%b7%a5%e5%85%b7-rbDgEXXCwS\">\u5e6b\u52a9\u5be6\u73fe\u6578\u64da\u5b8c\u6574\u6027\u7684\u516d\u500b\u6578\u64da\u5eab\u9077\u79fb\u5de5\u5177<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u9077\u79fb\u662f\u4e00\u500b\u4e0d\u53ef\u907f\u514d\u7684\u904e\u7a0b\u3002\u7121\u8ad6\u662f\u56e0\u70ba\u696d\u52d9\u64f4\u5c55\u3001\u6280\u8853\u5347\u7d1a\u9084\u662f\u6210\u672c\u8003\u91cf\uff0c\u6578\u64da\u5eab\u9077\u79fb\u90fd\u9700\u8981\u8b39\u614e\u9032\u884c\uff0c\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u53ef\u7528\u6027\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u516d\u500b\u5e6b\u52a9\u5be6\u73fe\u6578\u64da\u5b8c\u6574\u6027\u7684\u6578\u64da\u5eab\u9077\u79fb\u5de5\u5177\uff0c\u9019\u4e9b\u5de5\u5177\u80fd\u5920\u6709\u6548\u5730\u652f\u6301\u6578\u64da\u7684\u8f49\u79fb\u904e\u7a0b\uff0c\u4e26\u6e1b\u5c11\u6f5b\u5728\u7684\u98a8\u96aa\u3002<\/p>\n<h2 id=\"1-aws-database-migration-service-rbDgEXXCwS\">1. AWS Database Migration Service<\/h2>\n<p>AWS Database Migration Service\uff08DMS\uff09\u662f\u4e00\u500b\u5f37\u5927\u7684\u5de5\u5177\uff0c\u80fd\u5920\u5e6b\u52a9\u7528\u6236\u5c07\u6578\u64da\u5eab\u9077\u79fb\u5230Amazon Web Services\uff08AWS\uff09\u96f2\u7aef\u3002DMS\u652f\u6301\u591a\u7a2e\u6578\u64da\u5eab\uff0c\u5305\u62ecMySQL\u3001PostgreSQL\u3001Oracle\u7b49\u3002\u5b83\u7684\u512a\u52e2\u5728\u65bc\u80fd\u5920\u5728\u9077\u79fb\u904e\u7a0b\u4e2d\u6301\u7e8c\u540c\u6b65\u6578\u64da\uff0c\u78ba\u4fdd\u6e90\u6578\u64da\u5eab\u548c\u76ee\u6a19\u6578\u64da\u5eab\u4e4b\u9593\u7684\u4e00\u81f4\u6027\u3002<\/p>\n<h3 id=\"%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b%ef%bc%9a-rbDgEXXCwS\">\u4f7f\u7528\u793a\u4f8b\uff1a<\/h3>\n<pre><code>aws dms create-replication-task --replication-task-identifier my-task --source-endpoint-arn source-endpoint-arn --target-endpoint-arn target-endpoint-arn --migration-type full-load --table-mappings file:\/\/mapping.json<\/code><\/pre>\n<h2 id=\"2-microsoft-sql-server-migration-assistant-rbDgEXXCwS\">2. Microsoft SQL Server Migration Assistant<\/h2>\n<p>Microsoft SQL Server Migration Assistant\uff08SSMA\uff09\u5c08\u70ba\u5f9e\u5176\u4ed6\u6578\u64da\u5eab\u5e73\u53f0\u9077\u79fb\u5230SQL Server\u800c\u8a2d\u8a08\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u500b\u76f4\u89c0\u7684\u754c\u9762\uff0c\u5e6b\u52a9\u7528\u6236\u8f15\u9b06\u5730\u9032\u884c\u6578\u64da\u9077\u79fb\uff0c\u4e26\u5728\u904e\u7a0b\u4e2d\u6aa2\u67e5\u6578\u64da\u5b8c\u6574\u6027\u3002SSMA\u652f\u6301\u591a\u7a2e\u6578\u64da\u5eab\uff0c\u5305\u62ecOracle\u3001MySQL\u548cAccess\u3002<\/p>\n<h3 id=\"%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b%ef%bc%9a-rbDgEXXCwS\">\u4f7f\u7528\u793a\u4f8b\uff1a<\/h3>\n<p>\u7528\u6236\u53ef\u4ee5\u901a\u904eSSMA\u7684\u5411\u5c0e\u9078\u64c7\u6e90\u6578\u64da\u5eab\uff0c\u7136\u5f8c\u9078\u64c7\u8981\u9077\u79fb\u7684\u8868\u548c\u6578\u64da\uff0c\u6700\u5f8c\u751f\u6210\u9077\u79fb\u5831\u544a\u4ee5\u6aa2\u67e5\u6578\u64da\u5b8c\u6574\u6027\u3002<\/p>\n<h2 id=\"3-talend-open-studio-rbDgEXXCwS\">3. Talend Open Studio<\/h2>\n<p>Talend Open Studio\u662f\u4e00\u500b\u958b\u6e90\u7684\u6578\u64da\u96c6\u6210\u5de5\u5177\uff0c\u652f\u6301\u6578\u64da\u5eab\u9077\u79fb\u548c\u6578\u64da\u8f49\u63db\u3002\u5b83\u63d0\u4f9b\u4e86\u8c50\u5bcc\u7684\u9023\u63a5\u5668\uff0c\u80fd\u5920\u9023\u63a5\u591a\u7a2e\u6578\u64da\u6e90\u548c\u76ee\u6a19\u3002Talend\u7684\u53ef\u8996\u5316\u754c\u9762\u4f7f\u5f97\u6578\u64da\u9077\u79fb\u904e\u7a0b\u66f4\u52a0\u76f4\u89c0\uff0c\u4e26\u4e14\u53ef\u4ee5\u8a2d\u7f6e\u6578\u64da\u9a57\u8b49\u898f\u5247\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u3002<\/p>\n<h3 id=\"%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b%ef%bc%9a-rbDgEXXCwS\">\u4f7f\u7528\u793a\u4f8b\uff1a<\/h3>\n<p>\u7528\u6236\u53ef\u4ee5\u901a\u904e\u62d6\u653e\u64cd\u4f5c\u4f86\u8a2d\u7f6e\u6578\u64da\u6d41\uff0c\u4e26\u5728\u9077\u79fb\u904e\u7a0b\u4e2d\u6dfb\u52a0\u6578\u64da\u9a57\u8b49\u6b65\u9a5f\u3002<\/p>\n<h2 id=\"4-oracle-data-pump-rbDgEXXCwS\">4. Oracle Data Pump<\/h2>\n<p>Oracle Data Pump\u662f\u4e00\u500b\u9ad8\u6548\u7684\u6578\u64da\u5c0e\u5165\u548c\u5c0e\u51fa\u5de5\u5177\uff0c\u5c08\u70baOracle\u6578\u64da\u5eab\u8a2d\u8a08\u3002\u5b83\u652f\u6301\u5927\u898f\u6a21\u6578\u64da\u7684\u5feb\u901f\u9077\u79fb\uff0c\u4e26\u63d0\u4f9b\u4e86\u591a\u7a2e\u9078\u9805\u4f86\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\uff0c\u4f8b\u5982\u6578\u64da\u9a57\u8b49\u548c\u65e5\u8a8c\u8a18\u9304\u529f\u80fd\u3002<\/p>\n<h3 id=\"%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b%ef%bc%9a-rbDgEXXCwS\">\u4f7f\u7528\u793a\u4f8b\uff1a<\/h3>\n<pre><code>expdp user\/password DIRECTORY=dpump_dir DUMPFILE=mydata.dmp LOGFILE=mydata.log SCHEMAS=my_schema<\/code><\/pre>\n<h2 id=\"5-pg_dump-%e5%92%8c-pg_restore-rbDgEXXCwS\">5. pg_dump \u548c pg_restore<\/h2>\n<p>\u5c0d\u65bcPostgreSQL\u7528\u6236\u4f86\u8aaa\uff0cpg_dump\u548cpg_restore\u662f\u9032\u884c\u6578\u64da\u5eab\u9077\u79fb\u7684\u57fa\u672c\u5de5\u5177\u3002pg_dump\u7528\u65bc\u5c0e\u51fa\u6578\u64da\uff0c\u800cpg_restore\u5247\u7528\u65bc\u5c07\u6578\u64da\u5c0e\u5165\u5230\u76ee\u6a19\u6578\u64da\u5eab\u4e2d\u3002\u9019\u5169\u500b\u5de5\u5177\u80fd\u5920\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\uff0c\u4e26\u652f\u6301\u591a\u7a2e\u683c\u5f0f\u7684\u5c0e\u51fa\u3002<\/p>\n<h3 id=\"%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b%ef%bc%9a-rbDgEXXCwS\">\u4f7f\u7528\u793a\u4f8b\uff1a<\/h3>\n<pre><code>pg_dump -U username -F c dbname &gt; dbname.dump<\/code><\/pre>\n<pre><code>pg_restore -U username -d newdbname dbname.dump<\/code><\/pre>\n<h2 id=\"6-flyway-rbDgEXXCwS\">6. Flyway<\/h2>\n<p>Flyway\u662f\u4e00\u500b\u958b\u6e90\u7684\u6578\u64da\u5eab\u7248\u672c\u63a7\u5236\u5de5\u5177\uff0c\u652f\u6301\u591a\u7a2e\u6578\u64da\u5eab\u7cfb\u7d71\u3002\u5b83\u901a\u904e\u7248\u672c\u63a7\u5236\u4f86\u7ba1\u7406\u6578\u64da\u5eab\u7684\u9077\u79fb\uff0c\u78ba\u4fdd\u6bcf\u6b21\u9077\u79fb\u90fd\u80fd\u5920\u4fdd\u6301\u6578\u64da\u7684\u4e00\u81f4\u6027\u3002Flyway\u7684\u512a\u52e2\u5728\u65bc\u5176\u7c21\u55ae\u7684\u547d\u4ee4\u884c\u754c\u9762\u548c\u5f37\u5927\u7684\u7248\u672c\u7ba1\u7406\u529f\u80fd\u3002<\/p>\n<h3 id=\"%e4%bd%bf%e7%94%a8%e7%a4%ba%e4%be%8b%ef%bc%9a-rbDgEXXCwS\">\u4f7f\u7528\u793a\u4f8b\uff1a<\/h3>\n<pre><code>flyway migrate<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-rbDgEXXCwS\">\u7e3d\u7d50<\/h2>\n<p>\u6578\u64da\u5eab\u9077\u79fb\u662f\u4e00\u500b\u8907\u96dc\u7684\u904e\u7a0b\uff0c\u4f46\u9078\u64c7\u5408\u9069\u7684\u5de5\u5177\u53ef\u4ee5\u5927\u5927\u6e1b\u5c11\u98a8\u96aa\u4e26\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u3002\u7121\u8ad6\u662f\u4f7f\u7528AWS DMS\u3001SSMA\u3001Talend\u3001Oracle Data Pump\u3001pg_dump\u548cpg_restore\uff0c\u9084\u662fFlyway\uff0c\u9019\u4e9b\u5de5\u5177\u90fd\u80fd\u5920\u5e6b\u52a9\u7528\u6236\u9806\u5229\u5b8c\u6210\u6578\u64da\u9077\u79fb\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u548c\u9ad8\u6548\u7684\u6578\u64da\u5eab\u89e3\u6c7a\u65b9\u6848\u7684\u4f01\u696d\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u6216 <a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a> \u4f86\u652f\u6301\u9019\u4e9b\u5de5\u5177\u7684\u904b\u884c\u4e5f\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22\u516d\u500b\u6578\u64da\u5eab\u9077\u79fb\u5de5\u5177\uff0c\u5e6b\u52a9\u5be6\u73fe\u6578\u64da\u5b8c\u6574\u6027\uff0c\u78ba\u4fdd\u6578\u64da\u6e96\u78ba\u3001\u5b89\u5168\u5730\u8f49\u79fb\u81f3\u65b0\u7cfb\u7d71\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-151575","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/151575","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=151575"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/151575\/revisions"}],"predecessor-version":[{"id":151576,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/151575\/revisions\/151576"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=151575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=151575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=151575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}