![](/img/trans.png)
[英]Oracle : Create table in another schema and grant select and insert on it from the same schema
[英]Insert table data into another table in another schema in oracle
我有 2 个数据库
第一个
username: name1
password: password1
hostname: pdprf.local
port: 8080
SID: prf
第二个
username: username2
password: password2
hostname: pdora.local
port: 8080
SID: prd
我正在从 scehama 1 中的表中选择数据,我想将该数据插入到 scehma 2 中的表中 - 通常我会导出数据并插入它,但我正在寻找 1 行语句来执行此操作 - 任何想法如何在甲骨文数据库?
如果这些是不同的数据库,那么数据库链接就是您问题的答案。
在这些数据库之一中创建数据库链接,例如
create database link dbl_prd
connect to username2
identified by password2
using 'prd';
那你就
insert into some_table@dbl_prd (col1, col2, ..., coln)
select col1, col2, ..., coln
from some_table;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.