Our database is poorly designed all the way around (we inherited it). I've reworked the schema to something useable and maintainable. Quite a few tables and columns have been dropped, many columns have moved and most tables and columns have been renamed. Some datatypes have been changed also.
I've extracted all the queries from our webapps and we've started rewriting them. Our DBA is able to migrate the old data to the new schema, we think. To be sure we need to test each query by comparing the old results with the new.
How can we test such a wholesale migration? I need to be able to specify parameters, and map old tables/columns to new tables/columns. With hundreds of queries this is a daunting task. I could write something myself but I already have a lot of demands on my time so using an existing tool is preferable.
Thanks!
I've had to do this ... and well it was easy because i rewrote the entire application ;)
Many queries sounds like basic operations such as select,insert,updates have not been abstracted in functions - maybe that can help clean up the mess before adapting.
Now for the testing:
You need a test script that will a) run all your queries b) store output of all selects for comparison
backup your test db @ state 0, clear the general query log
play around your application using all the deletes, selects and updates,
copy paste that log, take every single select and precede it with a "Create table temptable_xyz" (or of course SELECT into temptable_xyz .. depends on the available syntax)
run on both databases, test db @ state 0 and test db @ state 0 after migration script
compare
This should do it if you can make sure you used every feature in every app.
GL - nothing like making existing stuff better ;)