CN100578507C - Data-base space automatic extended method and management module - Google Patents

Data-base space automatic extended method and management module Download PDF

Info

Publication number
CN100578507C
CN100578507C CN200710175823A CN200710175823A CN100578507C CN 100578507 C CN100578507 C CN 100578507C CN 200710175823 A CN200710175823 A CN 200710175823A CN 200710175823 A CN200710175823 A CN 200710175823A CN 100578507 C CN100578507 C CN 100578507C
Authority
CN
China
Prior art keywords
space
database
module
data
occupancy
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
CN200710175823A
Other languages
Chinese (zh)
Other versions
CN101140594A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN200710175823A priority Critical patent/CN100578507C/en
Publication of CN101140594A publication Critical patent/CN101140594A/en
Application granted granted Critical
Publication of CN100578507C publication Critical patent/CN100578507C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a storage management technology for large-scale commercial databases, in particular to an automatic expansion method for data storage space and diary storage space in databases, as well as a management module. The invention can fulfill modulized integration management on Sybase database space, so as to fulfill automatic space expansion with SQL commands in case of space shortcoming. The invention resolves the technical problem that Sybasedata space cannot be expanded automatically, in order to guarantee business application databases uninterrupted running all days.

Description

A kind of database space automatic expansion method and administration module
Technical field
The present invention relates to the storage management technique of large commercial database, particularly a kind of database space automatic expansion method and administration module.
Background technology
Along with the social informatization degree progressively deeply, the application of database in all trades and professions is more and more wider, communication field especially, professional data volume is very big, and requires 24 hours non-interrupting services to use.One of SYBASE database conduct Sybase product is in the market also adopted by a lot of telecom operators.But in application process, we find that the SYBASE database under the situation of data space deficiency, can not find automatically, can not automatic expansion, often therefore cause professional interruption or other bad influences.
Summary of the invention
In view of this, one of purpose of the present invention provides a kind of database space automatic expansion method, uses this method can solve the technical matters that the database space of some large database can not automatic expansion.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of database space automatic expansion method, described method is used to manage concentratedly the space of one or more database servers, comprises the steps,
A, connect one or more database servers by the client dynamic link library;
B, supervision timer is set; If arrive then execution in step C of timing, if no show is then waited for;
Thereby C, obtain the gross space and the remaining space size of data space and log space respectively, and the space hold rate of computational data space and log space respectively by the system's table in the query sentence of database Query Database;
Whether the space hold rate of D, judgment data space and log space meets or exceeds threshold value, if meet or exceed described threshold value, then selects the data available library facilities, and expands described data space and log space by the database control statement.
Based on such scheme, further, among the step C, before carrying out described inquiry, also comprise to described database space put in order, step of shrinking.
Based on such scheme, further, among the step D, can set different threshold values according to service application type, the space type of described database.Described database facility can be raw device or the volume equipment that has file system.
Based on such scheme, further, among the step D,, and after finishing described extended operation, also comprise the step of execution in step B if described database space occupancy does not reach threshold value.
Based on such scheme, further,, also comprise the step that sends alarm information to the data base administrator determining described database space occupancy when meeting or exceeding threshold value.
Further, in the process that described database is operated, if the overtime or accidental interruption of database session, then start retry mechanism, if it is still unsuccessful above set point number to repeat described operation, then the turn-off data storehouse connects, execution in step A, if in set point number, run succeeded, then continue to carry out subsequent step.
Another object of the present invention provides a kind of administration module of database space automatic expansion, and for achieving the above object, technical scheme of the present invention is achieved in that
A kind of administration module of database space automatic expansion comprises as lower module:
The database connection pool module is used to set up and manage the session connection of database server;
The timer control module is used to be provided with occupancy and detects timer;
The occupancy monitoring modular, thereby be used for obtaining respectively the gross space and the remaining space size of data space and log space by system's table of query sentence of database Query Database, the computer memory occupancy, and according to setting thresholding the space hold rate is monitored;
The spatial spread module is used for carrying out by the database control statement extended operation of data space and log space;
Overtime control module, whether the extended operation that is used to monitor the monitoring operation of described occupancy detection module and spatial spread module is overtime, and carries out timeout treatment;
Described occupancy monitoring modular and spatial spread module send the database control statement by described database connection pool module, described overtime control module is monitored the execution of described database control statement, notifies described occupancy monitoring modular or spatial spread module when detecting described control statement after overtime; Described timer control module is that described occupancy monitoring modular is provided with the detection timer and notifies described occupancy monitoring modular when regularly arriving.
Based on such scheme, further, also comprise as lower module:
Alarm module is used for sending alarm notification when detecting described database space above usage threshold.
After adopting technical solutions according to the invention, database space administration module periodic monitor database space operating position, the occupancy in space, computational data storehouse in real time, by with preestablish threshold values relatively, can before taking, database space in time find, and automatic expansion, simultaneously, notify DBA, avoided the application outage that causes thus.The increment size of extending space is selected appropriate value through behind the test analysis, can avoid the system IO that causes owing to extending database busy.Can discern the type of SYBASE database facility automatically, DATA and LOG expand respectively, can avoid the mixing use of equipment and the management inconvenience that brings thus.Can also send alarm notification data base administrator (DBA) in real time, so that Database Systems are carried out safer monitoring and management, guaranteed that service application is not subjected to the influence that brings because of the database insufficient space, has guaranteed the stability and the continuation of application system height.
Description of drawings
Fig. 1 is the application model synoptic diagram of database space administration module of the present invention;
Fig. 2 is that database space administration module of the present invention is formed structural representation;
Fig. 3 is database space administration module realization flow figure of the present invention.
Embodiment
With embodiment the present invention is described in further detail with reference to the accompanying drawings below:
Core concept of the present invention is, in modular mode, database space is carried out the management of centralization, be connected to database server by the Database Dynamic chained library, by using data base query language from the database dictionary table, to obtain the operating position of database space, calculate the occupancy of database space, when occupancy arrives predefined threshold values, by the expansion in corresponding data library control statement fulfillment database space.
Fig. 2 example the composition structural drawing of the database space administration module that proposes of the present invention, the database space administration module mainly comprises database connection pool module, timer control module, occupation rate monitoring modular, spatial spread module, overtime control module, alarm module.The database connection pool module is used to set up and manage the session connection of database server; The timer control module is used to be provided with occupation rate and detects timer; The occupation rate monitoring modular is used to carry out described database space occupation rate monitoring operation; The spatial spread module is used to carry out described database space extended operation; Overtime control module is used to monitor described database space occupation rate monitoring operation, whether the database space extended operation is overtime, and carries out timeout treatment;
Occupation rate monitoring modular and spatial spread module send the database control statement by the database connection pool module, overtime control module is monitored the execution of data library control statement, when detect control statement overtime after notice occupation rate monitoring modular or spatial spread module; Described timer control module is that described occupation rate monitoring modular is provided with the detection timer and notifies described occupation rate monitoring modular when regularly arriving; Alarm module is used for sending alarm notification when detecting database space above usage threshold, the signal that can send according to the signal or the overtime control module of occupation rate monitoring modular transmission sends alarm notification.
Fig. 1 example the application scenarios figure of the database space administration module that proposes of the present invention, database space administration module of the present invention can be installed on a management node on the network, monitor the database space occupancy situation of many database servers simultaneously, realize centralized management, individual processing.Database space administration module and database server can be installed on the same node, reduce investment outlay.Can be at different service application databases, different database space types is set different threshold thresholds.For example, for the intensive application of inquiry,,,, therefore lower threshold threshold can be set so the database space growth is slow because more new data is considerably less in the short time as geographical information library; For upgrading the frequent application of operation, as electronic commerce database, telecommunications call bill data storehouse, because interpolation, deletion, the retouching operation of data are very many, so the speed that data space increases also can be very fast, therefore bigger threshold threshold can be set, give the sufficient reaction time of keeper.Accordingly, the data storage that can same class be used according to the access characteristics of data so just helps improving the operational efficiency of Database Systems more in different data spaces.
Fig. 3 is database space administration module realization flow figure of the present invention, and the database space administration module operates in management end, and is corresponding, and the database server of being managed is a Managed Client.Before the beginning treatment scheme, need carry out initialization to database space management module, initialized main task is that SYBASE related system environmental variance is set, configuration interface file.The api interface that the database space administration module provides by SYBASE client dynamic link library (DB-Lib or CT-Llib) is connected to the database server that needs monitoring, and the user of connection must have the authority of DBA.The early warning threshold threshold in difference setting data (DATA) space and daily record (LOG) space, the database of descriptions space requirement had been expanded after promptly the number percent of usage space and gross space had surpassed this threshold value.Below each step is described in detail:
Step 1, management end are established to the connection of database server;
Be established to the connection of database server by the connection string that is configured to database server.
Step 2, timer is set at management end;
The timer (assumption period is N minute) in a fixed length cycle is set, and every N minute, monitoring modular was to the space operating position of an application data base of database server inquiry.Attention: the timer here is not a cycle timer, but disposable timer as the need circulation, then needs to reset.
Step 3, the wait of delaying time wait for that timing arrives, and delay time is configurable;
Step 4, judge timing to not, if do not proceed the time-delay wait to execution in step 3 then, otherwise execution in step 5;
Step 5, management end pass through the gross space and the remaining space size of query sentence of database Query Database server;
For can reflecting the current state of database space more accurately, can be before inquiring about, by control statement, described database space is once put in order and shunk.
After the inquiry in step 6, the management end execution in step 5, carry out overtime judgement immediately, if the overtime then execution in step 7 of query statement, if not, then execution in step 8;
Behind each execution data base querying or database control statement, system all can start overtime controlling mechanism, when returning correct presentation of results statement in setting-up time, query statement or control statement obtained correct execution, when performed statement does not have return results for a long time or returns mistake, the overtime grade when indicating, illustrate and problem occurred, for example produced: the unexpected disconnection, Network Transmission is overtime, situations such as database server is busy, query statement or control statement can't obtain correct execution, just need carry out timeout treatment, the operation that need reform and not finish this moment.If N continuous time operation all not have successfully, then disconnect and reconnect the database connection, reenter next monitoring periods, N can according to circumstances set.
Step 7, judge that whether expired times surpass set point number, if surpass, then execution in step 17, if do not surpass, then execution in step 5;
The space hold rate of step 8, management end computational data server
The database server space comprises the two kinds of space types in DATA space and LOG space, respectively two types space is inquired about, and calculates occupation rate respectively.The remaining space separately of DATA and LOG and separately gross space can unite acquisition by 4 system's tables of master database of SYBASE, system's table comprises master.dbo.sysusages, master.dbo.spt_values, master.dbo.sysdatabases, master.dbo.sysdevices.Can calculate the DATA/LOG space hold rate of this database by remaining space and gross space, account form is (1-remaining space/gross space) * 100%.
Step 9, judge whether the space hold rate meets or exceeds threshold threshold; If then execution in step 10, if not, then execution in step 2;
DATA space and LOG space are judged respectively,, then reset timer, enter next monitoring periods if DATA/LOG space hold rate does not reach predefined DATA/LOG early warning threshold threshold; If the DATA/LOG space occupancy reaches or surpass predefined DATA/LOG early warning threshold threshold, then expand according to following steps,
Step 10, management end are selected available database facility on the data server by carrying out query statement;
Database server is based upon on the database facility (device), so, guarantee that enough device spaces can use, can be volume or the big file that file system is arranged, also can be raw device.Seek the database facility of free space maximum, can obtain available device name from master.dbo.sysdevices and master.dbo.sysusages.Should be noted that data space is based upon on the DATA equipment, log space is based upon on the LOG equipment, avoids mixing and uses.
Whether the query statement of step 11, management end determining step 10 is overtime, if then execution in step 12, if not, then execution in step 13;
Step 12, judge that whether expired times surpass set point number, if surpass, then execution in step 17, if do not surpass, then execution in step 10;
Database space on step 13, the management end extending database server;
When carrying out the database spatial spread, should select the increment size (extend) of suitable extending space.Because database space expansion, can take the IO resource of operating system, if the one extension space is too big, system IO can be extremely busy, thereby, may have influence on the performance of application; If the one extension space is too small, may cause the database space fragment more again, be not easy to management.Suggestion is chosen in more than the 20M, in the 100M.
Expansion DATA/LOG space.Alter database order by SYBASE is finished.
Whether the control statement of step 14, determining step 13 is overtime, if then execution in step 15, if not, then execution in step 16;
Step 15, judge that whether expired times surpass set point number, if surpass, then execution in step 17, if do not surpass, then execution in step 13;
Step 16, carry out alarm notification to data base administrator (DBA), execution in step 2 then;
The connection in step 17, turn-off data storehouse, execution in step 1.
The present invention also can have other various embodiments; under the situation that does not deviate from spirit of the present invention and essence thereof; those skilled in the art work as can make various corresponding changes and distortion according to the present invention, but these corresponding changes and distortion all should belong to the protection domain of the appended claim of the present invention.

