簡體   English   中英

將表數據插入到oracle中另一個模式中的另一個表中

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM