Summary of the invention
The present invention aims to provide a kind of emulation test method and system of database; When database carries out renewal of the equipment; Build a simulation test platform for new equipment, simulate original operation system flow process fully, running status, performance and the function accuracy of test original system under simulated environment.
Embodiments of the invention provide a kind of emulation test method of database on the one hand, are used for the parts that test database upgrades, and this emulation test method comprises:
The hardware and the software of the parts of config update on a test platform that is different from database are provided with the parameter of hardware and software;
In test platform deploy database, the miscellaneous part except that the parts that upgrade, consistent in other parts and the database;
Extract the business datum of very first time point in the database, be saved in the test platform, as the test benchmark data;
After through the preset time section, extract the business datum of second time point in the database, be saved in the test platform, as test termination data;
Database manipulation message in the extraction database between the very first time point and second time point generates test file on test platform;
Utilizing test file, is that the basis is tested with the test benchmark data on test platform, obtains test result data;
Test result data and test termination data are compared, if both are identical, the parts that expression is upgraded are through test, if both are different, the parts that expression is upgraded are not through test.
According to an embodiment, this database comprises that long-range calamity is equipped with database, and the business datum of the very first time point and second time point is to be equipped with the database from long-range calamity to extract.
According to an embodiment, database manipulation message comprises the Transaction Information and the data manipulation record of increment.
According to an embodiment, test file comprises each the transaction information and each bar data manipulation record between the very first time point and second time point.
According to an embodiment, on test platform, be that the mode that comprises with data readback is tested on the basis with the test benchmark data, carry out information trading, carry out data manipulation one by one by pen.
Embodiments of the invention provide a kind of emulation test system of database on the other hand, are used for the parts that test database upgrades, and this emulation test system comprises:
Test platform is a test platform that is different from database, and the hardware of the parts of config update and software on the test platform are provided with the parameter of hardware and software; Also dispose on the test platform in the database, the miscellaneous part except that the parts that upgrade, and consistent in other parts and the database;
The data extract device extracts the business datum that the very first time puts in the database, and, after through the preset time section, extract the business datum of second time point in the database;
Data storage device will put the business datum of being extracted the very first time and save as the test benchmark data, and the business datum that second time point is extracted saves as test termination data;
The operation information extraction element, the database manipulation message in the extraction database between the very first time point and second time point, and on test platform, generate test file;
Proving installation utilizes test file, on test platform, is that the basis is tested with the test benchmark data; Obtain test result data; And test result data and test termination data are compared, if both are identical, the parts that expression is upgraded are through test; If both are different, the parts that expression is upgraded are not through test.
According to an embodiment, database comprises that long-range calamity is equipped with database, and the data extract device is equipped with the business datum of extracting the very first time point and second time point the database from long-range calamity.
According to an embodiment, the database manipulation message that the operation information extraction element extracts comprises the Transaction Information and the data manipulation record of increment.
According to an embodiment, the test file that the operation information extraction element generates comprises each the transaction information and each bar data manipulation record between the very first time point and second time point.
According to an embodiment, proving installation is that the mode that comprises with data readback is tested on the basis with the test benchmark data on test platform, carries out information trading, carries out data manipulation one by one by pen.
Technical scheme of the present invention is set up a simulation test platform, and this platform is except the parts that upgrade, and other parts are all consistent with original database; On this simulation test platform; From raw data base, extract the actual services data of a period of time, be the basis, utilize this platform to reduce one by one and simulate all data trades of reforming with the data of initial time point; The data of comparison concluding time point and the test result data of simulation test platform; And with the operation of mode complete simulation test platform of video playback, validation database has finally guaranteed the disposable migration success of database in the later running status of updating component, performance and accuracy.
Embodiment
When the part parts of database upgrade, the most important thing is that the parts of this renewal must be well compatible with the miscellaneous part that is present in before in the database well, guarantee the data in the database, the continuity of database function and integrality.
Parts in order to ensure upgrading can be dissolved in the database well, need test the parts of these renewals.In the embodiments of the invention, for the parts of these renewals provide simulation test platform, on this test platform; Except the parts that upgrade; Complete with the existing database of remaining parts is consistent, therefore, and the database after this test platform in fact just is equivalent to upgrade.In addition; In the embodiments of the invention, will from original database, gather two groups of business datums, one group is the real business datum of original database on sometime; Another group is through after the regular hour, the real business datum on original database.In addition, also will gather in the above-mentioned time period data manipulation record that original database carried out.Afterwards, (database after in fact being equivalent to upgrade) is the basis with one group of business datum of at first gathering on emulation platform, carries out uniform operation according to the data manipulation record that original database carried out, and obtains one group of test data.One group of business datum that this group test data and back are gathered compares.Can learn that can the database after the renewal accomplish continuity and consistance with the legacy data storehouse in data and function aspects.
Because this kind test platform, except the parts that needs upgrade, remaining all parts, all consistent with original database, and the test of being carried out also is based on interior actual services data of a period of time and carries out.And the process of test is with the operation in mode complete simulation legacy data storehouse of video playback, thereby can verify running status, performance and the accuracy of the database after the renewal well.
Fig. 1 has disclosed the process flow diagram of the emulation test method of database according to an embodiment of the invention, and is as shown in Figure 1, and this method 100 is used for the parts that test database upgrades, and comprises following step:
102. the hardware and the software of the parts of config update on a test platform that is different from the legacy data storehouse are provided with the parameter of hardware and software.
104. in test platform deploy database, the miscellaneous part except that the parts that upgrade, consistent in other parts and the database.Through after the step 102 and 104, in fact test platform has formed the database after the renewal, can simulate all functions of the database after the renewal exactly.
106. extract the business datum of very first time point in the legacy data storehouse, be saved in the test platform, as the test benchmark data.
108. after through the preset time section, extract the business datum of second time point in the legacy data storehouse, be saved in the test platform, as test termination data.
110. the database manipulation message in the extraction legacy data storehouse between the very first time point and second time point generates test file on test platform.
Step 106 and 108 is extracted the business datum of legacy data storehouse on two time points respectively, and the data of being extracted are real business datums.And step 110 was extracted in the above-mentioned time period, the information of the data manipulation that the legacy data storehouse is carried out.Extraction operation through above-mentioned three steps just can obtain: the legacy data storehouse through these operations that step 110 is extracted, has obtained the business datum of second time point on the basis of the business datum of very first time point.Database after the renewal should be consistent with the legacy data storehouse on the data and on the function; Therefore; Database after the renewal (simulating with test platform) is on the basis of the business datum that step 106 is extracted; After the operation that execution in step 110 is extracted successively, also should obtain the corresponding to result of business datum who extracts with step 108.If both are inconsistent, the database (simulating with test platform) after then explanation is upgraded is present in inconsistent place, legacy data storehouse, needs further to revise.
It is very important for accomplishing test with the actual services data that stop (second time point) constantly to gather a certain initial time (very first time point) on the legacy data storehouse, and above-mentioned data of being gathered for twice are respectively as the reference data of test and the test termination data that finally is used to compare.
When gathering the business datum in legacy data storehouse; Consider etc. that equipment to be updated seems more outmoded comparatively speaking; Carry out extra acquisition operations and can increase the burden of database; In order not influence the normal running of database as far as possible, comprise that in the legacy data storehouse long-range calamity is equipped with under the situation of database, the business datum of the very first time point and second time point all is equipped with the database from long-range calamity to be extracted.Long-range calamity is equipped with the main business that database relatively is independent of database, and database can periodically be equipped with database to long-range calamity and carry out complete business datum backup.Therefore, to be equipped with the true letter of business datum in the database be consistent with database to long-range calamity fully.As long as between the very first time point and second time point, exist the database more than twice to be equipped with the operation that database carries out complete business datum backup, be equipped with just can access the database from long-range calamity and accomplish the needed business datum of test of the present invention to long-range calamity.If original database has the SAN storage system of higher-end; Then can directly utilize the snapshot functions of high-end memory device; Be snapshot of database " bat "; Capturing service data from corresponding snapshot database then, and be saved in the test platform as the reference data of test and the test termination data of final comparison.
Getting back to Fig. 1, continuing reference method 100, this method continues to carry out following step:
112. utilize test file, on test platform, be that the basis is tested with the test benchmark data, obtain test result data.Function in order to ensure data updated storehouse (by the test platform simulation) is in full accord in the legacy data storehouse, must on test platform, carry out and the on all four operation steps in legacy data storehouse.Extract the database manipulation message between the point of very first time in the legacy data storehouse and second time point in the step 110, and on test platform, generated test file.This database manipulation message comprises the Transaction Information and the data manipulation record of increment.And formed test file comprises each transaction information and each bar data manipulation record between the very first time point and second time point.Special, for the transaction data between the very first time point and second time point, and need be reduced to original transaction request, carry out playback and reform.Like this, can guarantee test platform with the on all four environment in legacy data storehouse under operate, guarantee test accuracy.
114. test result data and test termination data are compared, if both are identical, the parts that expression is upgraded are through test, if both are different, the parts that expression is upgraded are not through test.This test is the mode with data readback, carries out information trading, carries out data manipulation one by one by pen.Since the database after the test platform renewal of simulating with the on all four environment in legacy data storehouse under operate (identical primary data, identical operations process), therefore, the result who obtains should be on all four.If data are consistent, the database after then explanation is upgraded can guarantee and the data continuity and the consistance in legacy data storehouse, can think and pass through test.If test result data and test termination data are inconsistent; Database after then explanation is upgraded does not keep in full accord with the legacy data storehouse; Database after this renewal also need be adjusted; Otherwise therefore the operation of database is chaotic, when test result is inconsistent, thinks not through test.
With reference to shown in Figure 2, embodiments of the invention also provide a kind of emulation test system of database, are used to realize the emulation test method of above-mentioned database, and this system 200 comprises:
Test platform 202, the hardware of the parts of config update and software on the test platform are provided with the parameter of hardware and software; Also dispose on the test platform in the database, the miscellaneous part except that the parts that upgrade, and consistent in other parts and the database.
Data extract device 204 extracts the business datum that the very first time puts in the database 201, and, after through the preset time section, extract the business datum of second time point in the database 201.If database comprises long-range calamity and is equipped with database that then data extract device 204 is equipped with the business datum of extracting the very first time point and second time point the database from long-range calamity.If database is supported the SAN storage system, then data extract device 204 utilizes the mode of snapshot to extract.
Data storage device 206 will put the business datum of being extracted the very first time and save as the test benchmark data, and the business datum that second time point is extracted saves as test termination data.
Operation information extraction element 208, the database manipulation message in the extraction database 201 between the very first time point and second time point, and on test platform 202, generate test file.Wherein, the database manipulation message of operation information extraction element 208 extractions comprises the Transaction Information and the data manipulation record of increment.And the test file that operation information extraction element 208 generates comprises each transaction information and each bar data manipulation record between the very first time point and second time point.
Proving installation 210 utilizes test file, on test platform 202, is that the basis is tested with the test benchmark data; Obtain test result data; And test result data and test termination data are compared, if both are identical, the parts that expression is upgraded are through test; If both are different, the parts that expression is upgraded are not through test.Wherein, this proving installation 210 is that the mode that comprises with data readback is tested on the basis with the test benchmark data on test platform 202, carries out information trading, carries out data manipulation one by one by pen.
Need to prove that above-mentioned associated methods 100 described details all are applicable to this system 200, no longer repeat explanation here.
Adopt technical scheme of the present invention, have following advantage:
1) test data is true: the reference data and the test termination data of test usefulness are the actual services data that come from database, have guaranteed in real environment, to test the parts that upgrade.And test process is data trade information and the operation steps that obtains through inverse algorithms, has reflected the transaction situation under the true environment.Can know more than comprehensive that it all is the maximum applying to True Data that the data of test platform are prepared, rather than based on other machine-processed simulated datas.Test process adopts True Data, has improved the reliability and the representativeness of test greatly.
2) data are carried out based on real time sequencing: in the data implementation, carry out successively according to the operation steps of being extracted fully, truly reflect data change each time and true environment in the change procedure of data in full accord.
3) comparison other of test result is a True Data: the test result data that obtains after test process finishes, compare with test termination data from database actual services data, judge test result whether with congruence.Because test termination data is real data, has suitable authority, and, come test process is analyzed, and judge that whether test is successful, improved the validity of test greatly through comparing with True Data.
4) repeatability of test: as long as each test benchmark data of passing through are recovered test platform to original state, repeat the playback test again, just can compare with test termination data again, come the accuracy and the performance situation of verification system.Like this, just can progressively finely tune, and test is relatively made up to obtain best operation configuration repeatedly device parameter or applied logic.