Claims (9)

1, a kind of database space automatic expansion method is characterized in that, described method is used to manage concentratedly the space of one or more database servers, comprise the steps,
A, connect one or more database servers by the client dynamic link library;
B, supervision timer is set; If arrive then execution in step C of timing, if no show is then waited for;
Thereby C, obtain the gross space and the remaining space size of data space and log space respectively, and the space hold rate of computational data space and log space respectively by the system's table in the query sentence of database Query Database;
Whether the space hold rate of D, judgment data space and log space meets or exceeds threshold value, if meet or exceed described threshold value, then selects the data available library facilities, and expands described data space and log space by the database control statement.
2, method according to claim 1 is characterized in that, among the step C, before carrying out described inquiry, also comprise to described database space put in order, step of shrinking.
3, method according to claim 1 is characterized in that, among the step D, can set different threshold values according to service application type, the space type of described database.
4, method according to claim 1 is characterized in that, among the step D, described database facility can be raw device or the volume equipment that has file system.
5, method according to claim 1 is characterized in that, among the step D, if described database space occupancy does not reach threshold value and executing the arbitrary situation of described extended operation when occurring, also comprises the step that re-executes step B.
6, according to any described method of claim in the claim 1 to 5, it is characterized in that,, also comprise the step that sends alarm information to the data base administrator determining described database space occupancy when meeting or exceeding threshold value.
7, according to any described method of claim in the claim 1 to 5, it is characterized in that, in the process that described database is operated, if the overtime or accidental interruption of database session then starts retry mechanism, if it is still unsuccessful above set point number to repeat described operation, then the turn-off data storehouse connects, execution in step A if run succeeded, then continues to carry out subsequent step in set point number.
8, a kind of administration module of database space automatic expansion is characterized in that, comprises as lower module:
The database connection pool module is used to set up and manage the session connection of database server;
The timer control module is used to be provided with occupancy and detects timer;
The occupancy monitoring modular, thereby be used for obtaining respectively the gross space and the remaining space size of data space and log space by system's table of query sentence of database Query Database, the computer memory occupancy, and according to setting thresholding the space hold rate is monitored;
The spatial spread module is used for carrying out by the database control statement extended operation of data space and log space;
Overtime control module, whether the extended operation that is used to monitor the monitoring operation of described occupancy detection module and spatial spread module is overtime, and carries out timeout treatment;
Described occupancy monitoring modular and spatial spread module send the database control statement by described database connection pool module, described overtime control module is monitored the execution of described database control statement, notifies described occupancy monitoring modular or spatial spread module when detecting described control statement after overtime; Described timer control module is that described occupancy monitoring modular is provided with the detection timer and notifies described occupancy monitoring modular when regularly arriving.
9, administration module according to claim 8 is characterized in that, also comprises as lower module:
Alarm module is used for sending alarm notification when detecting described database space above usage threshold.
CN200710175823A 2007-10-12 2007-10-12 Data-base space automatic extended method and management module Active CN100578507C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710175823A CN100578507C (en) 2007-10-12 2007-10-12 Data-base space automatic extended method and management module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710175823A CN100578507C (en) 2007-10-12 2007-10-12 Data-base space automatic extended method and management module

