简体   繁体   English

如何比较来自不同数据库的两个表

[英]How to compare two tables from different databases

I have two databases, SqlServer 2016 & Oracle 10 (mirror replication). 我有两个数据库,SqlServer 2016和Oracle 10(镜像复制)。

I want to compare two the same tables from different databases without getting all data from tables on client. 我想比较来自不同数据库的两个相同表,而不从客户端上的表中获取所有数据。

Eg: I have two huge tables (size > 500 MB) how can I do it ? 例如:我有两个巨大的表(大小> 500 MB),我该怎么办? Maybe anywhere has some algorithms which do it ... 也许任何地方都有一些算法可以做到...

PS I have implemented some algorithm but speed of works this algorithm too slowly and work accuracy very low. PS我已经实现了一些算法,但是该算法的工作速度太慢,工作精度非常低。

You can use OPENROWSET to connect to Oracle from SQL Server 您可以使用OPENROWSET从SQL Server连接到Oracle

select * from
OPENROWSET('OraOLEDB.Oracle','<tnsname>';'someuser';'somepassword', 
'SELECT * FROM schema.table_to_compare') A 
FULL JOIN sqlserver.table_to_compate B
ON A.field = B.field

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

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