比较测试和生产中表格之间的数据 [英] compare data between tables in test and production
问题描述
如何在测试和生产环境中逐行,逐列地比较表和视图之间的数据
how to compare data between tables and views row by row , column by column in the test and production environment
推荐答案
您可以创建从测试到PROD。
做2个表的减去以获得差异
you can create a DB link from test to PROD.
do the minus of 2 tables to get the difference
如何比较表和视图之间的数据逐行,逐列,在测试和生产环境中
how to compare data between tables and views row by row , column by column in the test and production environment
请详细解释并给我你的tbl结构,如果有的关系和一些来自tbls的数据
pls explain in detail and give me thy tbl structure ,relations if any and some data from the tbls
您可以创建从测试到PROD的数据库链接。
做2个表的减去得到差异
you can create a DB link from test to PROD.
do the minus of 2 tables to get the difference
嗨
我不想要一个广义的结果,减去查询列出差异。
这里说如果我有
表a(测试)
col1(Pk)col2(Businesskey)col3(B usiness key)col4 col5
1 ABC XYZ 1 2
2 BCA XXX 5 6
3 AAA YYY 3 3
4 EFG HIJ 4 5
表a(产品)
col1(Pk)col2(Businesskey)col3(商业密钥)col4 col5
1 ABC XYZ 1 2
2 BCA YYY 5 6
3 AAA YYY 2 2
4 GFE JIH 7 8
如果结构看起来像这样(我的标识符是商业密钥而不是主键)
那么我想要结果显示像这样
/>
测试中存在的行而不是prod中的行
4 EFG HIJ 4 5
产品中存在的行而非测试
4 GFE JIH 7 8
两条都有但不匹配的行
2 BCA XXX 5 6(测试)
2 BCA YYY 5 6(产品)
3 AAA YYY 3 3(测试)
3 AAA YYY 2 2(产品)
>
i想要为它编写一个通用程序,它可以给我这些结果。程序的输入将是表名,列名和Db链接
你可以帮我解决这个问题
Hi
I dont want a generalised result , the minus query lists out al the differences.
here say if i have
table a (Test)
col1(Pk) col2(Businesskey) col3(Business key) col4 col5
1 ABC XYZ 1 2
2 BCA XXX 5 6
3 AAA YYY 3 3
4 EFG HIJ 4 5
table a (Prod)
col1(Pk) col2(Businesskey) col3(Business key) col4 col5
1 ABC XYZ 1 2
2 BCA YYY 5 6
3 AAA YYY 2 2
4 GFE JIH 7 8
if the structure looks some wat like this (My identifier are the business keys and not the Primary keys)
then i want the result dispalyed like this
Row existing in test and not in prod
4 EFG HIJ 4 5
Row existing in prod and not in test
4 GFE JIH 7 8
Rows Existing in both but not matching
2 BCA XXX 5 6 (Test)
2 BCA YYY 5 6 (Prod)
3 AAA YYY 3 3 (Test)
3 AAA YYY 2 2 (Prod)
i want to write a generic procedure for the same which can give me these results. the input of the procedure will be the table names , columns names and the Db link
Can u pls help me with this
这篇关于比较测试和生产中表格之间的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!