如何使用copy from 命令把一个用户中的表复制到另一个用户中?copy from user1 to user2 create talble a using select * from table1; 这样一次只能一个表,有没有复制全部的?另外,这样复制索引、主键都不能复制进去?如果要做到,如何处理?用dmp导入?
create or replace synonym synonymname for Username.tablename;
select 'create or replace synonym '||table_name||' for user1.'||table_name||';' from user_tables;select 'grant all on '||table_name||' to user2;' from user_tables;在USER1中运行生成的脚本,在USER2中就能像在USER1中一样使用USER1中的表
for Username.tablename;
from user_tables;select 'grant all on '||table_name||' to user2;' from user_tables;在USER1中运行生成的脚本,在USER2中就能像在USER1中一样使用USER1中的表