CN101174271A - Database system management method - Google Patents

Database system management method Download PDF

Info

Publication number
CN101174271A
CN101174271A CNA2007101681772A CN200710168177A CN101174271A CN 101174271 A CN101174271 A CN 101174271A CN A2007101681772 A CNA2007101681772 A CN A2007101681772A CN 200710168177 A CN200710168177 A CN 200710168177A CN 101174271 A CN101174271 A CN 101174271A
Authority
CN
China
Prior art keywords
database
management system
statement
translation
translated
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.)
Granted
Application number
CNA2007101681772A
Other languages
Chinese (zh)
Other versions
CN101174271B (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.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China 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 Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN2007101681772A priority Critical patent/CN101174271B/en
Publication of CN101174271A publication Critical patent/CN101174271A/en
Application granted granted Critical
Publication of CN101174271B publication Critical patent/CN101174271B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The invention provides a database system management method, which comprises the following steps: set up a translation management system in the database system; an application program sends an application instruction sentence to be executed to the translation management system; the translation management system translate a general instruction into a database language adaptable to a target database; the translation management system transmits the relevant translated database language to the database management system; the database management system implements the instruction and returns the results to a user application program. By adopting the database system management method in the invention, whatever types of the database products used by the application program, the sentences sent to the translation management system from the application program are identical; the database types in current use are acquired and translated into inquiry or update sentences corresponding to different databases by the translation management system. Thus, the invention has the advantage of enabling one application program to be used on different databases without modifying the codes.

Description

Database system management method
Technical field
The present invention relates to the database system management field, relate in particular to a kind of management method of operating between the multi-type database of realizing.
Background technology
Multiple different database product is arranged on the current market, comprise SQL SERVE, 0RACLE, DB2 etc., general database realize that the step of inquiry comprises: 1) user's application programs is sent instruction; 2) the application program instruction that will receive sends to data base management system (DBMS) (DBMS); 3) data base management system (DBMS) (DBMS) is called corresponding query statement database (DB) is operated; 4) the data base management system (DBMS) result that will inquire is back to application program and finishes query function.
Though various Database Systems have all realized the SQL-92 standard, they have all expanded this standard simultaneously more or less, have some unique SQL (Structured Query Language) syntactic structure.That is to say the inquiry that is applicable to certain database or upgrade statement and not necessarily be applicable to another kind of database, this brings some difficulties for common application program: application program is want to be relayed to another kind of database environment from a kind of database environment, inquiry that comprises in the reprogramming simultaneously or renewal statement make it corresponding with all types of databases.
Summary of the invention
The object of the present invention is to provide a kind of database system management method, it can realize that same application operates between distinct type data-base.
Database system management method of the present invention is included in and is provided with the translation management system in these Database Systems, also comprises:
Application program is sent to pending universal command statement the step of translation management system;
The translation management system is translated into universal command the step of the database language that adapts with target database;
Associated databases language after the translation management system will be translated sends to the step of data base management system (DBMS);
Data base management system (DBMS) executes instruction, and the result is returned to the step of user application.
Preferably, database system management method of the present invention also is included in the described universal command statement comment statement is set, and described translation management system is translated at this comment statement, and is translated into the execution command statement that adapts with target database.
Described translation management system is translated into the database language that target database adapts with universal command and is comprised:
Receive universal command statement step;
Inquire about and obtain the step of target database type;
Judge whether to comprise the step of comment statement;
Analyze the step of comment statement content;
Judge whether to comprise the step of the peculiar element of target database;
Translate peculiar element, itself and target database are adapted;
Adopt database system management method of the present invention, no matter what application program was used is the database product of which kind of type, the statement that application program sends to the translation management system all is identical, obtain the type of database of current use and translate into the database language that adapts with each database by the translation management system, do not need to revise code can realize that same application program is moved on disparate databases purpose thereby reached.
Description of drawings
Fig. 1 adopts embodiment of the invention translation management system to constitute synoptic diagram;
Fig. 2 is the process flow diagram of database system management method embodiment of the present invention;
Fig. 3 is the translation flow figure of database system management method embodiment of the present invention;
Fig. 4 is the process flow diagram that database system management method embodiment of the present invention carries out query function;
Fig. 5 is the process flow diagram that database system management method embodiment of the present invention carries out update functions.
The realization of the object of the invention, functional characteristics and advantage will be in conjunction with the embodiments, are described further with reference to accompanying drawing.
Embodiment
The present embodiment Database Systems comprise data base management system (DBMS), the translation management system.
Wherein, data base management system (DBMS) comprises tissue and access module, affairs operational management module and the database maintenance module of schema translation module, application program collector, interactive inquiry module, data.
The schema translation module is used to provide data definition language (DDL) (DDL), and the maintenance management of various data manipulations of database (as search, revise, insert and deletion etc.) and database all is to be according to carrying out by its database schema of writing with it.
The application program collector is compiled into the target program that can move to the application program that is comprising the accessing database statement under the data base management system (DBMS) support.
The interactive inquiry module is used to provide wield interactive inquiry language, as sql like language.Data base management system (DBMS) is responsible for carrying out querying command, and Query Result is presented on the screen.
The tissue of data and access module are used to provide physical organization and the access method of data on peripheral storage facilities.
Affairs operational management module is used to provide affairs operational management and running log, the security monitoring and the data integrity inspection of affairs operation, functions such as the concurrent control of affairs and system recovery.
The database maintenance module is used to the data base administrator that the software support is provided, and comprises maintenance tools such as Data Security Control, integrity ensuring, DB Backup, database reorganization and performance monitoring.
As shown in Figure 1, the translation management system comprises the statement judge module of general SQL statement, and it is used to judge whether general SQL statement is legal;
The statement parsing module, it is used for resolving the formation element of general SQL statement;
The statement translation module, it is used for general SQL statement is translated into the specific SQL statement that is suitable on the target database.
As shown in Figure 2, the database system management method of present embodiment comprises:
S101: application program is sent to pending universal command the step of translation management system;
S102: the translation management system is translated into universal command the database language that adapts with target database;
Associated databases language after S103 translation management system will be translated sends to data base management system (DBMS);
S104: data base management system (DBMS) executes instruction, and the result is returned to user application.
The present embodiment data base management method is provided with comment statement in the universal command statement, above-mentioned translation management system is translated at this comment statement, and is translated into the database language that adapts with target database.
As shown in Figure 3, above-mentioned translation management method for managing system is realized Translation Processing by following concrete steps:
In the S201 step, the user sends application instruction by application program to database, and application program is sent to data base management system (DBMS) with above-mentioned application instruction;
In the S202 step, the target database type is inquired about and obtained to data base management system (DBMS) at this common application instruction;
In the S203 step, data base management system (DBMS) is judged at above-mentioned application instruction statement confirm whether comprise comment statement in this application instruction statement;
In S204 and S205 step, data base management system (DBMS) is analyzed at the content of comment statement, and judges whether this comment statement comprises and the corresponding peculiar element of target database;
In the S206 step, translation of translation management system and the corresponding peculiar element of target database adapt itself and target database;
In the S207 step, other parts of translation management system translation universal command statement.
Fig. 4 and Fig. 5 are the process flow diagrams that adopts database system management method fulfillment database system queries of the present invention and update functions.
As shown in Figure 4, Database Systems realize query manipulation by following concrete steps:
In the S301 step, external system sends the general polling SQL statement to translating management system;
In the S302 step, the statement judge module of translation management system is judged the legitimacy of general polling SQL statement;
In the S303 step, the statement parsing module of translation management system is resolved the general polling SQL statement, obtains the target database type;
In the S304 step, the translation mould of translation management system is translated into query SQL statement suitable on the target database according to the target database type with the general polling SQL statement soon;
In the S305 step, the statement as a result of the fast translation of translation mould sent to carry out query manipulation in the database.
As shown in Figure 5, Database Systems realize upgrading operation by following concrete steps:
In the S401 step, external system sends general renewal SQL statement to translating management system;
In the S402 step, the statement judge module of translation management system is judged the legitimacy of general renewal SQL statement;
In the S403 step, the statement parsing module of translation management system is resolved general renewal SQL statement, obtains the target database type;
In the S404 step, the translation mould of translation management system is translated into renewal SQL statement suitable on the target database according to the target database type with general renewal SQL statement soon;
In the S405 step, the fast statement of translating as a result of translation mould is sent to execution renewal operation in the database.
In the general way, a kind of distinctive database element of the every support of application program just must increase corresponding syntactic structure in general SQL grammer supports, does not accomplish to expand flexibly.
Present embodiment uses the mode of note that distinctive database element is supported, does not revise the syntactic structure of general SQL when realizing the peculiar database element of expansion.
Below be the syntactic structure of general SQL-92:
SELECT[ALL|DISTINCT]
[TOP?expression[PERCENT][WITH?TIES]]
<select_list>
<select_list>::=
{
*
|{table_name|view_name|table_alias}.*
|{
[{table_name|view_name|table_alias}.]
{column_name|$IDENTITY|$ROWGUID}
|udt_column_name[{.|::}{{property_name|
field_name}
|method_name(argument[,...n])}]
|expression
[[AS]column_alias]
}
|column_alias=expression
}[,...n]
Wherein/and * ... */can occur in any element, the expression explanatory notes will be left in the basket when carrying out.Now, in order to support on the ORACLE database/NOLOCK element on *+ALL_ROWS*/element and the SQLSERVER database, not needing to change this syntactic structure, is their concrete literary style below:
SELECT/*+ALL_ROWS*/f1?FROM?t1
SELECT/*NOLOCK*/f1?FROM?t1
As follows respectively through the SQL grammer after the translation of translation management system:
The ORACLE database:
SELECT/*+ALL_ROWS*/f1?FROM?t1
SELECT?f1?FROM?t1
SQL SERVER database:
SELECT?f1?FROM?t1
SELECT?f1?FROM?t1?WITH(NOLOCK)
By the translation of present embodiment data base interpretation management system, above-mentioned general sql like language is translated into the database language that adapts with each database, thereby realizes the support to the database features element, to shield each database difference.Present embodiment data base interpretation management system is used the mode of note, can realize revising existing syntax format and just can support unlimited characteristic element to expand, and has improved the scope of application of syntax format greatly.
The above only is the preferred embodiments of the present invention; be not so limit claim of the present invention; every equivalent structure or equivalent flow process conversion that utilizes instructions of the present invention and accompanying drawing content to be done; or directly or indirectly be used in other relevant technical fields, all in like manner be included in the scope of patent protection of the present invention.

Claims (6)

1. a database system management method is provided with the translation management system in these Database Systems, also comprises:
Application program is sent to pending universal command statement the step of translation management system;
The translation management system is translated into universal command the step of the database language that adapts with target database;
Associated databases language after the translation management system will be translated sends to the step of data base management system (DBMS);
Data base management system (DBMS) executes instruction, and the result is returned to the step of user application.
2. database system management method as claimed in claim 1, it is characterized in that, the step of comment statement is set in described universal command statement, and described translation management system is translated at this comment statement, and is translated into the execution command statement that adapts with target database.
3. database system management method as claimed in claim 1 or 2 is characterized in that, the step that described translation management system is translated into the database language that target database adapts with universal command comprises:
Receive the step of universal command statement;
Inquire about and obtain the step of target database type;
Judge whether to comprise the step of comment statement;
Analyze the step of comment statement content;
Judge whether to comprise the step of the peculiar element of target database;
Translate peculiar element, the step that itself and target database are adapted.
4. database system management method as claimed in claim 1 or 2 is characterized in that, above-mentioned translation management system comprises:
The statement judge module, it is used to judge whether general SQL statement is legal;
The statement parsing module, it is used for resolving the formation element of general SQL statement;
The statement translation module, it is used for general SQL statement is translated into the specific SQL statement that is suitable on the target database.
5. carry out database system queries method of operating for one kind, be provided with the translation management system in these Database Systems, further comprising the steps of:
External system sends the step of general polling SQL statement;
The translation management system is translated into the general polling SQL statement according to the target database type step of query SQL statement suitable on the target database;
The statement as a result of translation management system translation is sent to the step of carrying out query manipulation in the database.
6. one kind is adopted the method for upgrading Database Systems, is provided with the translation management system in these Database Systems, further comprising the steps of:
External system sends the step of general renewal SQL statement;
The translation management system is translated into general renewal SQL statement according to the target database type step of renewal SQL statement suitable on the target database;
The statement as a result of translation management system translation is sent to the step of carrying out the renewal operation in the database.
CN2007101681772A 2007-11-28 2007-11-28 Database system management method Active CN101174271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2007101681772A CN101174271B (en) 2007-11-28 2007-11-28 Database system management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2007101681772A CN101174271B (en) 2007-11-28 2007-11-28 Database system management method

Publications (2)

Publication Number Publication Date
CN101174271A true CN101174271A (en) 2008-05-07
CN101174271B CN101174271B (en) 2010-06-02

Family

ID=39422786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2007101681772A Active CN101174271B (en) 2007-11-28 2007-11-28 Database system management method

Country Status (1)

Country Link
CN (1) CN101174271B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521254A (en) * 2011-11-17 2012-06-27 广东电网公司电力科学研究院 Uniform access method of isomeric database
CN102750384A (en) * 2012-06-28 2012-10-24 用友软件股份有限公司 Device and method for acquiring data from multidatabase engine
CN103176782A (en) * 2011-12-22 2013-06-26 北大方正集团有限公司 Method and device for visiting data bases
CN103530099A (en) * 2012-07-05 2014-01-22 上海汽车集团股份有限公司 Data development and management system
CN103605777A (en) * 2013-11-28 2014-02-26 北京国双科技有限公司 Database index processing method and device
CN104615713A (en) * 2015-02-05 2015-05-13 浪潮通用软件有限公司 SQL executing method and device based on multiple database types
CN105912427A (en) * 2016-04-29 2016-08-31 浪潮(北京)电子信息产业有限公司 Data disaster tolerance synchronization method and device
CN108446289A (en) * 2017-09-26 2018-08-24 北京中安智达科技有限公司 A kind of data retrieval method for supporting heterogeneous database
CN108920109A (en) * 2018-07-19 2018-11-30 郑州云海信息技术有限公司 A kind of storage platform Explore of Unified Management Ideas, device, equipment and system
CN109408573A (en) * 2018-10-11 2019-03-01 上海瀚银信息技术有限公司 A kind of data collection system and collecting method of database

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521254A (en) * 2011-11-17 2012-06-27 广东电网公司电力科学研究院 Uniform access method of isomeric database
CN103176782A (en) * 2011-12-22 2013-06-26 北大方正集团有限公司 Method and device for visiting data bases
CN102750384A (en) * 2012-06-28 2012-10-24 用友软件股份有限公司 Device and method for acquiring data from multidatabase engine
CN103530099A (en) * 2012-07-05 2014-01-22 上海汽车集团股份有限公司 Data development and management system
CN103530099B (en) * 2012-07-05 2016-12-21 上海汽车集团股份有限公司 A kind of data mining and management system
CN103605777A (en) * 2013-11-28 2014-02-26 北京国双科技有限公司 Database index processing method and device
CN104615713A (en) * 2015-02-05 2015-05-13 浪潮通用软件有限公司 SQL executing method and device based on multiple database types
CN105912427A (en) * 2016-04-29 2016-08-31 浪潮(北京)电子信息产业有限公司 Data disaster tolerance synchronization method and device
CN108446289A (en) * 2017-09-26 2018-08-24 北京中安智达科技有限公司 A kind of data retrieval method for supporting heterogeneous database
CN108920109A (en) * 2018-07-19 2018-11-30 郑州云海信息技术有限公司 A kind of storage platform Explore of Unified Management Ideas, device, equipment and system
CN109408573A (en) * 2018-10-11 2019-03-01 上海瀚银信息技术有限公司 A kind of data collection system and collecting method of database

