DB Matching Confirmation
I am thinking of checking the association between the DB result of the Java modified source and the DB result of the DB result of the modified source.
I would like to make sure that only two items in one DB table are different and the other items are the same, but there are 3 million records to be updated in DB.
I was going to compare Excel functions using EXACT functions, but Excel is broken because of the huge number of cases.Is there any good way?
How about this method?
If the two tables are in a situation where they can be combined, directly combine and confirm as follows.
If the two tables cannot be combined, they are output to a CSV file and confirmed as follows.(*When outputting, it must be sorted by key items.)
# The binding, output, and comparison methods vary by DBMS and environment, so we omit them.
Java doesn't matter at all, it basically feels like it's up to you.
If you want to make a "complete" check, you have to set up a DB server to keep the same data and compare it with the current snapshot dump (using transactions, etc.) by "creating 3 million data that are completely as expected."
I think the fact that there is such a request itself means that we don't trust the target code because of various factors in the equal.
Originally, I think it's enough to have a very small amount of data covering the update pattern.
You're talking about 3 million production data that actually matches, not 3 million patterns that need to be verified.
"If you want to match full data for inspection work, you can prepare ""appropriate data processed in multiple stages, if not in bulk"" and dump → text level comparison will be sufficient."
I can't read from the question whether I want to check multiple tables at the DB level or a single table. If it's a single table, how about the following?
·Create a table before modification
·Change the name of the table before modification to an appropriate name, and create the table after modification
"·JOIN the table before and after correction, check the match/mismatch of items 1, 2, and other items in the CASE statement, output ""matching"" and ""mismatch"" respectively, and then check it on DB or drop it on Excel etc."
If it's multiple tables instead of a single table, I think it's the same if you join and match items from multiple tables in the same way and spit out the required answer set.
Also, if the number of records is different before and after processing, I think the difference between the result of inner join and the result of outer join can be recognized as a new record (or deleted record).
© 2022 OneMinuteCode. All rights reserved.