This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2016-145134, filed on Jul. 25, 2016, the entire contents of which are incorporated herein by reference.
The embodiment discussed herein is related to a database control method, a database control apparatus, and a recording medium.
When a control program of a related art operational database is updated, a person such as an administrator verifies whether the update is done normally.
An access request for the database is captured in this verification. The captured access request is then replayed in a for-verification database, which operates in accordance with the updated control program, and the result of replay is used for the verification of whether the update is done normally. As for the related art, Japanese Laid-open Patent Publication No. 2001-202101 and International Publication Pamphlet No. WO 2011/042961 have been disclosed, for example.
The above related art verification has been however complex since various works such as capturing and replaying an access request have to be performed prior to the verification. In view of the above, it is desired to achieve easy evaluation of effects on a database given by applying an update program.
According to an aspect of the invention, a database control method executed by a processor included in a control apparatus coupled to a terminal apparatus, the database control method includes generating a second database in which recorded contents of a first database are copied, when detecting an update program which is used to update a first control program configured to control the first database set as a transmission destination of a request for processing transmitted by the terminal apparatus; generating a second control program by updating the first control program using the update program; setting the transmission destination of the request to both the first database and the second database; executing the processing on the first database using the first control program; executing the processing on the second database using the second control program; setting the transmission destination to only the second database among the first database and the second database when a first result of the processing on the first database and a second result of the processing on the second database match; and executing processing on the second database using the second control program when receiving the request from the terminal apparatus.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
Hereinafter, descriptions are given for an embodiment with reference to the drawings.
A database control apparatus 100 of the embodiment includes a database service section 110 and a database control processor 120.
The database service section 110 of the embodiment includes a processing execution unit 111, a database 112, a log database 113, and a request distribution unit 114. Upon receiving an execution request for processing on the database 112, the database service section 110 allows the request distribution unit 114 to distribute the execution request (access request) to the processing execution unit 111. The processing execution unit 111 then outputs a result of executing the control program. The log database 113 stores log information that represents a history of processing of the processing execution unit 111.
Upon detecting an update program 150 of a control program, which achieves processing on the database 112, the database control processor 120 of the embodiment generates a for-verification database service section 140 in the database service section 110.
The for-verification database service section 140 includes a for-verification processing execution unit 141, a for-verification database 142, a for-verification log database 143, and a for-verification request distribution unit 144. The for-verification processing execution unit 141 executes processing on the for-verification database 142 in accordance with an updated control program, which is the control program of the database service section 110 updated by the update program 150.
The for-verification database 142 is generated from a snapshot 160, which is information representing an operation state of the database 112. In other words, the for-verification database 142 is a copy of the database 112 at the generation of the for-verification database service section 140. The for-verification log database 143 is a copy of the log database 113.
The for-verification request distribution unit 144 has the same function as that of the request distribution unit 114. After the database service section 110 is deleted by the later-described processing, the request distribution unit 114 is replaced with the for-verification request distribution unit 144.
Upon receiving the processing execution request after generating the for-verification database service section 140, the database control processor 120 allows the request distribution unit 114 to distribute the processing execution request to both the database service section 110 and the for-verification database service section 140. The database control processor 120 then obtains results of processing execution from both the database service section 110 and the for-verification database service section 140, and compares the results.
The database control processor 120 uses the comparison results to evaluate whether the processing results are consistent after the update of the control program.
With the above processing, the embodiment achieves easy evaluation of effects on the database given by applying the update program.
When the processing results are consistent, the database control processor 120 of the embodiment deletes the database service section 110 and sets the updated for-verification database service section 140 instead of the database service section 110. When the processing results are inconsistent, the database control processor 120 may delete the for-verification database service section 140.
Although the database service section that provides a processing result corresponding to an execution request for processing on the database in the database control apparatus 100 is only the database service section 110 in the example of
A description is given below for the database control apparatus 100 of the embodiment.
The database control apparatus 100 of the embodiment includes an input device 11, an output device 12, a drive device 13, an auxiliary recording device 14, a memory device 15, a computing processing device 16, and an interface device 17, while these devices are coupled to each other via a bus B.
The input device 11 is for inputting various pieces of information and is implemented by a keyboard, a mouse, or the like, for example. The output device 12 is for outputting various pieces of information and is implemented by a display or the like, for example. The interface device 17 is used for coupling to the network and includes a modem, a LAN card, and the like.
The database control program is at least part of various programs controlling the database control apparatus 100. The database control program is provided through distribution of a recording medium 18 or by downloading from the network, for example. The recording medium 18 that records the database control program may be various types; which may be a recording medium such as a CD-ROM, a flexible disk, a magnetic optical disk, or the like that records information optically, electrically, or magnetically, or may be a semiconductor memory such as a ROM, a flash memory, or the like that records information electrically.
Once the recording medium 18 that records the database control program is set in the drive device 13, the database control program is installed from the recording medium 18 into the auxiliary recording device 14 via the drive device 13. The database control program downloaded from the network is installed into the auxiliary recording device 14 via the interface device 17.
The auxiliary recording device 14 stores the installed database control program while storing requisite files, data, and the like. When the computer is activated, the memory device 15 reads the database control program from the auxiliary recording device 14 and stores the program. The computing processing device 16 then executes the later-described various pieces of processing in accordance with the database control program stored in the memory device 15.
Referring to
The database 112 in
The log database 113 stores log information that represents a history of the processing executed on the database 112. The log information includes information items: ID, insert datetime, a value of the item “XX”, and a value of the item “YY”. A value of the item “ID” represents an identifier of the log information. A value of the item “insert datetime” represents the time when the data is inputted to the database 112. In other words, the value of the item “insert datetime” is a time stamp representing the time when the values of the items “XX” and “YY” are inputted. Thus, the time stamp matches the value of the item “time” included in the processing result information.
Like the database 112, the for-verification database 142 in
Now, for the sets of log information respectively of the log database 113 and the for-verification log database 143, a description is given for the case where the values of the items “ID” match but the times represented by the time stamps differ.
Log information 113-1 of the log database 113 in
Log information 143-1 of the for-verification log database 143 in
Since the IDs of the log information 113-1 and the log information 143-1 match, it is accordingly understood that these sets of information represent the history of executing the same processing respectively on the database service section 110 and the for-verification database service section 140.
In the database 112, the values of the items “XX” and “YY” of processing result information 112-1 are the values of the items “XX” and “YY” corresponding to the log information 113-1. The value of the item “time” of the processing result information 112-1 matches the time stamp “1/1 00:01” of the log information 113-1. It is accordingly understood that the processing result information 112-1 corresponds to the log information 113-1.
In the for-verification database 142, the values of the items “XX” and “YY” of processing result information 142-1 are the values of the items “XX” and “YY” corresponding to the log information 143-1. The value of the item “time” of the processing result information 142-1 matches the time stamp “1/1 00:02” of the log information 143-1. It is accordingly understood that the processing result information 142-1 corresponds to the log information 143-1.
Here, although the results are obtained by executing the same processing, the values of the items “time” of the processing result information 112-1 and the processing result information 142-1 do not match.
This time difference occurs because of the nature of the network from when the processing execution request is distributed by the request distribution unit 114 until when the processing is actually executed.
In the embodiment, this time difference is corrected, whereby the times are matched by the later-described processing of the database control processor 120, and thereafter, the consistency of the sets of processing result information of the database 112 and the for-verification database 142 is verified.
Next, referring to
The database control processor 120 of the embodiment includes an update detection unit 121, a for-verification generation unit 122, a distribution destination setting unit 123, and a consistency evaluation unit 124.
The update detection unit 121 of the embodiment detects input of the update program 150, which is used for updating the control program implementing the processing execution unit 111. The update program of the embodiment is a patch applied to the control program, a program that upgrades the control program, or the like, for example. The update program 150 may be given by the administrator and the like of the database control apparatus 100, or may be distributed from an external apparatus coupled to the database control apparatus 100, for example.
Upon detecting the update program, the for-verification generation unit 122 of the embodiment generates in the database service section 110 the for-verification database service section 140, which is used for verification of effects on the database 112 given by applying the update program. In other words, the for-verification generation unit 122 generates the for-verification database service section 140 for determining whether the update program is applicable.
The for-verification generation unit 122 specifically generates the updated control program that is the control program updated by the update program. In the embodiment, the for-verification processing execution unit 141 is implemented by executing the updated control program.
The for-verification generation unit 122 obtains the snapshot 160 indicating a state of the database 112. Then, the for-verification generation unit 122 generates the for-verification database 142, which has a copy of the recorded contents of the database 112, based on the snapshot 160. The for-verification generation unit 122 generates the for-verification log database 143, which has a copy of the recorded contents of the log database 113. The for-verification generation unit 122 generates the for-verification request distribution unit 144, which has the same functions as that of the request distribution unit 114.
Upon generation of the for-verification database service section 140, the distribution destination setting unit 123 allows the request distribution unit 114 to distribute the received processing execution request to both the database service section 110 and the for-verification database service section 140. In the embodiment, the for-verification request distribution unit 144 of the for-verification database service section 140 may be allowed to distribute the processing execution request.
The consistency evaluation unit 124 of the embodiment compares the results of the processing executed in both the database service section 110 and the for-verification database service section 140 and evaluates the consistency of the results. The consistency evaluation unit 124 specifically compares the processing result information stored in the database 112 and the processing result information stored in the for-verification database 142 and determines whether their sets of information match. Then, when all the compared sets of processing result information match, the consistency evaluation unit 124 deletes the database service section 110. The consistency evaluation unit 124 thereafter sets the updated for-verification database service section 140 instead of the database service section 110.
Referring to
The consistency evaluation unit 124 of the embodiment includes a verification time setting unit 211, a log information comparison unit 212, a time correction unit 213, a processing result comparison unit 214, a comparison result output unit 215, and a deletion unit 216.
The verification time setting unit 211 of the embodiment sets a verification time for performing verification. In other words, the verification time setting unit 211 sets a term of executing processing in both the database service section 110 and the for-verification database service section 140. The verification time may be set by the administrator and the like of the database control apparatus 100, for example. The verification time is preferably set to a time during which a new update program is not issued, for example. The verification time may specifically be few hours, for example.
The log information comparison unit 212 compares the sets of log information respectively stored in the log database 113 and the for-verification log database 143. The log information comparison unit 212 specifically compares the time stamps respectively included in the two sets of log information.
When the two time stamps do not match, the time correction unit 213 rewrites the value of the item “time” in the processing result information, which corresponds to the log information in the for-verification database 142, to the time that is represented by the time stamp included in the log information obtained from the log database 113.
The processing result comparison unit 214 compares the processing result information stored in the database 112 and the processing result information stored in the for-verification database 142. In other words, the processing result comparison unit 214 compares values of the result of processing execution by the database service section 110 and values of the result of processing execution by the for-verification database service section 140.
The comparison result output unit 215 outputs the comparison result obtained by the processing result comparison unit 214. Specifically, when the two values of the processing results match for example, the comparison result output unit 215 may output a message or the like which notifies of replacement of the for-verification database service section 140 with the database service section 110. When the two values of the processing results do not match for example, the comparison result output unit 215 may output a message or the like which asks for cancellation of application of the update program.
The deletion unit 216 deletes the database service section 110 or the for-verification database service section 140.
Next, referring to
The database control processor 120 of the embodiment allows the update detection unit 121 to detect the update program of the existing control program (S601). The database control processor 120 subsequently allows the for-verification generation unit 122 to generate the updated control program, which is updated by the update program. The for-verification generation unit 122 generates the for-verification database 142 and the for-verification log database 143 from the database 112 and the log database 113, respectively. The for-verification generation unit 122 generates the for-verification request distribution unit 144 (S602). In other words, the for-verification generation unit 122 generates the for-verification database service section 140.
Upon input of the processing execution request to the database control apparatus 100, the database control processor 120 subsequently allows the distribution destination setting unit 123 to distribute this execution request to the database service section 110 and the for-verification database service section 140 (S603). In other words, upon input of the processing execution request, the distribution destination setting unit 123 allows both the control program and the updated control program to execute the processing.
The database control processor 120 subsequently allows the consistency evaluation unit 124 to evaluate the consistency of the results of processing respectively executed by the control program and the updated control program (S604), then ends the processing.
Next, referring to
Upon generation of the for-verification database service section 140, the consistency evaluation unit 124 of the embodiment allows the verification time setting unit 211 to set the verification time (S701).
The consistency evaluation unit 124 subsequently allows the log information comparison unit 212 to determine whether new sets of log information are respectively stored in the log database 113 and the for-verification log database 143 (S702). In other words, the consistency evaluation unit 124 determines whether the processing is executed in the database service section 110 and the for-verification database service section 140 when both are notified of the processing execution request.
When no new sets of log information are stored in S702, the consistency evaluation unit 124 waits until new sets of log information are stored.
When new sets of log information are stored in S702, the log information comparison unit 212 obtains sets of log information, in which their IDs match, respectively from the log database 113 and the for-verification log database 143 (S703). The log information comparison unit 212 subsequently determines whether the time stamps included in the obtained two sets of log information match (S704).
When the time stamps do not match in S704, the consistency evaluation unit 124 allows the time correction unit 213 to correct the time included in the processing result information of the for-verification database 142 (S705), then proceeds to later-described S706.
A description is given below for processing in S705.
The time correction unit 213 obtains the time stamp included in the log information, which is obtained from the for-verification log database 143 in S703. The time correction unit 213 subsequently specifies the processing result information, in which the obtained time stamp and the value of the item “time” match, from the for-verification database 142. The time correction unit 213 then replaces the value of the item “time” of the processing result information specified from the for-verification database 142 with the time represented by the time stamp, which is included in the log information obtained from the log database 113 in S703.
When the time stamps match in S704, the consistency evaluation unit 124 compares the values of the processing results of the database 112 and the for-verification database 142 by the processing result comparison unit 214 (S706).
A description is given below for processing in S706.
The processing result comparison unit 214 specifies the sets of processing result information in which the values of the items “time” match the time stamp, which is included in the log information obtained in S703, from the database 112 and the for-verification database 142, respectively. The processing result comparison unit 214 then compares the values of the items “XX” and “YY” included in each set of the specified processing result information.
The consistency evaluation unit 124 subsequently determines whether the comparison results match (S707). When the comparison results do not match in S707, the consistency evaluation unit 124 proceeds to later-described S711.
When the comparison results match in S707, the consistency evaluation unit 124 determines whether the verification time is already passed (S708). When the verification time is not passed yet in S708, the consistency evaluation unit 124 returns to S702.
When the verification time is already passed in S708, the consistency evaluation unit 124 allows the comparison result output unit 215 to display a message, which indicates that the update program is applicable, on a display unit or the like of the database control apparatus 100 (S709).
The consistency evaluation unit 124 subsequently allows the deletion unit 216 to delete the database service section 110 (S710), then ends the processing.
The consistency evaluation unit 124 may allow the comparison result output unit 215 to display a screen for choosing whether to delete the database service section 110 and to execute deletion of the database service section 110 when “delete” is chosen.
When the comparison results do not match in S707, the consistency evaluation unit 124 allows the comparison result output unit 215 to display an error message, which indicates that the results of processing of the pre-update control program and processing of the post-update control program do not match (S711).
The consistency evaluation unit 124 subsequently determines whether deletion of the for-verification database service section 140 is commanded (S712). When no command of deletion is in S712, the consistency evaluation unit 124 waits until deletion is commanded.
When deletion is commanded in S712, the consistency evaluation unit 124 allows the deletion unit 216 to delete the for-verification database service section 140 (S713), then ends the processing.
As described above, in the embodiment, evaluation of consistency of the processing results of both the database service section 110 and the for-verification database service section 140 is achieved every time the both execute the processing.
Referring to
In the state illustrated in
In the state illustrated in
Upon receiving the processing execution request, the database control apparatus 100 in the state in
For the database service section 110 and the for-verification database service section 140, upon storing both the processing result information and the log information into each database service section, the database control processor 120 determines consistency of the sets of processing result information, respectively. That is, the database control processor 120 determines whether these sets of processing result information respectively stored into the database 112 and the for-verification database 142 match.
Every time receiving the execution request, the database control apparatus 100 of the embodiment in the state in
In the embodiment, the above-described processing of determining consistency is performed during the verification time set in advance.
When the two sets of processing result information as a target for comparison do not match in the state in
The case where the two sets of processing result information do not match represents that it is unable to obtain the processing result which is the same as that before the update because of updating the control program. Thus, when the sets of the processing result information do not match, the embodiment deletes the for-verification database service section 140 so that the for-verification database service section 140 will not be updated.
In the state in
The database control apparatus 100 illustrated in
In this case, upon receiving the processing execution request, the database control processor 120 transmits this execution request to the for-verification database service section 140 and allows the processing execution unit 141 to execute the processing.
As described above, according to the embodiment, upon detecting the update of the control program controlling the database, the updated control program and the verification database are automatically generated. Also, in the embodiment, consistency of the processing result in a pre-update environment and the processing result in the post-update environment is automatically evaluated. When they are consistent, the pre-update environment is deleted and replaced with the post-update environment.
Thus, the embodiment achieves omission of verification performed by the database administrator and easy evaluation of effects on the database given by applying the update program.
Next, referring to
In
In
When the values of the items “time” in the two sets of processing result information differ as described above, determination on these two sets of processing result information that they are different may be made at comparison performed by the processing result comparison unit 214. This leads wrong determination that they are not consistent.
Thus, the time correction unit 213 in the embodiment matches up the values of the items “time” of the two sets of processing result information with reference to the sets of log information.
In
In
A description is given below for the case of determining consistency of the processing result information 112-1 and the processing result information 142-1.
The consistency evaluation unit 124 allows the log information comparison unit 212 to obtain the sets of log information, in which their IDs match, respectively from the log database 113 and the for-verification log database 143. Here, the sets of log information 113-1 and 143-1 in which their IDs are “001” are obtained.
Next, the log information comparison unit 212 compares the time stamps included in the sets of log information 113-1 and 143-1. The time stamp included in the log information 113-1 is “1/1 00:01”. The time stamp included in the log information 143-1 is “1/1 00:02”. They do not match.
Thus, the time correction unit 213 specifies the processing result information 142-1 in which the value of the item “time” matches the time stamp “1/1 00:02” of the log information 143-1, from the for-verification database 142.
The time correction unit 213 subsequently replaces the value of the item “time” included in the processing result information 142-1 with the time stamp “1/1 00:01” of the log information 113-1, and thus the processing result information 142-1 is replaced with the processing result information 142A-1 illustrated in
The consistency evaluation unit 124 subsequently allows the processing result comparison unit 214 to specify the sets of processing result information 112-1 and 142-1, in which the values of the items “time” match, respectively from the database 112 and the for-verification database 142. The consistency evaluation unit 124 then compares the values of the items “XX” and “YY” of those sets of information.
The values of the items “XX” and “YY” of the processing result information 112-1 are “A” and “B”, respectively. The values of the items “XX” and “YY” of the processing result information 142-1 are also “A” and “B”, respectively. It is accordingly seen that the processing result information 112-1 and the processing result information 142-1 match.
The consistency evaluation unit 124 of the embodiment also replaces the values of the items “time” of the sets of processing result information 142-2 and 142-3, respectively, by the same way, and thus those sets of information are replaced with the sets of processing result information 142A-2 and 142A-3, respectively. The consistency evaluation unit 124 then compares the processing result information 112-2 with the processing result information 142A-2 and the processing result information 112-3 with the processing result information 142A-3, respectively.
As described above, in the embodiment, the difference of time, which is due to the nature of the network, between the processing result information stored in the database 112 and the processing result information stored in the for-verification database 142 is corrected. Thus, a risk of wrong determination of consistency at verification is mitigated.
Next, referring to
A screen 101 illustrated in
When the button 103 is selected for example, the database control processor 120 of the embodiment may allow the deletion unit 216 to delete the database service section 110.
The screen 101A illustrated in
The inapplicable update program represents that the processing results of the pre-update environment and the post-update environment are not consistent.
When the button 103A is selected for example, the database control processor 120 of the embodiment may allow the deletion unit 216 to delete the for-verification database service section 140.
In the embodiment, because it is able to delete an environment (database service section) not being used, for example, in a case where using a storage area of the database control apparatus 100 has to be charged, a risk of being charged for the database service section not being used may be migrated.
In the above-described embodiment, after the for-verification database service section 140 is generated by the database control processor 120, the processing result information of the database 112 and the processing result information of the for-verification database 142 are compared every time the processing is executed based on the execution request. However, it is not limited thereto.
In the embodiment, comparison of the processing result information of the database 112 and the processing result information of the for-verification database 142 may be started after a predetermined number of sets of log information are accumulated in the log database 113 and the for-verification log database 143. In the embodiment, when the verification time is passed before the predetermined number of sets of log information are accumulated for example, the verification time may be extended.
All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiment of the present invention has been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2016-145134 | Jul 2016 | JP | national |