简体   繁体   English

如何通过公用数据库链接将数据从一个表插入到两个Oracle数据库服务器的另一个表中?

[英]How to insert data from one table to another from two oracle database servers with public database link?

I am going to insert data from table2 to table1 and the two tables are in different database, different servers. 我将数据从table2插入到table1 ,并且两个表位于不同的数据库,不同的服务器中。

There are public database links for both database. 这两个数据库都有公共数据库链接。 In the details of the public database links, there are names of owner, db_link, username and host. 在公共数据库链接的详细信息中,有所有者,db_link,用户名和主机的名称。

I want to ask how to use the public database links to insert the data from table2 to table1 , thanks. 我想问一下如何使用公共数据库链接将数据从table2插入table1 ,谢谢。

I have tried something like 我已经尝试过类似的东西

INSERT INTO table1
SELECT 'xxxx, xxxx, xxxx', columns_from_table2
FROM table2@"db_link"
WHERE criteria;

but it prompts out an error message of 但它会提示一条错误消息

ORA-02019: connection description for remote database not found
02019. 00000 -  "connection description for remote database not found"

I think you are not using the correct dblink. 我认为您没有使用正确的dblink。 Try this and tell me: 试试这个,告诉我:

select * from dual@"db_link" 从Dual @“ db_link”中选择*

select * from dba_db_links where db_link = "[your_db_link_name]" 从dba_db_links中选择*,其中db_link =“ [您的db_link_name]”

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将数据从一个数据库表复制到不同服务器上的另一表 - Copying data from one database table to another table on different servers 如何将表的行从一个数据库插入到另一个数据库(使用两个PDO) - How to insert rows of a table from one database to another (with two PDO) 将一个表从常规数据库同步到另一台服务器上的另一数据库 - Synchronization one table from general database to another database on another servers 如何连接两个连接字符串并将数据从一个数据库插入另一个MySQL数据库 - how to connect two connection strings and insert data from one database into another MySQL database 将数据从一个oracle数据库表加载到另一oracle数据库表 - Load data from one oracle database table to another oracle database table 如何将数据从一个数据库表复制到另一数据库表? - How to copy data from one database table to another database table? 如何使用 MySQL 中的关系将另一个数据库中的一个表插入另一个表? - How to insert one table to another from another database with relationships in MySQL? PostgreSQL:如何将数据从一个数据库表复制到另一个数据库 - PostgreSQL: How to copy data from one database table to another database 如何在mysql数据库中将数据从一张表插入和检索到另一张表 - How to insert and retrive data from one table to another table in mysql database 使用Java将数据从一个oracle数据库表复制到另一数据库表 - Using Java Copy data from one oracle Database table to another database table
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM