--sqlplus copy可以自一个库到另一个库迁移数据库表对象 SQL> copy usage: COPY FROM TO
{ () } USING : database string, e.g., hr/your_password@d:chicago-mktg : ONE of the keywords: APPEND, CREATE, INSERT or REPLACE --创建,添加,插入,替换表或表的数据
: name of the destination table --创建的目标表 : a comma-separated list of destination column aliases --目标表的重命名列 : any valid SQL SELECT statement --源库的select子句用于产生目标表或数据所用
---如不指定目标库,则为当前库,同理如仅指定to则源库为当前库,to指定目标库 SQL> copy from tbl_bck/system@second create t_test_copy using select object_id o bjectid from user_objects;
Array fetch/bind size is 15. (arraysize is 15) Will commit when done. (copycommit is 0) Maximum long size is 80. (long is 80) Table T_TEST_COPY created.
28 rows selected from tbl_bck@second. 28 rows inserted into T_TEST_COPY. 28 rows committed into T_TEST_COPY at DEFAULT HOST connection.
SQL> desc t_test_copy; Name Null? Type ----------------------------------------- -------- ----------------------------
OBJECTID NUMBER(38)
--与copy性能相关的参数为arraysize,copycommit,long SQL> copy from tbl_bck/system@second create t_test_copy_2 using select object_id objectid from user_objects;
Array fetch/bind size is 5000. (arraysize is 5000) Will commit after every 10 array binds. (copycommit is 10) Maximum long size is 80. (long is 80) Table T_TEST_COPY_2 created.
30 rows selected from tbl_bck@second. 30 rows inserted into T_TEST_COPY_2. 30 rows committed into T_TEST_COPY_2 at DEFAULT HOST connection.