用户间复制数据 copy from

676阅读 0评论2009-06-20 lukeunique
分类:Oracle

用户间复制数据
SQL> copy from user1 to user2 create table2 using select * from table1; 

SQL> copy from scott/tiger to hr create dept using select * from dept;
SP2-0519: FROM 字符串缺失 Oracle Net @database 描述
SQL> copy from scott/tiger@database to hr/hr@database create dept using select * from dept;


COPY
----
This option is the simplest one for changing the ownership of a table. To use it, you must have SQL*Net configured in your system. For syntax details, see the SQL*Plus User's Guide and Reference. With the COPY command, the storage parameters of the table cannot be changed. The table will be recreated in the default tablespace of the user to whose schema the copy is made. For example, to copy table EMP belonging to SCOTT into JOE's schema, the statement is:

COPY FROM scott/tiger@ny to joe/lion@ny CREATE JOE_EMP USING SELECT * FROM EMP
上一篇:Oracle DBA的UNIX袖珍参考手册
下一篇:linux zip