Embodiment 1
The embodiments of the invention provide a kind of method that database script issues result.
Fig. 1 is the flow chart of the method for database script issue result according to embodiments of the present invention.As shown in figure 1, should
It is as follows that method includes step:
Step S101, obtains the execution journal of database script.
Specifically, in above-mentioned steps S101, the execution journal of database script is worked as in the process for performing database script
Middle generation.By the implementation procedure of direct monitoring data storehouse script, so as to obtain the execution journal produced in implementation procedure.
Step S103, the execution journal that database script is performed when making a mistake is merged, and generates journal file.
Specifically, in above-mentioned steps S103, to carry out unified judgement for the implementing result of these scripts, thus by this
Execution error log under a little catalogues is all uniformly output in a text.By above-mentioned independent each database script text
Part is merged, and generates journal file.
Step S105, by judging whether the content in journal file is that sky judges file to determine whether to generate.
Specifically, above-mentioned steps S105, by judging whether log file contents are empty, to determine whether that generation judges text
Part.If log file contents are sky, there is no mistake in database of descriptions script implementation procedure, script runs succeeded.If
Log file contents are not sky, then wrong in database of descriptions script implementation procedure to produce, script performs failure.
Step S107, to judge file carry out verification operation, according to verification operation judge database script issue whether into
Work(.
Specifically, above-mentioned steps S107, by judging that file carries out verification operation, judge verification operation success and
It is no, so as to judge whether database script file distribution succeeds.
Above-mentioned steps S101 to step S107, is carried out by the execution journal of the database script of multiple positions to execution
Merge, generate the journal file for carrying out unified judgement.In the case of judging that database script runs succeeded, generation judges
File, in the case of judging that database script performs failure, judgement file is not generated.Finally by the checking to judging file
Whether operation, succeed to judge that database script is performed.If being performed in database script and mistake occur, judgement file is not generated
In the case of.When performing verification operation, because in the absence of file is judged, just occurring when verification operation is performed
Mistake.The mistake occurred by verification operation, makes lasting publishing tool be judged as mistake to database script implementation procedure.
Among practical application, exemplified by lasting issue is carried out using Hudson and is built.By database in issuing process
The error log that script is performed is output in file " A.txt ", and daily record is output in file adds mode using content.Using this
During the mode of kind, no matter whether wrong daily record is exported in the process of implementation, this document " A.txt " can all be present.Difference is, when
When performing wrong, this document content is not sky;When performing without mistake, then this document content is sky.And then, judge
Whether " A.txt " file content is empty.If " A.txt " file content is sky, then it represents that do not had in database script implementation procedure
It is wrong, now newly-built " B.txt " file;If " A.txt " file content is not sky, exported in Hudson daily records
The related prompt message of a little mistakes, and do not create " B.txt " file.
Herein it should be strongly noted that Hudson continues publishing tool as one in itself, can only be to release tasks
No order, which is performed, to be judged, and database script performs correctness, and the process of database perform script can all continue, simply
The mistake occurred during can database script be performed is pointed out in the form of error log.But, Hudson persistently issues work
The content of the error log that can not be generated to database of tool itself judges.So we pass through the behaviour to judging file
Make, judge come the implementing result to database script in database.
Preferably, in the above embodiments of the present application, the operation day of database script is obtained in step S101 and step S103
Will, and by database script perform make a mistake when running log merge, generation journal file the step of include:
Step S1031, the executive process of monitoring data storehouse script.
Step S1033, obtains the execution journal for performing and being produced when database script execution makes a mistake.
Step S1035, journal file is generated by the content of database script execution journal in additional mode.
Specifically, above-mentioned steps S1031 is into step S1035, by the monitoring of the executive process to database script, directly
Obtain and take database script to perform execution journal when making a mistake.It is merged into generation one comprising in additional mode
There is the journal file of the content of running log.
Preferably, in the above embodiments of the present application, step 105 by judge the content in journal file whether be it is empty come
Determine whether database script runs successful step and include:
Step S1051, reads the content of journal file.
Step S1053, whether the content for judging journal file is empty.
When the judged result of journal file is space-time, replication log file generated judges file, by judging file
Whether operation, succeed so that validation database script is persistently issued;
When the judged result of journal file is not space-time, the judgement file for verification operation is not generated.
Specifically, above-mentioned steps S1051 is into step S1053, by reading the content of journal file, when journal file
Content is space-time, determines that database script is run successfully;When the content of journal file is not space-time, determine that database script is run
Failure.By in success generation judge file to mark and issue successful state.
Among practical application, the generating mode of file is judged, in addition to judging file with replication log file generated,
Judgement file can also be generated by other means.For example, directly creating shortcut, directly creating the blank text of various forms
Shelves etc..
Preferably, in the above embodiments of the present application, in step S107 to judging that file carries out verification operation, grasped according to checking
Make to judge database script issue whether succeed in the method for verification operation include:
Method A:By to judging file copy operation, judging that database script is performed and whether succeeding;Or,
Method B:By to judging that paper cut is operated, judging that database script is performed and whether succeeding;Or,
Method C:By to judging file open operation, judging that database script is performed and whether succeeding;Or,
Method D:By to judging file deletion action, judging that database script is performed and whether succeeding.
Specifically, above method A is into method D, by the duplication for judging file, shearing, opening, deletion action, coming
Judge whether the execution of database script succeeds.When database script runs succeeded, generation judges file.So to judging text
The operation such as duplication, shearing, opening, deletion of part will succeed.When database script performs failure, judgement file is not generated,
The operation such as duplication, shearing, opening, deletion to judging file will fail certainly.Pass through the aforesaid operations to judging file
Success or not, to judge the result of database script execution in database.Certainly, except replicating, shearing, open, delete these
Operation is outer, other modes of operation to judging file, can be used for judging the implementing result of database script.
Preferably, Fig. 2 is the stream of the processing method of according to embodiments of the present invention one optional database script issue result
Cheng Tu, as shown in Fig. 2 in the above embodiments of the present application, in step S105 by judging whether the content in journal file is empty
To determine whether that generation judges file, if the content in journal file is space-time, step also includes:
Step 1061, execution journal is preserved to presumptive area.
Step 1063, real time scan presumptive area.
Step 1065, according to whether there is execution journal in presumptive area, the execution failure cause of database script is judged.
Step 1067, according to failure cause is performed, announcement information is sent.
Specifically, above-mentioned steps S1061 is into step S1067, it will determine that file is preserved into presumptive area, by this
Presumptive area real time scan, to realize the real-time monitoring to database script operation result.To the execution journal in presumptive area
It is read out, is judged by log content performing failure cause.According to failure cause, send corresponding with failure cause
Announcement information.Announcement information can be sent by forms such as desktop pop-up mouthful, transmission mail, transmission short messages.
Embodiment 2
The embodiment of the present invention additionally provides the processing unit that a kind of database script issues result, as shown in figure 3, the device
It can include:Acquisition module 201, first processing module 203, determining module 205 and authentication module 207.
Wherein, acquisition module 201, the execution journal for obtaining database script.
Specifically, in above-mentioned acquisition module 201, the execution journal of database script is to perform the process of database script
Central generation.By the implementation procedure of direct monitoring data storehouse script, so as to obtain the execution journal produced in implementation procedure.
First processing module 203, merges for database script to be performed to execution journal when making a mistake, generates
Journal file.
Specifically, in above-mentioned first processing module 203, to carry out unified judgement, institute for the implementing result of these scripts
So that the execution error log under these catalogues is all uniformly output in a text.By above-mentioned each independent data
Storehouse script file is merged, and generates journal file.
Determining module 205, for by judging whether the content in journal file is empty, it is determined whether generation judges text
Part.
Specifically, above-mentioned determining module 205, by judging whether log file contents are empty, to determine whether that generation is sentenced
Disconnected file.If log file contents are sky, there is no mistake in database of descriptions script implementation procedure, script runs succeeded.
If log file contents are not sky, wrong in database of descriptions script implementation procedure to produce, script performs failure.
Authentication module 207, for judging that file carries out verification operation, judging that database script is issued according to verification operation
Whether succeed.
Specifically, above-mentioned authentication module 207, by judging that file carries out verification operation, judging the success of verification operation
Whether, so as to judge whether database script file distribution succeeds.
Above-mentioned acquisition module 201, first processing module 203, determining module 205 and authentication module 207, by execution
The execution journal of the database script of multiple positions is merged, and generates the journal file for carrying out unified judgement.Work as judgement
In the case that database script runs succeeded, generation judges file, in the case of judging that database script performs failure, does not give birth to
Into judging file.Finally by the verification operation to judging file, whether succeed to judge that database script is performed.If in number
Performed according to storehouse script and mistake occur, do not generated in the case of judging file.When performing verification operation, because literary in the absence of judging
Part, so mistake just occurs when verification operation is performed.The mistake occurred by verification operation, makes lasting publishing tool
Mistake is judged as to database script implementation procedure.
Among practical application, exemplified by lasting issue is carried out using Hudson and is built.By database in issuing process
The error log that script is performed is output in file " A.txt ", and daily record is output in file adds mode using content.Using this
During the mode of kind, no matter whether wrong daily record is exported in the process of implementation, this document " A.txt " can all be present.Difference is, when
When performing wrong, this document content is not sky;When performing without mistake, then this document content is sky.And then, judge
Whether " A.txt " file content is empty.If " A.txt " file content is sky, then it represents that do not had in database script implementation procedure
It is wrong, now newly-built " B.txt " file;If " A.txt " file content is not sky, exported in Hudson daily records
The related prompt message of a little mistakes, and do not create " B.txt " file.
Herein it should be strongly noted that Hudson continues publishing tool as one in itself, can only be to release tasks
No order, which is performed, to be judged, and database script performs correctness, and the process of database perform script can all continue, simply
The mistake occurred during can database script be performed is pointed out in the form of error log.But, Hudson persistently issues work
The content of the error log that can not be generated to database of tool itself judges.So we pass through the behaviour to judging file
Make, judge come the implementing result to database script in database.
Preferably, in the above embodiments of the present application, acquisition module 201 includes:Sub- monitoring module 2011 and sub-acquisition module
2013。
Wherein, sub- monitoring module 2011, the executive process for monitoring data storehouse script.
Sub-acquisition module 2013, the execution journal that database script is produced is performed for obtaining.
Specifically, above-mentioned sub- monitoring module 2011 and sub-acquisition module 2013, pass through the executive process to database script
Monitoring, directly obtain database script execution journal.So as to which it is merged into generation one comprising in additional mode
There is the journal file of the content of running log.
Preferably, in the above embodiments of the present application, determining module 205 includes:Sub- read module 2051 and subprocessing module
2053。
Wherein, sub- read module 2051, the content for reading journal file.
Subprocessing module 2053, for judging whether the content of journal file is empty.
When the judged result of journal file is space-time, replication log file generated judges file, by judging file
Whether operation, succeed so that validation database script is persistently issued.
When the judged result of journal file is not space-time, the judgement file for verification operation is not generated.
Specifically, above-mentioned sub- read module 2051 and subprocessing module 2053, by reading the content of journal file, the same day
The content of will file is space-time, determines that database script is run successfully;When the content of journal file is not space-time, database is determined
Script operation failure.By in success generation judge file to mark and issue successful state.
Among practical application, the generating mode of file is judged, in addition to judging file with replication log file generated,
Judgement file can also be generated by other means.For example, directly creating shortcut, directly creating the blank text of various forms
Shelves etc..
Preferably, in the above embodiments of the present application, authentication module 207 at least includes any one following submodule:The
One sub- judge module 2071, the second sub- judge module 2073, the 3rd sub- judge module 2077 of sub- judge module 2075 or the 4th.
Wherein, the first sub- judge module 2071, for by judging file copy operation, judging that database script is performed
Whether succeed;Or,
Second sub- judge module 2073, for by judging that paper cut is operated, whether judging database script execution
Success;Or,
3rd sub- judge module 2075, for by judging file open operation, whether judging database script execution
Success;Or,
4th sub- judge module 2077, for by judging file deletion action, whether judging database script execution
Success.
Specifically, above-mentioned first sub- judge module 2071, the second sub- judge module 2073, the 3rd sub- judge module 2075 or
4th sub- judge module 2077, by the duplication for judging file, shearing, opening, deletion action, to judge database script
Whether execution succeeds.When database script runs succeeded, generation judges file.So to judging the duplication of file, shearing, beating
The operation such as opening, delete will succeed.When database script perform failure when, judgement file is not generated, to judge file duplication,
The operations such as shearing, opening, deletion will fail certainly.By the success or not of the aforesaid operations to judging file, to judge number
The result performed according to database script in storehouse.Certainly, in addition to replicating, shearing, open, delete these operations, other are to judging
The mode of operation of file, can be used for judging the implementing result of database script.
Preferably, Fig. 4 is the knot of the processing unit of according to embodiments of the present invention two optional database script issue results
Structure schematic diagram, as shown in figure 4, in the above embodiments of the present application, device also includes:Replication module 2061, monitoring module 2063, sentence
Disconnected module 2065 and Second processing module 2067.
Wherein, replication module 2061, for execution journal to be copied into presumptive area.
Monitoring module 2063, for real time scan presumptive area.
Judge module 2065, for according to whether there is execution journal in presumptive area, judging the execution of database script
Failure cause.
Second processing module 2067, for according to failure cause is performed, sending announcement information.
Specifically, above-mentioned replication module 2061, monitoring module 2063, judge module 2065 and Second processing module 2067,
It will determine that file is preserved into presumptive area, by the presumptive area real time scan, being tied to realize to run database script
The real-time monitoring of fruit.Execution journal in presumptive area is read out, sentenced by log content to performing failure cause
It is disconnected.According to failure cause, announcement information corresponding with failure cause is sent.Announcement information can pass through desktop pop-up mouthful, transmission
The forms such as mail, transmission short message are sent.
Among practical application, exemplified by lasting issue is carried out using Hudson and is built.Because passing through Hudson, database
The error message and running log that inside is performed can not be intercepted and captured normally by Hudson, so can not be according to this error message
The correct judgement of issue result is carried out, so when persistently being issued using Hudson, according to judging whether file generates
Judge operation result.
Problem to be solved by this invention is:Lasting issue is carried out using Hudson to build, if data in issuing process
Storehouse script, which is performed, has mistake, and Hudson issue result is shown as success all the time, it is impossible to the normal issue knot for showing failure
The problem of fruit.The method described by using the present invention can make the display result issued automatically correct, when database script is held
When row has mistake, automatic issue result is to be shown as unsuccessfully, it is not necessary to carry out hand inspection again.
In actual applications, it can be realized according to following steps:
Step A, the error log that database script in issuing process is performed is output in file " A.txt ".
Because the database script to be performed in issuing process may have many parts, the script of these parts is mutually
Independent, it is present under different bibliographic structures, and unified judgement is carried out for the implementing result of these scripts, so will
Execution error log under these catalogues is all uniformly output in a file, is used Gu error log is output in file
Content adds mode.When in this way, no matter whether wrong daily record is exported in the process of implementation, the text to be output to
Part can all be present.Difference is, when wrong daily record, and this document content is not sky;When performing without mistake, then in this document
Hold for sky.
Whether step B, it is empty to judge " A.txt " file content.If " A.txt " file content is sky, then it represents that data
There is no mistake in the script implementation procedure of storehouse, now newly-built " B.txt " file;If " A.txt " file content is not sky,
With being intended in hudson daily records export a little information, and do not create " B.txt " file.
Step C, replicates " B.txt " file and arrives certain catalogue, thus judges whether database execution is wrong, and this is tied
Fruit is accurately notified to Hudson.In summary, can be released by step 1, no matter script perform whether wrong file " A.txt "
All exist, admittedly directly it can not be judged with " A.txt " file.
From step B, when perform script is without mistake, " B.txt " file is then present, and the operation for replicating this document can
Normally to run succeeded, returning result is correct, and the result that now Hudson is got is correct, and issue should be successfully;
When perform script is wrong, " B.txt " file is then not present, and replicates the operation of this document i.e. due to lacking source file, performs
It will fail, the result as exception error that now Hudson is got can return to issue failure.
It should be noted that:The file " A.txt " that Hudson can not be output to according to error log whether there is directly to enter
Row judges, can not judge file because even working as directly according to judging whether file " A.txt " is that sky is directly judged
" A.txt " is not sky, and now database script execution known to us malfunctions, but this result is can not to return to Hudson to be cut
Obtain and use, it is impossible to reach judge its issue result should for fail purpose.
It is actual to have used transition method in this scheme, by performing copy command, because the source file of duplication is not present
Cause copy command unsuccessfully to report an error, this error message returned into Hudson, judged using this error message intercepted,
Return to the correct result of issue failure.
The essence for the problem of present invention is solved is that Hudson is to be unable to identification database to perform error message, so this hair
The bright method taken is to be converted into this error message in Hudson issue flows by certain methods to recognize and capture
Abnormal information mode, utilize the abnormal information that captures after the conversion of these methods to carry out the judgement of issue result.
So by other scripts or implementation method, can reach this purpose should can be achieved.Solve hair
Cloth instrument provides the issue insecure problem of result, passes through the implementation of this programme, it is not necessary to carried out again after each issue artificial
Check, improve efficiency, release manpower.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because
According to the present invention, some steps can be carried out sequentially or simultaneously using other.Secondly, those skilled in the art should also know
Know, embodiment described in this description belongs to preferred embodiment, involved action and module is not necessarily of the invention
It is necessary.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiment.
, can be by another way in several embodiments provided herein, it should be understood that disclosed device
Realize.For example, device embodiment described above is only schematical, such as the division of described unit is only one kind
Division of logic function, can there is other dividing mode when actually realizing, such as multiple units or component can combine or can
To be integrated into another system, or some features can be ignored, or not perform.It is another, it is shown or discussed each other
Coupling direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit,
Can be electrical or other forms.
The unit illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit
The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing unit, can also
That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list
Member can both be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit is realized using in the form of SFU software functional unit and as independent production marketing or used
When, it can be stored in a computer read/write memory medium.Understood based on such, technical scheme is substantially
The part contributed in other words to prior art or all or part of the technical scheme can be in the form of software products
Embody, the computer software product is stored in a storage medium, including some instructions are to cause a computer
Equipment (can be personal computer, mobile terminal, server or network equipment etc.) performs side described in each embodiment of the invention
The all or part of step of method.And foregoing storage medium includes:USB flash disk, read-only storage (ROM, Read-Only Memory),
Random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various to be stored
The medium of program code.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should be included in the scope of the protection.