使用copy命令拷贝数据表

实现同一个数据库不同用户间的表的拷贝 

首先看下copy命令的解释

SQL> help copy;


 COPY
 ----


 Copies data from a query to a table in the same or another
 database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.


 COPY {FROM database | TO database | FROM database TO database}
            {APPEND|CREATE|INSERT|REPLACE} destination_table
            [(column, column, column, ...)] USING query


 where database has the following syntax:
     username[/password]@connect_identifier


首先给两个不同的用户授予表空间无限制操作权限

grant ulimited tablespace to test1;

grant ulimited tablespace to test;


SQL> copy from test1/test1@orcl1 to test/test@orcl1 create goods using select * from goods;


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 GOODS created.


   16 rows selected from test1@orcl1.
   16 rows inserted into GOODS.
   16 rows committed into GOODS at test@orcl1.

转载于:https://www.cnblogs.com/liaomin416100569/p/9331274.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值