Also Published As

Publication number Publication date
CN101174271B (en) 2010-06-02

Similar Documents

Publication Publication Date Title
CN101174271B (en) Database system management method
US11907247B2 (en) Metadata hub for metadata models of database objects
US10585909B2 (en) Task-execution in a DBMS using stored procedures
EP0747839A1 (en) Database management system with improved indexed accessing
CN105868204A (en) Method and apparatus for converting script language SQL of Oracle
CN101727320A (en) Method and tools for identifying impact of database changes on an application
CN101645074A (en) Method for accessing relational databases of different types
US7020648B2 (en) System and method for identifying and utilizing a secondary index to access a database using a management system without an internal catalogue of online metadata
CN110688397B (en) SQL-based distributed data unified access system and method
US20110302187A1 (en) Schema definition generating device and schema definition generating method
CN102521254A (en) Uniform access method of isomeric database
EP2800013B1 (en) Integration database framework
CN104714974A (en) Method and device for parsing and reprocessing query statement
CN103246704A (en) Mapping method for describing entity and relational data based on conventional data structure
CN105302842A (en) Data processing method and device
US9053207B2 (en) Adaptive query expression builder for an on-demand data service
CN112347108A (en) Data query method and system suitable for hybrid backend
CN116955399A (en) Unified SQL query method, system and medium based on Calcite
CN113282599A (en) Data synchronization method and system
CN105005572A (en) Database mapping method and device
CN100527131C (en) Interdynamic access method and tool of IMS data base
CN116610694A (en) Rule verification method and system based on relation between columns and access sentences
CN107832055A (en) A kind of MQL language translations are the method for sql like language
Xu et al. From XML Schema to Relations: A Incremental Approach to XML Storage
KR20100009314A (en) Extraction method of modified data using meta data

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