简体   繁体   English

如何将数据从一个数据库复制到另一个Oracle数据库?

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

相关问题 在Java中将数据从一个数据库服务器复制到另一数据库服务器 - Data Copy From one db server to another db server in java 如何使用Hibernate从两个不同的数据库(DB2和Oracle)读取数据并将其持久化到另一个DB(SQL Server)中? - How can I read data from two different Databases (DB2 and Oracle) and Persist it into another DB (SQL Server) using Hibernate? 如何将数据从java加载到oracle DB - How can I load data from java into oracle DB 如何将选择性数据从一个数据库复制到另一个数据库(ORACLE) - How to copy selective data from one database to another (ORACLE) 一步将数据从 Postgres 数据库复制到 AWS S3 - Copy data from Postgres DB to AWS S3 in one step 如何从我的服务层中的数据库获取数据? - How can I get data from DB in my service layer? 如何使用流API从数据库加载数据? - How can I use stream API to load data from the DB? 如何在循环中将数组元素从一个复制到另一个? - How can i copy array elements from one to another in loop? Java:如何从Oracle DB表解析XML类型列数据? - Java: How do I parse XML Type Column Data from Oracle DB Table? 我正在从Java读取文本文件以插入到Oracle DB表中,如何跳过前2行? - I am reading the text file from java to insert into oracle DB table, how can skip first 2 lines?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM