我有2个数据库,只有DB1中的1个表和DB2中的2个表。 DB1.table1中的每条记录都被分割并分别存储在DB1.table1和DB @ .table2中。测试2个mysql数据库之间的内容
For example, DB1 has a table1 which looks like
Student_Name Id Address Attendance Marks
------------ -- ------- ---------- -----
John 1 90th st 70 90
The records that are transferred from DB1.table1 are stored in DB2.table and DB2.table2 in the following manner
DB2.table 1: Id Student_Name Address
-- ------------ -------
1 John 90th st
DB2.table 2: Id Attendance Marks
-- ---------- -----
1 70 90
我想写一个测试用例来确保所有来自DB1的数据都被复制到DB2。我已经写了一些查询来确定来自DB1的记录是否未复制到DB2。除了找出遗漏的记录之外,我还想检查每个记录的逐列,以确保DB1和DB2中的值相同。
从上面的例子,我想检查ID = 1,如果DB2.table1 Student_name = DB1.table1 Student_name,DB2.table1地址= DB1.table1地址,等等..
如果我有1000列?我应该写一个长脚本来检查每一列吗?没有。做这种测试的最好方法是什么?有没有我可以使用的工具,或者我应该写下脚本?
您正在寻找数据库复制? – JvdBerg
no ..我想测试每个值是否被正确复制 – ben