oracle 比较来自两个不同数据库的表 SQL Developer

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14590914/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 01:24:58  来源:igfitidea点击:

Compare tables from two different databases SQL Developer

oracletestingreplicationoracle-sqldeveloper

提问by user2022978

I am using SQL developer to connect to the databases, I am currently involved in Replication Testing:

我正在使用 SQL developer 连接到数据库,我目前参与复制测试:

Here are the links for the Source and Target:

以下是源和目标的链接:

**Source**
Host Name - n****-s**n.o*s.lab
Port - 1521
Service Name - stgdev

**Target**

Host Name - *pr****1.****b.lab
Port - 1522
Service Name - S******

Can anyone tell me how to write a query to compare tables from the above two databases, the databases are identical. Say I want to compare Account table from both the above databases...what is the query. Please advise.

谁能告诉我如何编写查询来比较上述两个数据库中的表,数据库是相同的。假设我想比较上述两个数据库中的 Account 表......查询是什么。请指教。

回答by Raj

if you have connectivity (db link) between two databases, you can use dbms_comparison package to setup scheduled comparison. in fact if you will frequently be doing this on multiple tables, you should probably look into it.

如果两个数据库之间有连接(db 链接),则可以使用 dbms_comparison 包来设置计划比较。事实上,如果您经常在多个表上执行此操作,您可能应该研究一下。

Or, you can always run a select * from table@source minus select @ from table@target and see differences but for large datasets it is not really efficient.

或者,您始终可以运行 select * from table@source 减去 select @ from table@target 并查看差异,但对于大型数据集,它并不是很有效。

Look into dbms_comparison package docs link

查看 dbms_comparison 包文档链接

回答by Neil Anderson

I work for Red Gate. We have a tool that performs data comparison of tables, allows you to view the differences and produce a deployment script that will make the data identical. Since you do not have a database link you can use between the databases I think our tool would work for you.

我在红门工作。我们有一个工具可以执行表的数据比较,允许您查看差异并生成使数据相同的部署脚本。由于您没有可以在数据库之间使用的数据库链接,我认为我们的工具适合您。

You get a full featured 14-day trial. You can download the tool here http://www.red-gate.com/products/oracle-development/.

您将获得功能齐全的 14 天试用版。您可以在http://www.red-gate.com/products/oracle-development/下载该工具。

回答by tsmets

Squirrel-sql has a plugingfor doing that !

Squirrel-sql 有一个插件可以做到这一点!