In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The previous article, "Export record quantity comparison-Software testing method (1)", mainly introduced the accurate comparison between the number of records of data export results and the number of records of the original normal database, and the relevant bug of less data exported by test software.
The purpose of this test method is to compare the internal data differences of table records more accurately, the comparison of the number of records is only a necessary condition for restoring accuracy, and whether the internal field data contents of records are consistent is the ultimate goal of comparison.
First, the purpose of the test: in many cases, the data export is measured by the number of records. In some cases, the export of the number of data records is consistent, but there are differences in the internal data of the records, such as some numeric fields. Once there are differences, the results will be inaccurate. The purpose of this test outline is to compare whether there are differences in the data recorded in the table, once there are differences, find ways to modify the software to achieve a more accurate recovery effect.
Second, testing tool: tablediff.exe, this tool is used for table internal data comparison, is a tool that comes with MS SQL Server. You can search the path where this file is located on your machine.
Third, build a data table to compare SQL statements:
Use UFDATA_006_2015_ is so cool.
SELECT 'tablediff.exe-sourceserver 127.0.0.1\ SQL2008R2-sourceuser sa-sourcepassword dst-sourcedatabase UFDATA_006_2015_ Cool-sourceschema dbo-sourcetable' + object_name (id)
+'- destinationserver 127.0.0.1\ SQL2008R2-destinationuser sa-destinationpassword dst-destinationdatabase UFDATA_006_2015_ cool _ out-destinationschema dbo-destinationtable'
+ object_name (id) +'- et Difference-f c:\ data\'+ object_name (id) + '.sql' as SQL
From sysObjects where type ='U'
Parsing:-sourceserver 127.0.0.1\ SQL2008R2 original database instance
Sourceuser sa-sourcepassword dst-sourcedatabase UFDATA_006_2015_ is so cool
Sa is the original database user, dst is the password of the sa user, you change according to your own settings, the original database of UFDATA_002_2017_ is the original database.
-destinationserver 127.0.0.1\ SQL2008R2-destinationuser sa-destinationpassword dst-destinationdatabase UFDATA_002_2017_ good library export
127.0.0.1\ SQL2008R2 is the target database instance, which can be compared across instances. Sa dst UFDATA_006_2015_ cool _ out is the user name, password and library name of the target database.
F c:\ data\'+ object_name (id) + '.sql' this is to compare the results, write c:\ data directory, named after the table.
Fourth, the method of sentence execution:
Find the tablediff.exe file path
In cmd mode, enter cmd on the path and enter enter
Copy the resulting SQL statement and paste it on the cmd window.
Build the c:\ data directory and modify the permissions
Set sa login and password
Copy the resulting SQL statement and paste it on the cmd window:
Run automatically:
5. Wait for the running result
The copyright of this article belongs to Magic data.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.