简体   繁体   中英

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.

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.

I want to ask how to use the public database links to insert the data from table2 to table1 , thanks.

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. Try this and tell me:

select * from dual@"db_link"

select * from dba_db_links where db_link = "[your_db_link_name]"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM