{"id":2153,"date":"2010-05-18T10:31:41","date_gmt":"2010-05-18T02:31:41","guid":{"rendered":"http:\/\/www.killtest.com.tw\/?p=2153"},"modified":"2010-05-27T17:53:31","modified_gmt":"2010-05-27T09:53:31","slug":"oracle-copy","status":"publish","type":"post","link":"https:\/\/www.killtest.com.tw\/?p=2153","title":{"rendered":"Oracle\u6578\u64da\u5eab\u4e2d\u7684Copy\u547d\u4ee4"},"content":{"rendered":"<p>SQL*Plus\u7684Copy\u547d\u4ee4<\/p>\n<p>\u3000\u3000\u5728\u6578\u64da\u8868\u9593\u5fa9\u5236\u6578\u64da\u662f<a href=\"http:\/\/www.killtest.net\/10gDBA\/1Z0-042.asp\" target=\"_blank\">Oracle<\/a> DBA\u7d93\u5e38\u9762\u5c0d\u7684\u4efb\u52d9\u4e4b\u58f9\uff0cOracle\u70ba\u9019\u58f9\u4efb\u52d9\u63d0\u4f9b\u4e86\u591a\u7a2e\u89e3\u6c7a\u65b9\u6848\uff0cSQL*Plus Copy \u547d\u4ee4\u4fbf\u662f\u5176\u4e2d\u4e4b\u58f9\u3002SQL*Plus Copy \u547d\u4ee4\u901a\u904eSQL*Net\u5728\u4e0d\u540c\u7684\u8868\uff08\u540c\u58f9\u670d\u52d9\u5668\u6216\u662f\u4e0d\u540c\u670d\u52d9\u5668\uff09\u4e4b\u9593\u5fa9\u5236\u6578\u64da\u6216\u79fb\u52d5\u6578\u64da\u3002<\/p>\n<p>\u3000\u3000\u5728\u5be6\u969b\u904b\u884c\u74b0\u5883\u4e2d\u82e5\u80fd\u6070\u7576\u5730\u9078\u64c7\u4f7f\u7528SQL*Plus Copy \u547d\u4ee4\u53ef\u4ee5\u6709\u6548\u5730\u63d0\u9ad8\u6578\u64da\u5fa9\u5236\u7684\u6027\u80fd\u3002<\/p>\n<p>\u3000\u3000\u4e0b\u9762\u5c07\u7c21\u8981\u4ecb\u7d39SQL*Plus Copy \u547d\u4ee4\u4f7f\u7528\uff0c\u4e26\u5728\u6027\u80fd\u65b9\u9762\u8207\u5176\u4ed6\u5169\u7a2e\u65b9\u6848\u9032\u884c\u5c0d\u6bd4\uff0c\u529b\u6c42\u80fd\u63d0\u4f9b\u58f9\u500b\u4f7f\u7528Copy \u547d\u4ee4\u7684\u65b9\u6848\u53c3\u8003\u3002<\/p>\n<p>\u3000\u3000\u8a9e\u6cd5\u53ca\u4f7f\u7528\u8aaa\u660e<\/p>\n<p>\u3000\u3000\u8a9e\u6cd5\uff1a<\/p>\n<p>\u3000\u3000\u4e0b\u9762\u6211\u5011\u4f86\u770b\u58f9\u4e0bSQL*Copy \u547d\u4ee4\u7684\u8a9e\u6cd5\u53ca\u4f7f\u7528\u8aaa\u660e\u3002<\/p>\n<p>\u3000\u3000\u5728\u89e3\u91cbSQL*Plus Copy \u547d\u4ee4\u7684\u8a9e\u6cd5\u4e4b\u524d\uff0c\u6211\u5011\u5fc5\u9808\u8981\u660e\u78baSQL*Plus Copy \u547d\u4ee4\u4e0d\u662f\u58f9\u500b\u65b9\u6cd5\u6216\u662f\u51fd\u6578\uff0c\u4e5f\u4e0d\u662f\u58f9\u500bSQL\u8a9e\u53e5\uff0c\u5b83\u662f\u58f9\u500b\u547d\u4ee4\uff08command\uff09\uff0c\u7576\u7136\u9019\u500b\u547d\u4ee4\u5fc5\u9808\u5728SQL*Plus\u88cf\u904b\u884c\u3002<\/p>\n<p>\u3000\u3000SQL*Plus Copy \u547d\u4ee4\u7684\u8a9e\u6cd5\uff1a<\/p>\n<p>\u3000\u3000COPY {FROM database | TO database | FROM database TO database} destination_table [\uff08column\uff0c column\uff0c column\uff0c \u2026\u2026\uff09] USING query<\/p>\n<p>\u3000\u3000\u6211\u5011\u5206\u90e8\u5206\u4f86\u89e3\u91cb\u58f9\u4e0b\uff1a<\/p>\n<p>\u3000\u3000COPY \u2013 \u9019\u500b\u4e0d\u592a\u9700\u8981\u89e3\u91cb\uff0c\u4e3b\u547d\u4ee4\uff0c\u8072\u660e\u8981\u57f7\u884cCOPY\u64cd\u4f5c\u3002<\/p>\n<p>\u3000\u3000From Database \u2013 \u6e90\u6578\u64da\u5eab\u3002<\/p>\n<p>\u3000\u3000To Database \u2013 \u76ee\u6a19\u6578\u64da\u5eab\u3002<\/p>\n<p>\u3000\u3000\u6b64\u8655\u8a3b\u610f\u82b1\u62ec\u865f\u4e2d\u6709\u4e09\u7a2e\u53ef\u9078\u7684\u5beb\u6cd5\uff08\u4ee5\u201c|\u201d\u9694\u958b\uff09\uff0c\u5982\u679c\u6e90\u6578\u64da\u8868\u548c\u76ee\u6a19\u6578\u64da\u8868\u5728\u540c\u58f9\u500bSchema\u4e2d\uff0c\u5247\u53ef\u4ee5\u53ea\u5bebFrom Database\uff0c\u4e5f\u53ef\u4ee5\u53ea\u5bebTo Database\uff0c\u7576\u7136\u9084\u53ef\u4ee5\u662f\u7b2c\u4e09\u7a2e\u5beb\u6cd5\uff0c\u628aFrom Database\u548cTo Database\u5beb\u5168\u3002\u4f46\u5982\u679c\u6e90\u6578\u64da\u8868\u548c\u76ee\u6a19\u6578\u64da\u8868\u4e0d\u5728\u540c\u58f9\u500bSchema\u4e2d\uff0c\u5247\u5fc5\u9808\u7528\u7b2c\u4e09\u7a2e\u5beb\u6cd5\uff0c\u5373\u628aFrom Database\u548cTo Database\u90fd\u5beb\u5168\uff0c\u683c\u5f0f\u76f8\u540c\uff1a<a href=\"mailto:USERID\/PASSWORD@SID\">USERID\/PASSWORD@SID<\/a>.<\/p>\n<p>\u3000\u3000\u2013 \u8072\u660e\u64cd\u4f5c\u6578\u64da\u7684\u65b9\u5f0f\uff0c\u4e0b\u9762\u5206\u5225\u89e3\u91cb\u58f9\u4e0b\uff1a<\/p>\n<p>\u3000\u3000Append \u2013 \u5411\u5df2\u6709\u7684\u76ee\u6a19\u8868\u4e2d\u8ffd\u52a0\u8a18\u9304\uff0c\u5982\u679c\u76ee\u6a19\u8868\u4e0d\u5b58\u5728\uff0c\u81ea\u52d5\u5275\u5efa\uff0c\u9019\u7a2e\u60c5\u6cc1\u4e0b\u548cCreate\u7b49\u6548\u3002<\/p>\n<p>\u3000\u3000Create \u2013 \u5275\u5efa\u76ee\u6a19\u8868\u4e26\u4e14\u5411\u5176\u4e2d\u8ffd\u52a0\u8a18\u9304\uff0c\u5982\u679c\u76ee\u6a19\u8868\u5df2\u7d93\u5b58\u5728\uff0c\u5247\u6703\u8fd4\u56de\u932f\u8aa4\u3002<\/p>\n<p>\u3000\u3000Insert \u2013 \u5411\u5df2\u6709\u7684\u76ee\u6a19\u8868\u4e2d\u63d2\u5165\u8a18\u9304\uff0c\u8207Append\u4e0d\u540c\u7684\u662f\uff0c\u5982\u679c\u76ee\u6a19\u8868\u4e0d\u5b58\u5728\uff0c\u4e0d\u81ea\u52d5\u5275\u5efa\u800c\u662f\u8fd4\u56de\u932f\u8aa4\u3002<\/p>\n<p>\u3000\u3000Replace \u2013 \u7528\u67e5\u8a62\u51fa\u4f86\u7684\u6578\u64da\u8986\u84cb\u5df2\u6709\u7684\u76ee\u6a19\u8868\u4e2d\u7684\u6578\u64da\uff0c\u5982\u679c\u76ee\u6a19\u8868\u4e0d\u5b58\u5728\uff0c\u81ea\u52d5\u5275\u5efa\u3002<\/p>\n<p>\u3000\u3000destination_table \u2013 \u76ee\u6a19\u8868\u7684\u540d\u5b57<\/p>\n<p>\u3000\u3000[\uff08column\uff0c column\uff0c column\uff0c \u2026\u2026\uff09] \u2013 \u53ef\u4ee5\u6307\u5b9a\u76ee\u6a19\u8868\u4e2d\u5217\u7684\u540d\u5b57\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\uff0c\u5247\u81ea\u52d5\u4f7f\u7528Query\u4e2d\u7684\u5217\u540d\u3002<\/p>\n<p>\u3000\u3000USING query \u2013 \u67e5\u8a62\u8a9e\u53e5\uff0c\u4ea4\u6d41\u7684\u6578\u64da\u4f86\u81ea\u9019\u5152\u3002<\/p>\n<p>\u3000\u3000\u4f7f\u7528\u7bc4\u4f8b\uff1a<\/p>\n<p>\u3000\u3000\u4e0b\u9762\u6211\u5011\u901a\u904e\u5e7e\u500b\u4f8b\u5b50\u4f86\u770b\u58f9\u4e0bSQL*Plus Copy \u547d\u4ee4\u7684\u4f7f\u7528\uff1a<\/p>\n<p>\u3000\u3000\u5728\u540c\u58f9\u500b\u670d\u52d9\u5668\u7684\u540c\u58f9\u500bSchema\u4e2d\u5fa9\u5236\u6578\u64da\uff1a<\/p>\n<p>\u3000\u3000\u540c\u6642\u6307\u5b9aFrom database\u548cTo database\uff1a<\/p>\n<p>\u3000\u3000SQL&gt; copy from <a href=\"mailto:scott\/tiger@lsj\">scott\/tiger@lsj<\/a> to <a href=\"mailto:scott\/tiger@lsj\">scott\/tiger@lsj<\/a> create dept1 using select * from dept\uff1b \u53ea\u6307\u5b9aFrom Database SQL&gt; copy from <a href=\"mailto:scott\/tiger@lsj\">scott\/tiger@lsj<\/a> create dept2 using select * from dept\uff1b \u53ea\u6307\u5b9aTo Database SQL&gt; copy to <a href=\"mailto:scott\/tiger@lsj\">scott\/tiger@lsj<\/a> create dept3 using select * from dept\uff1b<\/p>\n<p>\u3000\u3000\u5728\u540c\u58f9\u500b\u670d\u52d9\u5668\u7684\u4e0d\u540cSchema\u4e2d\u5fa9\u5236\u6578\u64da\uff1a\uff08\u9019\u7a2e\u60c5\u6cc1\u4e0b\u5fc5\u9808\u540c\u6642\u6307\u5b9aFrom Database\u548cTo Database\uff09<\/p>\n<p>\u3000\u3000SQL&gt; copy from <a href=\"mailto:scott\/tiger@lsj\">scott\/tiger@lsj<\/a> to <a href=\"mailto:lsjdemo\/lsjdemo@lsj\">lsjdemo\/lsjdemo@lsj<\/a> create dept using select * from dept\uff1b<\/p>\n<p>\u3000\u3000\u8a3b\u610f\u9019\u7a2e\u60c5\u6cc1\u4e0b\uff0cusing select * from dept \u4e2d\u4e26\u4e0d\u9700\u8981\u4f7f\u7528scott.demp\u7684\u5f62\u5f0f\u3002<\/p>\n<p>\u3000\u3000\u5728\u4e0d\u540c\u7684\u670d\u52d9\u5668\u9593\u5fa9\u5236\u6578\u64da\uff1a<\/p>\n<p>\u3000\u3000SQL&gt; conn <a href=\"mailto:lsj\/lsj@sunserve\">lsj\/lsj@sunserve<\/a> \u5df2\u9023\u63a5\u3002 SQL&gt; copy from <a href=\"mailto:scott\/tiger@lsj\">scott\/tiger@lsj<\/a> to <a href=\"mailto:lsj\/lsj@sunserve\">lsj\/lsj@sunserve<\/a> create dept using select * from dept\uff1b<\/p>\n<p>\u3000\u3000\u6027\u80fd\u5be6\u9a57\u7d50\u679c\uff1a<\/p>\n<p>\u3000\u3000\u5be6\u9a57\u6578\u64da\uff1a \u8a18\u9304\u6578\uff1a5\uff0c082\uff0c500 \u6578\u64da\u91cf\uff1a504M \u5be6\u9a57\u7d50\u679c \u65b9\u6848\u2014\u2014\u57f7\u884c\u6642\u9593\uff08\u79d2\uff09 \u2014\u2014Undo\uff08M\uff09 \u2014\u2014Redo\uff08M\uff09 Copy command \u2014\u2014520.51\u2014\u20140 \u2014\u2014 592 Insert into\u2026select \u2026\u2014\u2014 631.64 \u2014\u2014345 \u2014\u20141720 Create Table\u2026\u2014\u2014 244.79 \u2014\u20140 \u2014\u2014515<\/p>\n<p>\u3000\u3000\u7e3d\u7d50<\/p>\n<p>\u3000\u3000Create Table\u2026as select\u2026\u662f\u6700\u5feb\u7684\uff0c\u800c\u4e14\u751f\u6210\u7684Undo\u548cRedo\u4fe1\u606f\u6700\u5c11\uff0c\u6240\u4ee5\u53ea\u8981\u53ef\u80fd\uff0c\u8acb\u76e1\u91cf\u4f7f\u7528\u9019\u7a2e\u65b9\u6848\u3002\u4f46\u9019\u7a2e\u65b9\u6848\u6709\u58f9\u5b9a\u7684\u9650\u5236\uff0c\u5373\u76ee\u6a19\u8868\u5fc5\u9808\u662f\u4e0d\u5b58\u5728\u7684\uff0c\u4e0d\u80fd\u7528\u5b83\u5411\u5df2\u6709\u7684\u76ee\u6a19\u8868\u4e2d\u8ffd\u52a0\u8a18\u9304\u3002<\/p>\n<p>\u3000\u3000Insert into \u2026 select \u2026 \u662f\u6700\u6162\u7684\uff0c\u800c\u4e14\u751f\u6210\u6700\u591a\u7684Undo\u548cRedo\u4fe1\u606f\uff0c\u5c0dI\/O\u7684\u58d3\u529b\u6700\u5927\uff0c\u512a\u52e2\u5728\u65bc\u5927\u5bb6\u5c0d\u5b83\u6bd4\u8f03\u719f\u6089\uff0c\u4f7f\u7528\u8d77\u4f86\u6bd4\u8f03\u7c21\u55ae\uff0c\u9069\u5408\u65bc\u8655\u7406\u5c11\u91cf\u7684\u6578\u64da\uff0c\u82e5\u8981\u8655\u7406\u5927\u91cf\u7684\u6578\u64da\uff0c\u4e0d\u63a8\u85a6\u4f7f\u7528\u9019\u7a2e\u65b9\u6848\u3002<\/p>\n<p>\u3000\u3000Copy Command\u53ef\u4ee5\u8655\u7406Create Table\u4e0d\u80fd\u8655\u7406\u7684\u60c5\u6cc1\uff0c\u5373\u5411\u5df2\u6709\u7684\u6578\u64da\u8868\u4e2d\u8ffd\u52a0\u8a18\u9304\uff0c\u76f8\u5c0d\u65bcinsert\u4f86\u8aaa\uff0c\u6548\u7387\u66f4\u9ad8\u58f9\u4e9b\uff0c\u751f\u6210\u66f4\u5c11\u7684Redo\u4fe1\u606f\uff0c\u4e0d\u751f\u6210Undo\u4fe1\u606f\uff0c\u6240\u4ee5\u5728\u57f7\u884c\u5927\u91cf\u7684\u6578\u64da\u8ffd\u52a0\u6642\uff0c\u63a8\u85a6\u4f7f\u7528Copy Command\u547d\u4ee4<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL*Plus\u7684Copy\u547d\u4ee4 \u3000\u3000\u5728\u6578\u64da\u8868\u9593\u5fa9\u5236\u6578\u64da\u662fOracle DBA\u7d93\u5e38\u9762\u5c0d\u7684\u4efb\u52d9\u4e4b\u58f9\uff0cOracle\u70ba\u9019\u58f9\u4efb\u52d9\u63d0\u4f9b\u4e86\u591a\u7a2e\u89e3\u6c7a\u65b9\u6848\uff0cSQL*Plus Copy \u547d\u4ee4\u4fbf\u662f\u5176\u4e2d\u4e4b\u58f9\u3002SQL*Plus Copy \u547d\u4ee4\u901a\u904eSQL*Net\u5728\u4e0d\u540c\u7684\u8868\uff08\u540c\u58f9\u670d\u52d9\u5668\u6216\u662f\u4e0d\u540c\u670d\u52d9\u5668\uff09\u4e4b\u9593\u5fa9\u5236\u6578\u64da\u6216\u79fb\u52d5\u6578\u64da\u3002 \u3000\u3000\u5728\u5be6\u969b\u904b\u884c\u74b0\u5883\u4e2d\u82e5\u80fd\u6070\u7576\u5730\u9078\u64c7\u4f7f\u7528SQL*Plus Copy \u547d\u4ee4\u53ef\u4ee5\u6709\u6548\u5730\u63d0\u9ad8\u6578\u64da\u5fa9\u5236\u7684\u6027\u80fd\u3002 \u3000\u3000\u4e0b\u9762\u5c07\u7c21\u8981\u4ecb\u7d39SQL*Plus Copy \u547d\u4ee4\u4f7f\u7528\uff0c\u4e26\u5728\u6027\u80fd\u65b9\u9762\u8207\u5176\u4ed6\u5169\u7a2e\u65b9\u6848\u9032\u884c\u5c0d\u6bd4\uff0c\u529b\u6c42\u80fd\u63d0\u4f9b\u58f9\u500b\u4f7f\u7528Copy \u547d\u4ee4\u7684\u65b9\u6848\u53c3\u8003\u3002 \u3000\u3000\u8a9e\u6cd5\u53ca\u4f7f\u7528\u8aaa\u660e \u3000\u3000\u8a9e\u6cd5\uff1a \u3000\u3000\u4e0b\u9762\u6211\u5011\u4f86\u770b\u58f9\u4e0bSQL*Copy \u547d\u4ee4\u7684\u8a9e\u6cd5\u53ca\u4f7f\u7528\u8aaa\u660e\u3002 \u3000\u3000\u5728\u89e3\u91cbSQL*Plus Copy \u547d\u4ee4\u7684\u8a9e\u6cd5\u4e4b\u524d\uff0c\u6211\u5011\u5fc5\u9808\u8981\u660e\u78baSQL*Plus Copy \u547d\u4ee4\u4e0d\u662f\u58f9\u500b\u65b9\u6cd5\u6216\u662f\u51fd\u6578\uff0c\u4e5f\u4e0d\u662f\u58f9\u500bSQL\u8a9e\u53e5\uff0c\u5b83\u662f\u58f9\u500b\u547d\u4ee4\uff08command\uff09\uff0c\u7576\u7136\u9019\u500b\u547d\u4ee4\u5fc5\u9808\u5728SQL*Plus\u88cf\u904b\u884c\u3002 \u3000\u3000SQL*Plus Copy \u547d\u4ee4\u7684\u8a9e\u6cd5\uff1a \u3000\u3000COPY {FROM database | TO database | FROM database TO database} destination_table [\uff08column\uff0c column\uff0c column\uff0c \u2026\u2026\uff09] USING query \u3000\u3000\u6211\u5011\u5206\u90e8\u5206\u4f86\u89e3\u91cb\u58f9\u4e0b\uff1a \u3000\u3000COPY \u2013 \u9019\u500b\u4e0d\u592a\u9700\u8981\u89e3\u91cb\uff0c\u4e3b\u547d\u4ee4\uff0c\u8072\u660e\u8981\u57f7\u884cCOPY\u64cd\u4f5c\u3002 \u3000\u3000From Database \u2013 \u6e90\u6578\u64da\u5eab\u3002 \u3000\u3000To Database \u2013 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[589,3163,590],"class_list":["post-2153","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-copy","tag-oracle"],"_links":{"self":[{"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/2153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2153"}],"version-history":[{"count":5,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/2153\/revisions"}],"predecessor-version":[{"id":2176,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/2153\/revisions\/2176"}],"wp:attachment":[{"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}