CN105574195B - Judge whether database answers the method and device of offline recycling - Google Patents

Judge whether database answers the method and device of offline recycling Download PDF

Info

Publication number
CN105574195B
CN105574195B CN201510997513.9A CN201510997513A CN105574195B CN 105574195 B CN105574195 B CN 105574195B CN 201510997513 A CN201510997513 A CN 201510997513A CN 105574195 B CN105574195 B CN 105574195B
Authority
CN
China
Prior art keywords
database
judging
running state
state information
offline
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510997513.9A
Other languages
Chinese (zh)
Other versions
CN105574195A (en
Inventor
王立新
杨挺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510997513.9A priority Critical patent/CN105574195B/en
Publication of CN105574195A publication Critical patent/CN105574195A/en
Application granted granted Critical
Publication of CN105574195B publication Critical patent/CN105574195B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of method and device for judging database and whether answering offline recycling, the above method includes: the type obtained as the database for judging object;Whether the type for judging database is relationship type;If so, obtaining the running state information of database;Based on running state information, judge whether database meets offline recycling condition according to corresponding predetermined policy.Technical solution provided by the invention can obtain the running state information of each relevant database automatically, and judge automatically whether a relevant database needs offline recycling, any manual operation is carried out without user, so that it may which Resource recovery in time substantially increases the utilization rate of resource.

Description

Judge whether database answers the method and device of offline recycling
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method for judging database and whether answering offline recycling And device.
Background technique
In the present computer technology, the application of database is a highly important technology, in current Internet age In, the application of database is even more more extensive, and whether various websites, platform or various application software require setting respectively The database of kind various kinds.
For broad sense, database can be divided into relevant database and non-relational database.The resource of database is It is limited, it needs to carry out it use of repetitive cycling, is determining whether to carry out offline recycling to some database at present When, it all needs manually to carry out, will lead to resource reclaim so not in time, while manual recovery can also be brought very greatly to user Workload.
Summary of the invention
The invention proposes it is a kind of judge database whether answer the method and device of offline recycling with overcome the above problem or Person at least is partially solved the above problem.
According to an aspect of the invention, there is provided a kind of method for judging database and whether answering offline recycling, comprising:
Obtain the type as the database for judging object;
Whether the type for judging the database is relationship type;
If so, obtaining the running state information of the database;
Based on the running state information, judge whether the database meets offline recycling according to corresponding predetermined policy Condition.
Optionally, the running state information includes at least one following:
The running state of a process of the database;
The connected state of the example of the database;
The starting time of the example of the database;
It whether there is business library in the example of the database, whether there is traffic table in the business library;
The final data modification time of traffic table in the example of the database;
Whether carry is under Linux virtual server for the proxy server that the database uses.
Optionally, according to corresponding predetermined policy judge the database whether meet offline recycling condition include it is following extremely It is one of few:
Judge whether the database is not present record in business cloud platform, but there are data mesh in server local Record or the example have been turned on, if it is, judging that the database meets offline recycling condition;
Judge whether the process of the database is in operating status, if it is not, then it is offline to judge that the database meets Recycling condition;
Judging proxy server that the database uses, whether carry is under Linux virtual server, if it is not, then sentencing The database that breaks meets offline recycling condition;
Judge whether the database starts more than first time threshold, but do not establish business library or traffic table, such as Fruit is then to judge that the database meets offline recycling condition;
Judge whether the database starts more than the first time threshold, establishes business library and traffic table and described The final data modification time of traffic table has been more than second time threshold, if it is, judging the database in scheduled duration Inside whether there is sentence access, if it is not, then judging that the database meets offline recycling condition.
Optionally, the running state information for obtaining the database includes:
Timing executes the script for obtaining the running state information of the database, obtains and saves the database Running state information.
Optionally, if judging, the database meets offline recycling condition, described further include:
According to contact information is preset, the administrator of Xiang Suoshu database sends offline recycling prompt, wherein described offline time It receives mark of the prompt comprising the database and meets the running state information of offline recycling condition.
Optionally, the relevant database includes: MySQL database.
According to another aspect of the present invention, a kind of device for judging database and whether answering offline recycling is additionally provided, is wrapped It includes:
Type acquisition module, for obtaining the type as the database for judging object;
Type judging module, for judging whether the type of the database is relationship type;
Data obtaining module is when being, to obtain the database for the judging result in the type judging module Running state information;
Judgment module is recycled, for being based on the running state information, the data are judged according to corresponding predetermined policy Whether library meets offline recycling condition.
Optionally, the running state information includes at least one following:
The running state of a process of the database;
The connected state of the example of the database;
The starting time of the example of the database;
It whether there is business library in the example of the database, whether there is traffic table in the business library;
The final data modification time of traffic table in the example of the database;
Whether carry is under Linux virtual server for the proxy server that the database uses.
Optionally, the recycling judgment module includes:
First judging unit for judging whether the database is not present record in business cloud platform, but is taking Business device locally there is data directory or the example has been turned on, if it is, judging that the database meets offline recycling condition;
Second judgment unit, whether the process for judging the database is in operating status, if it is not, then judging institute It states database and meets offline recycling condition;
Third judging unit, for judging whether carry virtually takes in Linux for proxy server that the database uses It is engaged under device, if it is not, then judging that the database meets offline recycling condition;
4th judging unit for judging whether the database starts more than first time threshold, but is not established Business library or traffic table, if it is, judging that the database meets offline recycling condition;And/or
5th judging unit, for judging whether the database starts more than the first time threshold, establishes industry The final data modification time of library and the traffic table of being engaged in and the traffic table has been more than second time threshold, if it is, judging institute State whether database has sentence access in scheduled duration, if it is not, then judging that the database meets offline recycling condition.
Optionally, the data obtaining module includes:
Timing acquisition unit executes the script for obtaining the database running state information for timing, obtains simultaneously Save the database running state information.
Optionally, above-mentioned apparatus further include:
Cue module is recycled, for when the recycling judgment module judges that the database meets offline recycling condition, According to contact information is preset, the administrator of Xiang Suoshu database sends offline recycling prompt, wherein the offline recycling prompt packet Mark containing the database and the running state information for meeting offline recycling condition.
Optionally, the relevant database includes: MySQL database.
Technical solution provided by the invention can obtain the running state information of each relevant database automatically, and sentence automatically Whether a disconnected relevant database needs offline recycling, carries out any manual operation without user, so that it may in time Ground Resource recovery substantially increases the utilization rate of resource.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
According to the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will be brighter The above and other objects, advantages and features of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 is according to an embodiment of the invention to judge whether database answers the process of the method for offline recycling to illustrate Figure;
Fig. 2 is in accordance with another embodiment of the present invention to judge whether database answers the process of the method for offline recycling to illustrate Figure;
Fig. 3 is that further embodiment judges whether database answers the process of the method for offline recycling to illustrate according to the present invention Figure
Fig. 4 is the structural block diagram according to an embodiment of the invention for judging database and whether answering the device of offline recycling;
Fig. 5 is the structural frames in accordance with another embodiment of the present invention for judging database and whether answering the device of offline recycling Figure.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.It should be noted that under the premise of not conflicting, the embodiment of the present invention and implementation Technical characteristic in example can be combined with each other.
Fig. 1 is according to an embodiment of the invention to judge whether database answers the process of the method for offline recycling to illustrate Figure.As shown in Figure 1, the above method may include:
Step S102 obtains the type as the database for judging object;
Step S104 judges whether the type of database is relationship type;
Step S106, if so, obtaining the running state information of database;
Step S108 is based on running state information, judges whether database meets offline time according to corresponding predetermined policy Receipt part.
Method provided in this embodiment can obtain automatically the running state information of each relevant database, and judge automatically Whether one relevant database needs offline recycling, carries out any manual operation without user, so that it may in time Resource recovery substantially increases the utilization rate of resource.
In method provided in this embodiment, in order to it is more efficient, accurately judge whether a relevant database can be with Offline recycling needs which running state information for needing to obtain data is reasonably arranged and is believed according to these operating statuses Breath judge database whether can offline recycling strategy.In one embodiment of the invention, above-mentioned running state information can To include:
The running state of a process of database;
The connected state of the example of database;
The starting time of the example of database;
It whether there is business library in the example of database, whether there is traffic table in business library;
The final data modification time of traffic table in the example of database;
Whether carry is under Linux virtual server for the proxy server that database uses.
Listing in the present embodiment several the most typically can be used to judge whether a relevant database can be offline The running state information of recycling can substantially be covered based on these running state informations and all typically need offline recycling Relevant database operating status.Certainly, in the specific implementation, can be selected to obtain therein one according to different needs A or multiple running state informations, or the running state information that addition is new, the present invention is not specifically limited.
In one embodiment of the invention, corresponding to above-mentioned running state information, above-mentioned steps S108 may include:
1, judge whether database is not present record in business cloud platform, but there are data directories in server local Or the example has been turned on, if it is, judging that database meets offline recycling condition;
2, judge whether the process of database is in operating status, if it is not, then judging that database meets offline recycling item Part;
3, judging proxy server that database uses, whether carry is under Linux virtual server, if it is not, then judgement Database meets offline recycling condition;
4, judge whether database starts more than first time threshold, but do not establish business library or traffic table, if It is then to judge that database meets offline recycling condition;
5, judge whether database starts more than first time threshold, establishes business library and traffic table and traffic table most The data modification time has been more than second time threshold afterwards, if it is, judging whether database has sentence visit in scheduled duration It asks, if it is not, then judging that database meets offline recycling condition.
In the present embodiment, database can not find out record in business cloud platform, but have data mesh in server local What record or example had been turned on, show that database is not actually used, needs to delete, i.e., offline recycling;Database into Journey is not at operating status illustrated example and has not had to, but leaves file, it is therefore desirable to delete;If database uses Proxy server (proxy is referred to as agency, network agent), but without carry in Linux virtual server (Linux Virtual Server, referred to as lvs) under, illustrate to need to delete without providing online service;If database starting is more than First time threshold, such as 60 days, but again without business library/table, belong to and exceed the time limit to be not used by, it needs to delete;If Database starting is more than first time threshold (60 days), there is business library/table and final data modification time was more than the second time Threshold value, such as 60 days (adjustable), then needing to grab whether it currently has sentence access, it is within a certain period of time in other words It is no to have sentence access, show that its utility ratio is very low if not, it may be considered that delete, in this case, in order to guarantee not It wrong can recycle, can also can then be deleted with business personnel's secondary-confirmation if it is confirmed that not had to.Above-mentioned strategy is corresponding In above-mentioned running state information, it can efficiently and accurately judge that a relevant database whether may be used based on these strategies With recycling.
For relational data, when obtaining its running state information, many means can be used, are preferably adopted in the present invention With the mode for executing dedicated script.In one embodiment of the invention, above-mentioned steps S104 may include: that timing execution is used for The script for obtaining the running state information of database, obtains and saves the running state information of database.
The running state information of database is obtained using dedicated script, realizes that simply the resource of occupancy is less, the effect of execution Rate is also relatively high, is a kind of preferred scheme.
In one embodiment of the invention, above-mentioned as shown in Fig. 2, when judging that database meets offline recycling condition Method can also include:
Step S110 sends offline recycling prompt to the administrator of database, wherein offline time according to contact information is preset It receives mark of the prompt comprising database and meets the running state information of offline recycling condition.
Based on scheme provided in this embodiment, complete right to know can be provided for database administrator, make administrator can To understand the executive condition of database offline recycling automatically in real time.Meanwhile do administrator manually in time In advance, because in reality, it is likely that will appear some database and meet offline recycling condition, but administrator is for some special The case where considering, still not carrying out offline recycling to it, scheme provided in this embodiment provides very big autonomy for administrator Power.
MySQL is a kind of typical Relational DBMS, is developed by MySQL AB company, Sweden, is belonged at present Company under Oracle.The most popular Relational DBMS of MySQL, MySQL is best in terms of WEB application One of RDBMS (Relational Database Management System, relational database management system) application software. MySQL is a kind of associated data base management system, and linked database saves the data in different tables, rather than by all numbers According to being placed in one big warehouse, which adds speed and flexibility is improved.Sql like language used in MySQL is to be used for Access the most frequently used standardized language of database.MySQL software uses double authorization policies, it is divided into Community Edition and commercial version, Since its is small in size, speed is fast, the total cost of ownership is low, especially this feature of open source code, general middle-size and small-size website are opened Hair all selects MySQL as site databases.
MySQL database uses SQL (Structured Query Language, structured query language), is a kind of The programming language of specific purposes, is a kind of data base querying and programming language, for access data and inquiry, update and Administrative relationships Database Systems;It is simultaneously also the extension name of database script file.
Structured query language is advanced deproceduring programming language, and user is allowed to work in high level data structure. It does not require the specified deposit method to data of user, does not need user yet and understands specific data location mode, so having The disparate databases system of entirely different fabric can be used identical structured query language as data and input and manage The interface of reason.Structured query language sentence can be nested, this makes it have the function of great flexibility and powerful.
The technical solution that the various embodiments described above of the present invention provide can be applied to MySQL database, above-mentioned each implementation very well The sentence that example is related to mainly includes SQL statement.
Above scheme is illustrated below by a specific embodiment, Fig. 3 is further embodiment according to the present invention Judge whether database answers the flow diagram of the method for offline recycling, as shown in figure 3, this method may include:
Step S302 is determined as the MySQL database for judging object, obtains the type of MySQL database, is relationship Type database;
Step S304 judges whether the type as the MySQL database for judging object is relationship type, and judging result is It is;
Step S306, timing execute the script for obtaining the running state information of MySQL database, obtain and save institute State the running state information of database, comprising: the running state of a process of MySQL database;The company of the example of MySQL database Logical state;The starting time of the example of MySQL database;It whether there is business library in the example of MySQL database, in business library With the presence or absence of traffic table;The final data modification time of traffic table in the example of MySQL database;What MySQL database used Whether carry is under Linux virtual server for proxy server;
Step S308, judges whether MySQL database is not present record in business cloud platform, but in server local There are data directories or the example to have been turned on, if so, S318 is thened follow the steps, if not, thening follow the steps S310;
Step S310 judges whether the process of MySQL database is in operating status, if not, S318 is thened follow the steps, If so, thening follow the steps S312;
Step S312, judging the proxy of MySQL database, whether carry is at lvs, if not, S318 is thened follow the steps, If so, thening follow the steps S314;
Step S314, judges whether MySQL database started more than 60 days, but does not establish business library or traffic table, If so, thening follow the steps S318, S316 is thened follow the steps if not;
Step S316, judge MySQL database whether start more than 60 days, establish business library and traffic table and traffic table Final data modification time be more than 60 days, if it is, further judging whether MySQL database has in scheduled duration SQL statement access, if not, S318 is thened follow the steps, if it is, return step S302;
Step S318 determines that MySQL database meets offline recycling condition;
Step S320 is sent offline by short message, mail or other similar mode to the administrator of MySQL database Recycling prompt, wherein offline recycling prompt includes the mark of MySQL database and the operating status for meeting offline recycling condition Information;
Step S322, under the premise of administrator does not assign not the order for allowing to recycle, offline recycling MySQL data Library.
When scheme provided in this embodiment is embodied, server can the local perform script of morning timing on every Sundays, Database examples of ports all in the machine are automatically analyzed, local file is recorded in analysis result.It can be on supervisor The perform script of timing in afternoon on every Sundays, to the institute of database administrator (Database Administrator, abbreviation DBA) management There is the access of database instance poll to obtain analysis as a result, then typing certain database.DBA is by logging in particular webpage, backstage Specific SQL can be executed automatically and carries out analysis result displaying, and entire analytic process is without artificial access.
Corresponding to the method that the various embodiments described above provide, the embodiment of the invention also provides a kind of corresponding judgement databases Whether the device of offline recycling is answered.Fig. 4 is the dress according to an embodiment of the invention for judging database and whether answering offline recycling The structural block diagram set.As shown in figure 4, the apparatus may include:
Type acquisition module 10, for obtaining the type as the database for judging object;
Type judging module 20, for judging whether the type of database is relationship type;
Data obtaining module 30 is when being, to obtain the operation of database for the judging result in type judging module 20 Status information;
Judgment module 40 is recycled, for being based on running state information, whether database is judged according to corresponding predetermined policy Meet offline recycling condition.
Device provided in this embodiment can obtain automatically the running state information of each relevant database, and judge automatically Whether one relevant database needs offline recycling, carries out any manual operation without user, so that it may in time Resource recovery substantially increases the utilization rate of resource.
In one embodiment of the invention, running state information may include at least one following:
The running state of a process of database;
The connected state of the example of database;
The starting time of the example of database;
It whether there is business library in the example of database, whether there is traffic table in business library;
The final data modification time of traffic table in the example of database;
Whether carry is under Linux virtual server for the proxy server that database uses.
Listing in the present embodiment several the most typically can be used to judge whether a relevant database can be offline The running state information of recycling can substantially be covered based on these running state informations and all typically need offline recycling Relevant database operating status.Certainly, in the specific implementation, can be selected to obtain therein one according to different needs A or multiple running state informations, or the running state information that addition is new, the present invention is not specifically limited.
In one embodiment of the invention, as shown in figure 5, recycling judgment module 40 may include:
First judging unit 41 for judging whether database is not present record in business cloud platform, but is servicing Locally there is data directory in device or the example has been turned on, if it is, judging that database meets offline recycling condition;
Second judgment unit 42, whether the process for judging database is in operating status, if it is not, then judging data Library meets offline recycling condition;
Third judging unit 43, for judging proxy server that database uses, whether carry is in Linux Virtual Service Under device, if it is not, then judging that database meets offline recycling condition;
4th judging unit 44 for judging whether database starts more than first time threshold, but does not establish industry Business library or traffic table, if it is, judging that database meets offline recycling condition;And/or
5th judging unit 45, for judge database whether start more than first time threshold, establish business library and The final data modification time of traffic table and traffic table has been more than second time threshold, if it is, judging database predetermined Whether sentence access is had in duration, if it is not, then judging that database meets offline recycling condition.
Corresponding to above-mentioned typical running state information, each list based on recycling judgment module 40 provided in this embodiment Member can efficiently and accurately judge whether a relevant database can recycle.
In one embodiment of the invention, as shown in figure 5, data obtaining module 30 may include:
Timing acquisition unit 31 executes the script for obtaining database running state information for timing, obtains and protect Deposit data library running state information.
In scheme provided in this embodiment, the timing acquisition unit 31 for belonging to data obtaining module 30 uses dedicated script The running state information of database is obtained, realizes that simply the resource of occupancy is less, and the efficiency of execution is also relatively high.
In one embodiment of the invention, as shown in figure 5, above-mentioned apparatus can also include:
Recycle cue module 50, for recycle judgment module 40 judge that database meets offline recycling condition when, foundation Default contact information sends offline recycling prompt to the administrator of database, wherein offline recycling prompt includes the mark of database Know and meet the running state information of offline recycling condition.
In scheme provided in this embodiment, recycles cue module 50 and provided for database administrator and completely known Power allows administrator to understand the executive condition of database offline recycling automatically in real time.Meanwhile also keeping administrator timely Ground carries out manual intervention, because in reality, it is likely that will appear some database and meet offline recycling condition, but administrator goes out In some special considerations, the case where still not carrying out offline recycling to it, scheme provided in this embodiment provides for administrator Very big autonomous power.
Preferably, in above-mentioned each embodiment, the relevant database of design can be MySQL database, be related to Sentence can be SQL statement.
Scheme provided in an embodiment of the present invention can obtain the running state information of each relevant database automatically, and automatic Judge whether a relevant database needs offline recycling, meanwhile, the result of judgement can be sent out in time by way of reservation Database administrator is given, carries out any manual operation without user, so that it may which Resource recovery in time greatly improves The utilization rate of resource.In a special case, database administrator can also be prevented to the offline of some specific database Reclaimer operation provides very big autonomous power for administrator.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention Within the scope of and form different embodiments.For example, in detail in the claims, embodiment claimed it is one of any Can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice Microprocessor or digital signal processor (DSP) according to an embodiment of the present invention judge whether database answers offline time to realize The some or all functions of some or all components in the device of receipts.The present invention is also implemented as executing here Some or all device or device programs of described method are (for example, computer program and computer program produce Product).It is such to realize that program of the invention can store on a computer-readable medium, or can have one or more The form of signal.Such signal can be downloaded from an internet website to obtain, and perhaps be provided on the carrier signal or to appoint What other forms provides.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame Claim.
So far, although those skilled in the art will appreciate that present invention has been shown and described in detail herein multiple shows Example property embodiment still without departing from the spirit and scope of the present invention, still can according to the present disclosure directly Determine or deduce out many other variations or modifications consistent with the principles of the invention.Therefore, the scope of the present invention is understood that and recognizes It is set to and covers all such other variations or modifications.
According to an aspect of the invention, there is provided a kind of method for judging database and whether answering offline recycling of A1., packet It includes:
Obtain the type as the database for judging object;
Whether the type for judging the database is relationship type;
If so, obtaining the running state information of the database;
Based on the running state information, judge whether the database meets offline recycling according to corresponding predetermined policy Condition.
A2. method according to a1, wherein the running state information includes at least one following:
The running state of a process of the database;
The connected state of the example of the database;
The starting time of the example of the database;
It whether there is business library in the example of the database, whether there is traffic table in the business library;
The final data modification time of traffic table in the example of the database;
Whether carry is under Linux virtual server for the proxy server that the database uses.
A3. the method according to A2, wherein it is described to be based on the running state information, according to corresponding predetermined policy It includes at least one following for judging whether the database meets offline recycling condition:
Judge whether the database is not present record in business cloud platform, but there are data mesh in server local Record or the example have been turned on, if it is, judging that the database meets offline recycling condition;
Judge whether the process of the database is in operating status, if it is not, then it is offline to judge that the database meets Recycling condition;
Judging proxy server that the database uses, whether carry is under Linux virtual server, if it is not, then sentencing The database that breaks meets offline recycling condition;
Judge whether the database starts more than first time threshold, but do not establish business library or traffic table, such as Fruit is then to judge that the database meets offline recycling condition;
Judge whether the database starts more than the first time threshold, establishes business library and traffic table and described The final data modification time of traffic table has been more than second time threshold, if it is, judging the database in scheduled duration Inside whether there is sentence access, if it is not, then judging that the database meets offline recycling condition.
A4. method according to a1, wherein the running state information for obtaining the database includes:
Timing executes the script for obtaining the running state information of the database, obtains and saves the database Running state information.
A5. according to the described in any item methods of A1-A4, wherein if judging, the database meets offline recycling condition, institute State method further include:
According to contact information is preset, the administrator of Xiang Suoshu database sends offline recycling prompt, wherein described offline time It receives mark of the prompt comprising the database and meets the running state information of offline recycling condition.
A6. according to the described in any item methods of A1-A4, wherein the relevant database includes: MySQL database.
According to another aspect of the present invention, a kind of device for judging database and whether answering offline recycling of B7. is additionally provided, Include:
Type acquisition module, for obtaining the type as the database for judging object;
Type judging module, for judging whether the type of the database is relationship type;
Data obtaining module is when being, to obtain the database for the judging result in the type judging module Running state information;
Judgment module is recycled, for being based on the running state information, the data are judged according to corresponding predetermined policy Whether library meets offline recycling condition.
B8. the device according to B7, wherein the running state information includes at least one following:
The running state of a process of the database;
The connected state of the example of the database;
The starting time of the example of the database;
It whether there is business library in the example of the database, whether there is traffic table in the business library;
The final data modification time of traffic table in the example of the database;
Whether carry is under Linux virtual server for the proxy server that the database uses.
B9. the device according to B8, wherein the recycling judgment module includes:
First judging unit for judging whether the database is not present record in business cloud platform, but is taking Business device locally there is data directory or the example has been turned on, if it is, judging that the database meets offline recycling condition;
Second judgment unit, whether the process for judging the database is in operating status, if it is not, then judging institute It states database and meets offline recycling condition;
Third judging unit, for judging whether carry virtually takes in Linux for proxy server that the database uses It is engaged under device, if it is not, then judging that the database meets offline recycling condition;
4th judging unit for judging whether the database starts more than first time threshold, but is not established Business library or traffic table, if it is, judging that the database meets offline recycling condition;And/or
5th judging unit, for judging whether the database starts more than the first time threshold, establishes industry The final data modification time of library and the traffic table of being engaged in and the traffic table has been more than second time threshold, if it is, judging institute State whether database has sentence access in scheduled duration, if it is not, then judging that the database meets offline recycling condition.
B10. the device according to B7, wherein the data obtaining module includes:
Timing acquisition unit executes the script for obtaining the database running state information for timing, obtains simultaneously Save the database running state information.
B11. according to the described in any item devices of B7-B10, wherein further include:
Cue module is recycled, for when the recycling judgment module judges that the database meets offline recycling condition, According to contact information is preset, the administrator of Xiang Suoshu database sends offline recycling prompt, wherein the offline recycling prompt packet Mark containing the database and the running state information for meeting offline recycling condition.
B12. according to the described in any item devices of B7-B10, wherein the relevant database includes: MySQL database.

Claims (10)

1. a kind of method for judging database and whether answering offline recycling, comprising:
Obtain the type as the database for judging object;
Whether the type for judging the database is relationship type;
If so, obtaining the running state information of the database;
Based on the running state information, judge whether the database meets offline recycling item according to corresponding predetermined policy Part;
Wherein, described to be based on the running state information, under judging whether the database meets according to corresponding predetermined policy It includes at least one following that line, which recycles condition:
Judge the database whether in business cloud platform there is no records, but server local there are data directory or Person's example has been turned on, if it is, judging that the database meets offline recycling condition;
Judging proxy server that the database uses, whether carry is under Linux virtual server, if it is not, then judging institute It states database and meets offline recycling condition;
Judge whether the database starts more than first time threshold, but does not establish business library or traffic table, if so, Then judge that the database meets offline recycling condition;
Judge whether the database starts more than the first time threshold, establishes business library and traffic table and the business The final data modification time of table has been more than second time threshold, if it is, judging that the database is in scheduled duration It is no to have sentence access, if it is not, then judging that the database meets offline recycling condition.
2. according to the method described in claim 1, wherein, the running state information includes at least one following:
The running state of a process of the database;
The connected state of the example of the database;
The starting time of the example of the database;
It whether there is business library in the example of the database, whether there is traffic table in the business library;
The final data modification time of traffic table in the example of the database;
Whether carry is under Linux virtual server for the proxy server that the database uses.
3. according to the method described in claim 1, wherein, the running state information for obtaining the database includes:
Timing executes the script for obtaining the running state information of the database, obtains and save the operation of the database Status information.
4. method according to claim 1-3, wherein if judging, the database meets offline recycling condition, The method also includes:
According to contact information is preset, the administrator of Xiang Suoshu database sends offline recycling prompt, wherein the offline recycling mentions Show the mark comprising the database and meets the running state information of offline recycling condition.
5. method according to claim 1-3, wherein the relevant database includes: MySQL database.
6. a kind of device for judging database and whether answering offline recycling, comprising:
Type acquisition module, for obtaining the type as the database for judging object;
Type judging module, for judging whether the type of the database is relationship type;
Data obtaining module is when being, to obtain the operation of the database for the judging result in the type judging module Status information;
Judgment module is recycled, for being based on the running state information, judges that the database is according to corresponding predetermined policy It is no to meet offline recycling condition;
Wherein, the recycling judgment module includes:
First judging unit, for judging whether the database is not present record in business cloud platform, but in server Locally there are data directories or the example to have been turned on, if it is, judging that the database meets offline recycling condition;
Third judging unit, for judging proxy server that the database uses, whether carry is in Linux virtual server Under, if it is not, then judging that the database meets offline recycling condition;
4th judging unit for judging whether the database starts more than first time threshold, but does not establish business Library or traffic table, if it is, judging that the database meets offline recycling condition;And/or
5th judging unit, for judging whether the database starts more than the first time threshold, establishes business library Final data modification time with traffic table and the traffic table has been more than second time threshold, if it is, judging the number Whether there is sentence access in scheduled duration according to library, if it is not, then judging that the database meets offline recycling condition.
7. device according to claim 6, wherein the running state information includes at least one following:
The running state of a process of the database;
The connected state of the example of the database;
The starting time of the example of the database;
It whether there is business library in the example of the database, whether there is traffic table in the business library;
The final data modification time of traffic table in the example of the database;
Whether carry is under Linux virtual server for the proxy server that the database uses.
8. device according to claim 6, wherein the data obtaining module includes:
Timing acquisition unit executes the script for obtaining the database running state information for timing, obtains and save The database running state information.
9. according to the described in any item devices of claim 6-8, wherein further include:
Recycle cue module, for when the recycling judgment module judges that the database meets offline recycling condition, foundation Default contact information, the administrator of Xiang Suoshu database send offline recycling prompt, wherein the offline recycling prompt includes institute It states the mark of database and meets the running state information of offline recycling condition.
10. according to the described in any item devices of claim 6-8, wherein the relevant database includes: MySQL database.
CN201510997513.9A 2015-12-25 2015-12-25 Judge whether database answers the method and device of offline recycling Active CN105574195B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510997513.9A CN105574195B (en) 2015-12-25 2015-12-25 Judge whether database answers the method and device of offline recycling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510997513.9A CN105574195B (en) 2015-12-25 2015-12-25 Judge whether database answers the method and device of offline recycling

Publications (2)

Publication Number Publication Date
CN105574195A CN105574195A (en) 2016-05-11
CN105574195B true CN105574195B (en) 2019-07-23

Family

ID=55884326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510997513.9A Active CN105574195B (en) 2015-12-25 2015-12-25 Judge whether database answers the method and device of offline recycling

Country Status (1)

Country Link
CN (1) CN105574195B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108460160B (en) * 2018-03-29 2021-03-12 武汉斗鱼网络科技有限公司 Off-line method, device, terminal and storage medium of database instance
CN111752695A (en) * 2020-06-28 2020-10-09 北京百度网讯科技有限公司 Offline method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567531A (en) * 2011-12-30 2012-07-11 互动在线(北京)科技有限公司 General method for monitoring status of light database
CN104486155A (en) * 2014-12-15 2015-04-01 北京趣拿软件科技有限公司 Database cluster monitoring method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6209062B1 (en) * 1997-11-24 2001-03-27 Intel Corporation Method for holding cache pages that are not invalidated within normal time duration for a second access or that are likely to be accessed again soon
US7634510B2 (en) * 2004-10-05 2009-12-15 Oracle International Corporation Method and system for time-based reclamation of objects from a recycle bin in a database
CN101539878A (en) * 2008-03-18 2009-09-23 环达电脑(上海)有限公司 Method for accelerating oracle process to monitor recycled resources under operating system
CN103365929B (en) * 2012-04-10 2016-09-28 阿里巴巴集团控股有限公司 The management method of a kind of data base connection and system
CN104809247B (en) * 2015-05-18 2019-03-26 北京京东尚科信息技术有限公司 The distribution of database connection and recovery method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567531A (en) * 2011-12-30 2012-07-11 互动在线(北京)科技有限公司 General method for monitoring status of light database
CN104486155A (en) * 2014-12-15 2015-04-01 北京趣拿软件科技有限公司 Database cluster monitoring method and system

Also Published As

Publication number Publication date
CN105574195A (en) 2016-05-11

Similar Documents

Publication Publication Date Title
US11968101B1 (en) Remote custom code pre-loading for hybrid playbook execution
US11995079B2 (en) Generating a subquery for an external data system using a configuration file
US11044179B1 (en) Service monitoring interface controlling by-service mode operation
US20230049579A1 (en) Executing commands from a distributed execution model
US12093318B2 (en) Recommending query parameters based on tenant information
US20210326032A1 (en) User role-based interface layout profiles in an information technology (it) and security operations application
CN106371984B (en) A kind of data monitoring method, equipment and system
US20170279840A1 (en) Automated event id field analysis on heterogeneous logs
CN105956087B (en) Data version management system and method
US11676345B1 (en) Automated adaptive workflows in an extended reality environment
US11573955B1 (en) Data-determinant query terms
US11593477B1 (en) Expediting processing of selected events on a time-limited basis
US11886844B1 (en) Updating reusable custom functions across playbooks
US11516069B1 (en) Aggregate notable events in an information technology and security operations application
CN105930330A (en) Portal system page display method and apparatus
CN110245145A (en) Structure synchronization method and apparatus of the relevant database to Hadoop database
CN113157947A (en) Knowledge graph construction method, tool, device and server
CN111859076B (en) Data crawling method, device, computer equipment and computer readable storage medium
US11693710B1 (en) Workload pool hierarchy for a search and indexing system
CN108446326A (en) A kind of isomeric data management method and system based on container
CN105574195B (en) Judge whether database answers the method and device of offline recycling
US11895126B1 (en) Analyzing data across tenants of an information technology (IT) and security operations application
US11892996B1 (en) Identifying an indexing node to process data using a resource catalog
CN105426544B (en) Method and device for monitoring database state
CN106844497A (en) The check device and method of a kind of database code

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220718

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right