如何比较不同数据库中的表的数据的差距

孟德三笑 2017-06-02 09:06:34
比如说Oracle中有个table1,mysql中有个table2,table2的数据是由table1同步过来的,现在要核对两张表中的数据是否有差距,列出有差距的数据。即存在table1不存在table2的数据,或存在table2不存在table1的数据。
...全文
334 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jdsnhan 2017-06-05
  • 打赏
  • 举报
回复
如果仅比较一次,那可以用数据迁移工具迁移到某一个库中。 如果经常使用,用透明网关,oracle连接mysql,然后建立dblink。
小当家e 2017-06-04
  • 打赏
  • 举报
回复
跨库查询需要配置透明网关 我认为这篇文章可能可以提示你进行操作 http://www.cnblogs.com/liuqiyun/p/6589623.html
落落叶叶无声 2017-06-02
  • 打赏
  • 举报
回复
存在t1 不存在t2的数据: select * from table1 t1 where not exists (select 1 from table2 t2 where t1.id = t2.id ) 存在t2 不存在t1的数据: select * from table2 t2 where not exists (select 1 from table1 t1 where t1.id = t2.id )
孟德三笑 2017-06-02
  • 打赏
  • 举报
回复
引用 1 楼 u012557814 的回复:
存在t1 不存在t2的数据: select * from table1 t1 where not exists (select 1 from table2 t2 where t1.id = t2.id ) 存在t2 不存在t1的数据: select * from table2 t2 where not exists (select 1 from table1 t1 where t1.id = t2.id )
t1和t2是不同数据库的啊,亲
sxq129601 2017-06-02
  • 打赏
  • 举报
回复
跨数据库的查询只能通过配置透明网关查询

3,491

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 高级技术相关讨论专区
社区管理员
  • 高级技术社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