Publications (2)

Publication Number Publication Date
CN101140594A CN101140594A (en) 2008-03-12
CN100578507C true CN100578507C (en) 2010-01-06

Family

ID=39192546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710175823A Active CN100578507C (en) 2007-10-12 2007-10-12 Data-base space automatic extended method and management module

Country Status (1)

Country Link
CN (1) CN100578507C (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593178B (en) * 2008-05-30 2011-07-13 中兴通讯股份有限公司 Method of multidimensional automatic triggering for extending database
CN101551771B (en) * 2009-05-08 2012-09-26 中兴通讯股份有限公司 Method and system for monitoring remote database running state
CN101557291B (en) * 2009-05-25 2011-09-28 杭州华三通信技术有限公司 Method for log aggregation and device thereof
CN101840314B (en) * 2010-05-05 2011-08-17 北京星网锐捷网络技术有限公司 Method, device and server for expanding storage space of database
CN102262626B (en) * 2010-05-24 2013-08-07 阿里巴巴集团控股有限公司 Method and device for storing data in database
CN103166773A (en) * 2011-12-09 2013-06-19 国家电网公司 Method and system for monitoring operation state of server
CN103488575B (en) * 2013-08-12 2017-02-01 记忆科技(深圳)有限公司 Method for dynamically adjusting reserved space of solid-state hard disk and solid-state hard disk
CN103870359A (en) * 2014-02-21 2014-06-18 上海华力微电子有限公司 Method for efficiently storing test log
CN103970907A (en) * 2014-05-28 2014-08-06 浪潮电子信息产业股份有限公司 Method for dynamically expanding database cluster
CN104881477B (en) * 2015-06-03 2018-09-21 上海新炬网络信息技术股份有限公司 A kind of application data space uses evaluation method
CN106376034B (en) * 2016-10-19 2020-02-11 深圳市晟碟半导体有限公司 Method and system for rapidly acquiring state of equipment in wireless Mesh network
CN109800261B (en) * 2018-12-15 2024-04-05 平安科技(深圳)有限公司 Dynamic control method and device for double-database connection pool and related equipment
CN113220694A (en) * 2021-06-02 2021-08-06 中国农业银行股份有限公司 Data table processing method and device, server and storage medium

Also Published As

Publication number Publication date
CN101140594A (en) 2008-03-12

Similar Documents

Publication Publication Date Title
CN100578507C (en) Data-base space automatic extended method and management module
CN101707632A (en) Method for dynamically monitoring performance of server cluster and alarming real-timely
CN108038043B (en) Distributed storage cluster warning method, system and equipment
CN101437259B (en) Method, apparatus and system for establishing incidence relation between each system of integrated multi-module base station
CN102354296B (en) A kind of monitoring system and method that can expanding monitoring resources
CN107870982B (en) Data processing method, system and computer readable storage medium
CN102412998A (en) Operation service system and maintenance method and device thereof
CN104378221A (en) Asynchronous calling method applied to integrated circuit production line monitoring system
CN105429791A (en) Distributed service state detection device and method
CN110611603B (en) Cluster network card monitoring method and device
CN102651883A (en) Method and apparatus for detecting connection loss of terminal
WO2023123801A1 (en) Log aggregation system, and method for improving availability of log aggregation system
CN108833451B (en) Domestic safety control platform-based multistage control system and control method
CN111147560A (en) Data synchronization method based on HTTP (hyper text transport protocol) protocol high speed, high stability and breakpoint continuous transmission
CN110839089A (en) Server positioning method, system, electronic equipment and storage medium
CN100484014C (en) Distributed cluster service management system and service management method in intelligent network
CN103198041A (en) Method for establishing IEC61970 GID (general interface definition) interface
CN101605045A (en) A kind of report method of alarm notification message
CN114338794B (en) Service message pushing method and device, electronic equipment and storage medium
CN110677303A (en) Network management system
CN113434604B (en) Time sequence database synchronization method, system, equipment and storage medium
CN113766363B (en) Fault monitoring method and device and computing equipment
JP2010527475A (en) Information appliance data storage system and data processing method
CN113840002A (en) Information processing method, system, equipment and medium for locker under weak network environment
CN113472566A (en) Status monitoring method of union block chain and master node status monitoring system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant