What's the best way to diff two database backu

2019-05-11 12:55发布

问题:

I have two database backup files. I would like to know if there is any difference between the two. I could go row by row, field by field and do a diff (I'm not looking for differences in schema but rather data, although I expect the schema to remain the same).

Can I run some sort of checksum on the files, or do I have to go through the data itself to be 100% certain?

回答1:

Restore both backups to temporary database (might need to use 'WITH MOVE' to rename logical name), and then use a tool like RedGate's Data Compare.



回答2:

I think you will have to go through the data I would think as I would expect the file to have dates and other things in it that will mess up any check sums you could calculate.

Something like Apex SQL Data Diff is pretty good, but there are plenty of diff tools out there. You would need to restore the backups to temporary databases to be able to run this though.



回答3:

Some people have written scripts to do such things.

One I found - http://www.sql-server-performance.com/articles/dba/database_comparison_sp_p1.aspx