![](/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.