[英]How can I copy data from one DB to another oracle DB?
I want to update a column of a table. 我想更新表的列。 But the required Data is available in another oracle DB.Which is the best way to copy data from remote DB to my DB. 但是所需的数据在另一个Oracle数据库中可用。这是将数据从远程数据库复制到我的数据库的最佳方法。
Should I go with Java program or can I achieve it in PL/SQL itself? 我应该使用Java程序还是可以在PL / SQL本身中实现它?
If I correctly understood the question, you need to set the value of a column with a value extracted from another table of another DB. 如果我正确理解了这个问题,则需要使用从另一个数据库的另一个表中提取的值来设置列的值。 The two DBs have different structure. 这两个数据库具有不同的结构。
In this case you can do it with just SQL and a database link. 在这种情况下,您可以仅使用SQL和数据库链接来完成此操作。
Here's how to create an Oracle database link: Oracle documentation for database links 以下是创建Oracle数据库链接的方法:数据库链接的Oracle文档
Then you can write a query like following: 然后,您可以编写如下查询:
UPDATE local_table
SET local_column = (SELECT remote_column FROM remote_table@remote_db WHERE ...)
WHERE ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.