{"id":5012,"date":"2024-11-14T09:27:45","date_gmt":"2024-11-14T01:27:45","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5012\/"},"modified":"2024-11-14T09:27:45","modified_gmt":"2024-11-14T01:27:45","slug":"oracle%e6%80%8e%e4%b9%88%e6%9f%a5%e7%9c%8b%e8%a1%8c%e5%8a%a8%e8%bf%81%e7%a7%bb","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5012\/","title":{"rendered":"oracle\u600e\u4e48\u67e5\u770b\u884c\u52a8\u8fc1\u79fb"},"content":{"rendered":"<blockquote><p>\n  oracle \u63d0\u4f9b\u4e86\u591a\u79cd\u67e5\u770b\u884c\u52a8\u8fc1\u79fb\u7684\u65b9\u6cd5\uff0c\u5305\u62ec dba_migrations \u89c6\u56fe\u3001v$migrations \u89c6\u56fe\u548c\u8fc1\u79fb\u64cd\u4f5c\uff0c\u5982 dbms_migration.migrate_schema\u3002dba_migrations \u89c6\u56fe\u63d0\u4f9b\u6709\u5173\u8fc1\u79fb\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u72b6\u6001\u548c\u8fdb\u5ea6\u3002v$migrations \u89c6\u56fe\u63d0\u4f9b\u5b9e\u65f6\u4fe1\u606f\uff0c\u5982\u8fdb\u5ea6\u548c\u901f\u7387\u3002\u8fc1\u79fb\u64cd\u4f5c\u5141\u8bb8\u624b\u52a8\u53d1\u8d77\u548c\u76d1\u89c6\u8fc1\u79fb\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/21\/2024052110302985255.jpg\" class=\"aligncenter\" title=\"oracle\u600e\u4e48\u67e5\u770b\u884c\u52a8\u8fc1\u79fb\u63d2\u56fe\" alt=\"oracle\u600e\u4e48\u67e5\u770b\u884c\u52a8\u8fc1\u79fb\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u67e5\u770b Oracle \u4e2d\u7684\u884c\u52a8\u8fc1\u79fb<\/strong><\/p>\n<p>Oracle \u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u67e5\u770b\u884c\u52a8\u8fc1\u79fb\uff1a<\/p>\n<p><strong>1. DBA_MIGRATIONS \u89c6\u56fe<\/strong><\/p>\n<p>DBA_MIGRATIONS \u89c6\u56fe\u63d0\u4f9b\u4e86\u6709\u5173\u6570\u636e\u5e93\u8fc1\u79fb\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>SOURCE_DATABASE: \u6e90\u6570\u636e\u5e93\u7684\u540d\u79f0<\/li>\n<li>TARGET_DATABASE: \u76ee\u6807\u6570\u636e\u5e93\u7684\u540d\u79f0<\/li>\n<li>START_TIME: \u8fc1\u79fb\u5f00\u59cb\u65f6\u95f4<\/li>\n<li>END_TIME: \u8fc1\u79fb\u7ed3\u675f\u65f6\u95f4<\/li>\n<li>STATUS: \u8fc1\u79fb\u72b6\u6001\uff08RUNNING\u3001COMPLETED\u3001FAILED\uff09<\/li>\n<li>PROGRESS: \u8fc1\u79fb\u8fdb\u5ea6\uff08\u4ee5\u767e\u5206\u6bd4\u8868\u793a\uff09<\/li>\n<\/ul>\n<p>\u4f8b\u5982\uff0c\u8981\u67e5\u770b\u6240\u6709\u6b63\u5728\u8fdb\u884c\u7684\u8fc1\u79fb\uff0c\u60a8\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u67e5\u8be2\uff1a<\/p>\n<pre>SELECT *\nFROM DBA_MIGRATIONS\nWHERE STATUS = 'RUNNING';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. V$MIGRATIONS \u89c6\u56fe<\/strong><\/p>\n<p>V$MIGRATIONS \u89c6\u56fe\u63d0\u4f9b\u6709\u5173\u5f53\u524d\u6b63\u5728\u8fdb\u884c\u7684\u8fc1\u79fb\u7684\u5b9e\u65f6\u4fe1\u606f\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>SOURCE_NAME: \u6e90\u6570\u636e\u5e93\u7684\u540d\u79f0<\/li>\n<li>TARGET_NAME: \u76ee\u6807\u6570\u636e\u5e93\u7684\u540d\u79f0<\/li>\n<li>START_TIME: \u8fc1\u79fb\u5f00\u59cb\u65f6\u95f4<\/li>\n<li>PROGRESS: \u8fc1\u79fb\u8fdb\u5ea6\uff08\u4ee5\u5b57\u8282\u6570\u8868\u793a\uff09<\/li>\n<li>RATE: \u8fc1\u79fb\u901f\u7387\uff08\u4ee5\u5b57\u8282\/\u79d2\u8868\u793a\uff09<\/li>\n<li>ELAPSED_TIME: \u81ea\u8fc1\u79fb\u5f00\u59cb\u4ee5\u6765\u7ecf\u8fc7\u7684\u65f6\u95f4<\/li>\n<li>REMAINING_TIME: \u4f30\u8ba1\u7684\u5269\u4f59\u8fc1\u79fb\u65f6\u95f4<\/li>\n<\/ul>\n<p>\u4f8b\u5982\uff0c\u8981\u67e5\u770b\u5f53\u524d\u6b63\u5728\u8fdb\u884c\u7684\u8fc1\u79fb\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u60a8\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u67e5\u8be2\uff1a<\/p>\n<pre>SELECT *\nFROM V$MIGRATIONS;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u8fc1\u79fb\u64cd\u4f5c<\/strong><\/p>\n<p>Oracle \u8fd8\u63d0\u4f9b\u4e86\u7528\u4e8e\u7ba1\u7406\u8fc1\u79fb\u7684\u51e0\u4e2a\u64cd\u4f5c\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>DBMS_MIGRATION.MIGRATE_SCHEMA: \u5c06\u67b6\u6784\u4ece\u6e90\u6570\u636e\u5e93\u8fc1\u79fb\u5230\u76ee\u6807\u6570\u636e\u5e93<\/li>\n<li>DBMS_MIGRATION.MIGRATE_DATA: \u5c06\u6570\u636e\u4ece\u6e90\u6570\u636e\u5e93\u8fc1\u79fb\u5230\u76ee\u6807\u6570\u636e\u5e93<\/li>\n<li>DBMS_MIGRATION.MIGRATE_PLSQL: \u5c06 PL\/SQL \u5bf9\u8c61\u4ece\u6e90\u6570\u636e\u5e93\u8fc1\u79fb\u5230\u76ee\u6807\u6570\u636e\u5e93<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u64cd\u4f5c\u53ef\u4ee5\u7528\u4e8e\u624b\u52a8\u53d1\u8d77\u548c\u76d1\u89c6\u8fc1\u79fb\u3002\u4f8b\u5982\uff0c\u8981\u542f\u52a8\u67b6\u6784\u8fc1\u79fb\uff0c\u60a8\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>EXECUTE DBMS_MIGRATION.MIGRATE_SCHEMA(\n    source_database =&gt; 'SOURCE_DB',\n    target_database =&gt; 'TARGET_DB',\n    schema_name =&gt; 'SCHEMA_NAME'\n);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u67e5\u770b\u884c\u52a8\u8fc1\u79fb\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 \u63d0\u4f9b\u4e86\u591a\u79cd\u67e5\u770b\u884c\u52a8\u8fc1\u79fb\u7684\u65b9\u6cd5\uff0c\u5305\u62ec dba_migrations \u89c6\u56fe\u3001v$migrations \u89c6\u56fe\u548c\u8fc1\u79fb\u64cd\u4f5c\uff0c\u5982 dbms_migration.migrate_schema\u3002dba_migrations \u89c6\u56fe\u63d0\u4f9b\u6709\u5173\u8fc1\u79fb\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u72b6\u6001\u548c\u8fdb\u5ea6\u3002v$migrations \u89c6\u56fe\u63d0\u4f9b\u5b9e\u65f6\u4fe1\u606f\uff0c\u5982\u8fdb\u5ea6\u548c\u901f\u7387\u3002\u8fc1\u79fb\u64cd\u4f5c\u5141\u8bb8\u624b\u52a8\u53d1\u8d77\u548c\u76d1\u89c6\u8fc1\u79fb\u3002 \u5982\u4f55\u67e5\u770b Oracle \u4e2d\u7684\u884c\u52a8\u8fc1\u79fb Oracle \u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u67e5\u770b\u884c\u52a8\u8fc1\u79fb\uff1a 1. DBA_MIGRATIONS \u89c6\u56fe DBA_MIGRATIONS \u89c6\u56fe\u63d0\u4f9b\u4e86\u6709\u5173\u6570\u636e\u5e93\u8fc1\u79fb\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\uff1a SOURCE_DATABASE: \u6e90\u6570\u636e\u5e93\u7684\u540d\u79f0 TARGET_DATABASE: \u76ee\u6807\u6570\u636e\u5e93\u7684\u540d\u79f0 START_TIME: \u8fc1\u79fb\u5f00\u59cb\u65f6\u95f4 END_TIME: \u8fc1\u79fb\u7ed3\u675f\u65f6\u95f4 STATUS: \u8fc1\u79fb\u72b6\u6001\uff08RUNNING\u3001COMPLETED\u3001FAILED\uff09 PROGRESS: \u8fc1\u79fb\u8fdb\u5ea6\uff08\u4ee5\u767e\u5206\u6bd4\u8868\u793a\uff09 \u4f8b\u5982\uff0c\u8981\u67e5\u770b\u6240\u6709\u6b63\u5728\u8fdb\u884c\u7684\u8fc1\u79fb\uff0c\u60a8\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u67e5\u8be2\uff1a SELECT * FROM DBA_MIGRATIONS WHERE STATUS = &#8216;RUNNING&#8217;; \u767b\u5f55\u540e\u590d\u5236 2. V$MIGRATIONS \u89c6\u56fe V$MIGRATIONS \u89c6\u56fe\u63d0\u4f9b\u6709\u5173\u5f53\u524d\u6b63\u5728\u8fdb\u884c\u7684\u8fc1\u79fb\u7684\u5b9e\u65f6\u4fe1\u606f\uff0c\u5305\u62ec\uff1a SOURCE_NAME: \u6e90\u6570\u636e\u5e93\u7684\u540d\u79f0 TARGET_NAME: \u76ee\u6807\u6570\u636e\u5e93\u7684\u540d\u79f0 START_TIME: \u8fc1\u79fb\u5f00\u59cb\u65f6\u95f4 PROGRESS: \u8fc1\u79fb\u8fdb\u5ea6\uff08\u4ee5\u5b57\u8282\u6570\u8868\u793a\uff09 RATE: \u8fc1\u79fb\u901f\u7387\uff08\u4ee5\u5b57\u8282\/\u79d2\u8868\u793a\uff09 [&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-5012","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5012","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=5012"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5012\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}