CN103838761A - Metadata updating method and device - Google Patents

Metadata updating method and device Download PDF

Info

Publication number
CN103838761A
CN103838761A CN 201210484979 CN201210484979A CN103838761A CN 103838761 A CN103838761 A CN 103838761A CN 201210484979 CN201210484979 CN 201210484979 CN 201210484979 A CN201210484979 A CN 201210484979A CN 103838761 A CN103838761 A CN 103838761A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
metadata
database
updating
information
databases
Prior art date
Application number
CN 201210484979
Other languages
Chinese (zh)
Other versions
CN103838761B (en )
Inventor
刘谋俊
Original Assignee
阿里巴巴集团控股有限公司
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

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/30Information retrieval; Database structures therefor ; File system structures therefor
    • G06F17/30286Information retrieval; Database structures therefor ; File system structures therefor in structured data stores
    • G06F17/30345Update requests

Abstract

The invention discloses a metadata updating method and device for solving the problems that in the prior art, the metadata updating efficiency is low, and the metadata updating accuracy is low. The metadata updating method includes the steps of reading currently-saved metadata of a database cluster with the metadata updating device, determining database identification recorded in the read metadata, having access to databases corresponding to the determined database identification, obtaining current database information and standby database information of the databases from the databases, recording the current database information and the standby database information into updated metadata, and saving the updated metadata to serve as the metadata of the database cluster again. By means of the metadata updating method, the metadata updating device can have access to the various databases in the database cluster according to the various database identification recorded in the currently-saved metadata of the database cluster to obtain the current database information and the standby database information of the databases, the metadata are updated according to the conditions, manual metadata updating is not needed, and the updating efficiency and the updating accuracy of the metadata are improved.

Description

一种元数据的更新方法及装置 A method of updating metadata means and

技术领域 FIELD

[0001] 本申请涉及计算机技术领域,尤其涉及一种元数据的更新方法及装置。 [0001] The present application relates to computer technology, and in particular relates to a method for updating metadata and device.

背景技术 Background technique

[0002] 数据库集群的元数据是一种用于描述该数据库集群的拓扑结果的数据,具体可以描述该数据库集群中包含的各数据库之间的主备关系和级联关系。 [0002] metadata database cluster is a result of topology data for the database cluster descriptions specifically describe the relationship between master and slave relationship between the cascade and the respective databases of the database included in the cluster.

[0003]目前,由于数据库集群在应用的过程中经常会进行主备库切换、新增数据库、硬件升级等操作,这就会改变数据库集群原有的拓扑结构,因此,在对数据库集群进行维护的过程中,就需要对数据库集群的元数据进行更新,以便于后续对数据库集群的管理。 [0003] At present, due to the database cluster in the application process will often be switched standby database, the new database, hardware upgrades and other operations, which will change the original database cluster topology, therefore, the maintenance of the database cluster of course, we need the metadata database cluster to be updated in order to follow-up on the database cluster management.

[0004] 在现有技术中,通常是采用人工的方式确定数据库集群的拓扑结构所发生的变化,并据此对数据库集群的元数据进行更新的。 [0004] In the prior art, usually identified database cluster topology changes that occur artificial manner, and accordingly the metadata database to be updated in the cluster. 显然,这种方法更新元数据的效率较低,而且也会由于人为误差的引入而降低更新的元数据的准确性,尤其是在对大规模数据库集群(包含几百个甚至上千个数据库的数据库集群)的元数据进行更新时,人工更新元数据往往需要消耗大量的人力物力,而且更新的元数据的准确性也较低。 Obviously, this method of updating meta data is less efficient, but also due to the introduction of human error and reduce the accuracy of the updated metadata, especially in large-scale database cluster (comprising hundreds or even thousands of database when the database cluster) metadata update manually update the metadata often requires large amounts of manpower and resources, and the accuracy of the updated metadata is also low.

发明内容 SUMMARY

[0005] 本申请实施例提供一种元数据的更新方法及装置,用以解决现有技术中更新元数据的效率较低、准确性较低的问题。 [0005] The present application provides a method and apparatus for updating meta data, updating the metadata to solve the low efficiency in the prior art, the problem of low accuracy.

[0006] 本申请实施例提供的一种元数据的更新方法,包括: [0006] The present application provides a method for updating metadata, comprising:

[0007] 更新装置针对数据库集群,读取当前保存的所述数据库集群的元数据,确定读取的所述元数据中记录的各数据库标识;并 [0007] The apparatus for updating a database cluster, read the metadata currently stored in the database of the cluster, each of the database to determine the identification of the metadata read recorded; and

[0008] 访问确定的各数据库标识对应的数据库,从各数据库中获取各数据库当前的数据库信息以及各数据库当前的备库信息,并记录在更新元数据中;以及 [0008] Each access the database to determine the database corresponding to the identifier, obtain the current standby current library information database and database information of each of the databases from various databases, and records the metadata is updated; and

[0009] 将所述更新元数据重新作为所述数据库集群的元数据保存。 [0009] The re-updated metadata as the metadata stored in the database cluster.

[0010] 本申请实施例提供的一种元数据的更新装置,包括: [0010] A meta data updating apparatus according to the present embodiment provided by the application, comprising:

[0011] 读取模块,用于针对数据库集群,读取当前保存的所述数据库集群的元数据,确定读取的所述元数据中记录的各数据库标识; [0011] The reading module configured to cluster the database for reading the metadata currently stored in the database of the cluster, each of the database to determine the identification of the metadata read recorded;

[0012] 收集模块,用于访问确定的各数据库标识对应的数据库,从各数据库中获取各数据库当前的数据库信息以及各数据库当前的备库信息,并记录在更新元数据中,将所述更新元数据重新作为所述数据库集群的元数据保存。 [0012] collection module for each database to identify the corresponding database access is determined, to obtain the current standby current library information database and database information of each of the databases from various databases, and recorded in the update metadata, the update re metadata as the metadata stored in the database cluster.

[0013] 本申请实施例提供一种元数据的更新方法及装置,该方法更新装置读取当前保存的数据库集群的元数据,确定读取的元数据中记录的各数据库标识,并访问确定的各数据库标识对应的数据库,从各数据库中获取各数据库当前的数据库信息以及各数据库当前的备库信息,并记录在更新元数据中,将该更新元数据重新作为该数据库集群的元数据保存。 [0013] The present application provides a method and apparatus for updating meta data, the method reads the metadata means updating the currently stored database cluster, each of the database to determine the identification of the metadata read recorded, and accesses the determined each database identity database, to obtain the current standby current library information database and database information of each of the databases from various databases, and recorded in the update metadata, and the re-updating the metadata stored as metadata in the database cluster. 通过上述方法,更新装置可根据当前保存的数据库集群的元数据中记录的各数据库标识,访问该数据库集群中的各数据库,以获取各数据库当前的数据库信息以及当前的备库信息,并据此对元数据进行更新,而无需人为对元数据进行更新,因此提高了元数据更新的效率和准确性。 By the above method, each database updating means according to the cluster database identifying metadata currently stored in the record, accessing the databases of the database cluster, to obtain the current information of each database and the current database of library information, and accordingly meta data is updated, without human meta data is updated, thereby increasing the metadata updates of efficiency and accuracy.

附图说明 BRIEF DESCRIPTION

[0014] 图1为本申请实施例提供的元数据的更新过程; [0014] FIG 1 update process provided by embodiments of the present application metadata;

[0015] 图2为本申请实施例提供的更新装置通过堆栈的方式访问各数据库标识对应的数据库的过程; [0015] FIG. 2 is a process of updating the application access means provided in each of the database corresponding to the identifier by way of the database stack embodiment;

[0016] 图3为本申请实施例提供的Oracle数据库集群的拓扑结构示意图; [0016] FIG. 3 is a schematic Oracle database cluster topology according to an embodiment of the present application;

[0017] 图4为本申请实施例提供的对Oracle数据库集群的元数据进行更新的详细过程; [0017] FIG 4 is a detailed process of updating metadata Oracle database cluster according to an embodiment of the present application;

[0018] 图5为本申请实施例提供的MySQL数据库集群的拓扑结构示意图; [0018] FIG. 5 is a schematic MySQL database cluster topology according to an embodiment of the present application;

[0019] 图6为本申请实施例提供的对MySQL数据库集群的元数据进行更新的详细过程; [0019] FIG. 6 is a detailed process of updating metadata MySQL database cluster according to an embodiment of the present application;

[0020] 图7为本申请实施例提供的元数据的更新装置结构示意图。 [0020] FIG. 7 is a schematic structural diagram of a device of the update metadata embodiment of the present application.

具体实施方式 detailed description

[0021] 下面结合说明书附图对本申请实施例进行详细描述。 [0021] The following embodiments in conjunction with the accompanying drawings of embodiments of the present application is described in detail.

[0022] 图1为本申请实施例提供的元数据的更新过程,具体包括以下步骤: [0022] Figure 1 is provided in the application update process metadata embodiment, includes the following steps:

[0023] SlOl:更新装置针对数据库集群,读取当前保存的该数据库集群的元数据,确定读取的该元数据中记录的各数据库标识。 [0023] SlOl: means for updating a database cluster, the reading metadata currently stored in the database cluster, each of the database to determine the identification of the metadata recorded in the read.

[0024] 由于对于一个数据库集群而言,该数据库集群的元数据记录了该数据库集群中各数据库的数据库标识(用于描述该数据库集群中各数据库之间的主备关系和级联关系),因此,在本申请实施例中,更新装置读取当前保存的该数据库集群的元数据,并确定读取到的该元数据中记录的各数据库标识。 [0024] Since for a database cluster, cluster metadata database records database identifies the database for each cluster database (used to describe the relationship between standby and cascading relationship between the various databases in the database cluster), Thus, in the embodiment of the present application, the metadata update device reads the currently stored database cluster, each of the database and determines the read identification data is recorded in the metadata.

[0025] S102:访问确定的各数据库标识对应的数据库,从各数据库中获取各数据库当前的数据库信息以及各数据库当前的备库信息,并记录在更新元数据中。 [0025] S102: determining access to each database identity database, to obtain the current standby current library information database and database information of each of the databases from various databases, and recorded in the update metadata.

[0026] 确定了当前保存的该数据库集群的元数据中记录的各数据库标识后,更新装置对确定的各数据库标识对应的数据库进行访问,针对访问的每个数据库,从该数据库中获取该数据库当前的数据库信息,以及该数据库当前的备库信息,并记录在更新元数据中。 After [0026] the database to determine the identification of each cluster database metadata currently stored in the record, for each database updating means corresponding to the identifier of the database is accessed to determine, for each database access, access to the database from the database the current database of information, and the current database of library information, and recorded in the update metadata.

[0027] S103:将该更新元数据重新作为该数据库集群的元数据保存。 [0027] S103: The re-update metadata as the metadata stored in the database cluster.

[0028] 将访问的各数据库当前的数据库信息以及备库信息记录在更新元数据中后,则可将该更新元数据重新作为该数据库集群的元数据保存。 After [0028] the current database of library information recording apparatus and the information of each database access in the metadata update, the update metadata may be re-cluster as the metadata stored in the database. 此时,更新装置保存的元数据(更新元数据)中就记录了当前该数据库中每个数据库的数据库信息以及每个数据库的备库信息,因此可以准确的描述当前该数据库中各数据库之前的主备关系和级联关系。 In this case, the device updates the stored metadata (metadata update) on the record of the current database by the library information database of the information for each database and for each database, the database before the current can be accurately described various databases of in master and slave relationship and cascading.

[0029] 通过上述方法,更新装置可根据当前保存的数据库集群的元数据中记录的各数据库标识,访问该数据库集群中的各数据库,以获取各数据库当前的数据库信息和当前的备库信息,并据此对元数据进行更新,而无需人为的对元数据进行更新,因此提高了元数据更新的效率和准确性。 [0029] By the above method, updating means according to various databases identifying metadata database cluster currently stored in the record, accessing the databases of the database cluster, to obtain the current database of information for each database and the current standby database information, and accordingly the metadata updates without artificial meta data is updated, thereby increasing the metadata updates of efficiency and accuracy.

[0030] 具体的,更新装置可以通过堆栈的方式访问通过步骤SlOl确定的各数据库标识对应的数据库,则更新装置执行如图1所示的步骤S102和S103的方法可以如图2所示。 [0030] Specifically, the updating means can be accessed by way of the stack through the database corresponding to the identifier database is determined in step SlOl, the updating means performs the steps shown in FIG. 1 S102 and S103 of the method illustrated in Figure 2.. [0031] 图2为本申请实施例提供的更新装置通过堆栈的方式访问各数据库标识对应的数据库的过程,具体包括以下步骤: [0031] FIG. 2 is a process of updating the application access means provided in each of the database corresponding to the identifier by way of the database stack embodiment, includes the following steps:

[0032] S1021:将确定的各数据库标识添加到预置的堆栈中。 [0032] S1021: Each database identifying the determined preset added to the stack.

[0033] 在本申请实施例中,可预先在更新装置中预置一个堆栈,在通过步骤SlOl确定了各数据库标识后,可将确定的各数据库标识进行入栈操作,即,将确定的各数据库标识添加到预置的该堆栈中。 [0033] In the present application embodiment, can be preset in advance a stack in the updating means, each identifier in the database of each database determined SlOl identified by step, the stack operation will be determined, i.e., each of the determined database identity added to the stack in the preset. 其中,可按照任意顺序将各数据库标识添加到预置的该堆栈中。 Wherein, in any order can be added to the databases identified in the preset stack.

[0034] 例如,假设更新装置通过步骤SlOl确定的数据库标识为标识1、标识2、标识3,这三个数据库标识分别对应于数据库1、数据库2、数据库3,则更新装置以任意顺序将这三个数据库标识添加到预置的堆栈中。 [0034] For example, assume a database by updating the identification means is determined in step SlOl 1 identifier, identifier 2, 3 identifier, which identifies the database corresponding respectively to three databases 1 and 2, a database 3, these updating means any order added to the database to identify three preset stack.

[0035] 另外,对于一个数据库集群来说,如果更新装置未保存该数据库集群的元数据,则在步骤SlOl中,更新装置可将预先保存的预置文件作为当前保存的该数据库集群的元数据进行读取,其中,该预置文件中记录了该数据库集群中的至少一个数据库的数据库标识。 [0035] In addition, a database cluster, if the database updating means does not save metadata cluster, then in step SlOl, the updating means may be stored in advance as a preset file currently stored in the database cluster metadata read, wherein the pre-recorded in the database file identifying at least one database of the database cluster. 当更新装置读取的是预置文件时,则步骤S1021中更新装置添加到堆栈中的即为该预置文件中记录的数据库标识。 When updating means is the preset file is read, step S1021 is added to the database in the updating means, the profile identifier that is recorded in the stack.

[0036] S1022:从该堆栈中弹出一个数据库标识,访问弹出的该数据库标识对应的数据库,获取该数据库的配置文件。 [0036] S1022: identifying from the database a pop the stack, pop-up access to the database corresponding to the identifier of the database, acquires the profile database.

[0037] 继续沿用上例,假设将上述三个数据库标识添加到堆栈中的顺序为标识3、标识 [0037] Continuing with embodiments, it is assumed that the addition of the three identification database to identify the order of the stack 3, identification

1、标识2,且该堆栈为“先入后出”类型的堆栈,则从该堆栈弹出这三个数据库标识时,以添加这三个数据库标识的逆顺序依次进行弹出。 1, identifier 2, and the stack is a "first in, last out" type of stack, the stack pops up from three databases identified, the reverse order to add three databases identified sequentially eject.

[0038] S卩,先弹出标识2,则更新装置通过数据库接口(Data Base Interface, DBI)访问弹出的该标识2对应的数据库2,获取该数据库2的配置文件。 [0038] S Jie, the first pop-up identifier 2, the updating means for accessing the identifier 2 corresponding to the pop-up database via database interface 2 (Data Base Interface, DBI), to obtain the profile database 2.

[0039] S1023:根据获取到的该数据库的配置文件,确定该数据库当前的数据库信息以及该数据库当前的备库信息,并记录在更新元数据中。 [0039] S1023: According to the obtained configuration file of the database, the database information to determine the current and the current database of library information database, and recorded in the update metadata.

[0040] 继续沿用上例,更新装置根据获取到的该数据库2的配置文件,确定该数据库2当前的数据库信息以及该数据库2当前的备库信息。 [0040] Continuing with embodiments, apparatus according to the acquired update the profile database 2, 2 determines current information by the library information database 2 of the current database and the database. 其中,一个数据库的数据库信息包括但不限于该数据库的数据库标识、网络互联协议(InternetPiOtocol,IP)地址信息、端口信息,相应的,该数据库的备库信息包括但不限于该备库的数据库标识、IP地址信息、端口信 Wherein a database information database include, but are not limited to database identifies the database, the network interconnection agreement (InternetPiOtocol, IP) address information, port information, corresponding, standby database information in this database include, but are not limited to database identifies the prepared library , IP address information, port channel

肩、O Shoulder, O

[0041] 具体的,如果要更新的是Oracle数据库集群的元数据,则在上述步骤S1022中,更新装置获取的该数据库的配置文件包括但不限于tnsnames.0ra配置文件,在步骤S1023中,更新装置可根据获取到的tnsnames.0ra配置文件,确定该数据库当前的备库信息。 [0041] Specifically, if the metadata to be updated Oracle database cluster, then in step S1022, the database updating means acquires profile include but are not limited to tnsnames.0ra configuration file, in step S1023, update the device may be acquired tnsnames.0ra profile, determine a current database of library information.

[0042] 假设数据库2的备库为数据库I,则更新装置通过该数据库2的tnsnames.0ra配置文件,可确定该数据库2的备库(数据库I)的数据库信息。 [0042] assume that the database for the database 2 by the library I, the database is updated by means tnsnames.0ra profile 2, the database information database library apparatus 2 (Database I) can be determined.

[0043] 更新装置确定了数据库2当前的数据库信息和数据库2当前的备库信息后,则将数据库2当前的数据库信息和备库信息记录在更新元数据中。 After [0043] 2 current updating means determines by the library information database 2 database information and the current database, the database 2 database information and the current information is recorded in the standby database update metadata.

[0044] S1024:判断当前该堆栈中是否存在数据库标识,若是,则返回步骤S1022,否则执行步骤S103。 [0044] S1024: determining whether there is a database that identifies the current in the stack, if yes, returns to step S1022, otherwise, to step S103.

[0045] 继续沿用上例,更新装置将数据库2当前的数据库信息和备库信息记录在更新元数据中后,判断当前该堆栈中是否仍然存在数据库标识。 [0045] Continuing with Example 2 of the current database updating apparatus information database of library information recording apparatus and after updating the metadata, determines whether the current identification database still exists in the stack. 由于添加到该堆栈中的数据库标识为标识3、标识1、标识2,而现在只弹出了标识2,因此当前该堆栈中还存在标识3和标识1,因此,判断结果为是,返回步骤S1022,S卩,更新装置从该堆栈中弹出标识I (按添加这三个数据库标识的逆顺序进行弹出),访问该标识I对应的数据库1,并继续执行后续步骤。 Since added to the database identifier of the stack to identify 3, identifier 1, identifier 2, but now only pop the identifier 2, and therefore the current in the stack there are identified 3 and identifier 1, thus, the determination result is YES, the process returns to step S1022 , S Jie, updating means is popped from the stack the identification I (reverse order by adding three databases were identified pop), accessing a database corresponding to the identifier I 1, and proceeds to subsequent steps.

[0046] S103:将该更新元数据重新作为该数据库集群的元数据保存。 [0046] S103: The re-update metadata as the metadata stored in the database cluster.

[0047] 当更新装置已经将标识3弹出,并将该标识3对应的数据库3当前的数据库信息和备库信息记录在更新元数据中后,则该堆栈中就已经不存在任何数据库标识,上述步骤S1024的判断结果为否,此时,该更新元数据中已经记录了该数据库集群中每个数据库(数据库1、数据库2、数据库3)当前的数据库信息以及备库信息,因此更新装置可将该更新元数据重新作为该数据库集群的元数据保存。 [0047] When the identification device has been updated pop 3, 3 and the identification information of the current database and library information recording apparatus 3 corresponding to the database after the update metadata, the stack does not exist on any database identified the determination result of step S1024 is NO, then the metadata update has been recorded in the database for each cluster databases (1, 2, a database 3 database) database information and the current standby database information, updating the device may the re-update metadata database cluster as the metadata stored.

[0048] 通过上述方法,当数据库集群中的各数据库进行主备切换时,更新装置则可以准确的通过各数据库的配置文件,确定各数据库最新的数据库信息以及备库信息,从而可以准确的对元数据进行更新。 [0048] By the method described above, when the database cluster each database switchover, the updating means may correct configuration file for each database, determining each database the latest database information by the library information, thereby accurately to the metadata is updated.

[0049] 进一步的,考虑到数据库集群中可能会存在某个数据库下线的情况,因此,为了进一步提高对元数据进行更新的准确性,在上述步骤S1023中,更新装置针对从堆栈中弹出的一个数据库标识,将该数据库标识对应的数据库当前的数据库信息以及该数据库当前的备库信息记录在更新元数据中之前,需要先确定该数据库处于服务状态。 [0049] Further, considering the case where there may be a database offline database cluster, and therefore, in order to further improve the accuracy of the metadata update, the above step S1023, the updating means to eject from the stack identifying a database, the database information of the current database and the current corresponding to the ID database of library information recorded in the database before the update metadata, need to confirm that the database is in service.

[0050] 也即,更新装置针对从堆栈中弹出的一个数据库标识,访问该数据库标识对应的数据库,判断该数据库是否处于服务状态,若是,则获取该数据库的配置文件,并根据获取的配置文件确定该数据库当前的数据库信息和备库信息,记录在更新元数据中,否则,说明该数据库是一个下线的数据库,更新装置可以直接返回上述步骤S1022,继续从堆栈中弹出下一个数据库标识,并执行后续步骤。 [0050] That is, the updating means to eject from the stack in a database identifier, accessing the database corresponding to the identifier database, determines whether the database in service, if yes, obtaining the configuration file of the database, and based on the obtained configuration file determining the current database backup information and library information database, updating metadata in the record, otherwise, indicating that offline database is a database updating means can be returned directly above step S1022, continues to pop up a database identifier from the stack, and the subsequent steps. 这样,对于下线的数据库来说,该数据库的数据库信息就不会被记录在更新元数据中。 In this way, for offline database, the database information of the database will not be recorded in the update metadata.

[0051] 更进一步的,考虑到数据库集群中可能会存在新增数据库的情况,因此,为了进一步提高对元数据进行更新的准确性,在更新装置将弹出的数据库标识对应的数据库当前的数据库信息和备库信息记录在更新元数据之后,判断当前该堆栈中是否存在数据库标识之前,还要确定该数据库当前的备库信息中包含的该备库的数据库标识,如果当前该堆栈中不存在该备库的数据库标识,则将该备库的数据库标识添加到该堆栈中。 [0051] Furthermore, taking into account the new situation may exist in the database in the database cluster, therefore, in order to further improve the accuracy of the metadata update, the current update database information database apparatus corresponding to the identifier of the pop-up database Preparation of library information recorded before and after the update metadata, determines whether there is a database that identifies the current in the stack, but also to determine the database identifier of the current standby database of library information contained in the database, if the current does not exist in the stack Preparation of library identification database, then the database identified by the library was added to the stack.

[0052] S卩,如果弹出的数据库标识对应的数据库当前的某一个备库是新增的数据库,则更新装置在步骤SlOl中读取的元数据中并未记录有该备库的数据库标识,因此,将该数据库当前的数据库信息和备库信息记录在更新元数据中后,将该备库的数据库标识添加到该堆栈中,后续则可以获取到作为该备库的数据库当前的数据库信息以及备库信息,并记录在更新元数据中。 [0052] S Jie, if the pop-up database corresponding to the identifier of the current database is a library prepared by a new database, updating metadata means is read in step SlOl is not recorded in the database identifier of the library apparatus, Thus, the database information and the current information recording standby database after updating the metadata database, the database prepared by the identification of the library to the stack, can be acquired as a subsequent current database library information database of the apparatus and Preparation of library information, and recorded in the update metadata.

[0053] 下面以更新Oracle数据库集群的元数据为例,对上述过程进行详细说明。 [0053] In the following metadata updates Oracle database cluster as an example, the process described in detail above.

[0054] 图3为本申请实施例提供的Oracle数据库集群的拓扑结构示意图,如图3所示,该数据库集群中共包括6个数据库,分别是数据库A、数据库B、数据库C、数据库D、数据库E、数据库F。 [0054] FIG. 3 is a schematic view of the application Oracle database cluster topology provided in the embodiment shown in Figure 3, the database cluster comprises six CCP database, the database are A, B database, database C, D database, the database E, F. database 其中,数据库A为主库,数据库B、数据库C、数据库D是数据库A的备库,数据库E、数据库F是数据库B的备库。 Wherein A primary library database, database B, C database, the database D is a database A standby database, the database E, F is a database repository database B in standby. 由图3可见,Oracle数据库集群的拓扑结构是一个树形结构,其中位于根节点的数据库A为主库,其他数据库均为备库。 Figure 3 shows, Oracle database cluster topology is a tree structure, the root node which is located in the main database A database, other databases are prepared by the library. 对该Oracle数据库集群的元数据进行更新的过程具体可以如图4所示。 The process of updating the metadata database cluster Oracle specifically shown in FIG. [0055] 图4为本申请实施例提供的对Oracle数据库集群的元数据进行更新的详细过程,具体包括以下步骤: [0055] FIG 4 is a detailed process of updating the application metadata Oracle database cluster according to an embodiment, includes the following steps:

[0056] S401:更新装置读取当前保存的该数据库集群的元数据,确定读取的该元数据中记录的各数据库标识。 [0056] S401: updating means for reading the metadata currently stored in the database cluster, each of the database to determine the identification of the metadata recorded in the read.

[0057] 其中,如果该Oracle数据库集群是一个新上线的数据库集群,则更新装置当前尚未保存该Oracle数据库集群的元数据,此时更新装置可以将预先保存的预置文件作为该数据库集群的元数据进行读取。 [0057] wherein, if the new Oracle database cluster is a database cluster on the line, the updating means is not currently stored metadata Oracle database cluster, in which case means may update the previously saved preset metadata of the file as a database cluster data is read.

[0058] 具体的,可预先在更新装置中预置一个预置文件,该预置文件中记录该Oracle数据库集群中的至少一个数据库标识。 [0058] Specifically, the document may be preset in advance in a pre-update apparatus, the preset recording at least one database file identifies the Oracle database cluster. 由于Oracle数据库集群的拓扑结构是如图3所示的树形结构,因此,可将位于该树形结构的根节点的数据库的数据库标识记录在该预置文件中,即,将主库(数据库A)的数据库标识记录在预置文件中。 Since the topology of the cluster is the Oracle database tree structure shown in Figure 3, therefore, it may be located in the database to identify the database root node of the tree structure in the pre-recorded file, i.e., the primary library (database a) the database records identified in the preset file.

[0059] S402:将确定的各数据库标识添加到预置的堆栈中。 [0059] S402: Each database identifying the determined preset added to the stack.

[0060] S403:从该堆栈中弹出一个数据库标识,访问弹出的该数据库标识对应的数据库。 [0060] S403: identifying from the database a pop the stack, pop-up access to the database of the database corresponding to the identifier.

[0061] S404:判断该数据库标识对应的数据库是否处于服务状态,若是,则执行步骤S405,否则返回步骤S403。 [0061] S404: judging whether the database corresponding to the identifier database in service, if yes, perform step S405, the otherwise returns to step S403.

[0062] 也即,如果堆栈中某个数据库标识对应的数据库并未处于服务状态,则说明该数据库是已经下线的数据库,因此并不将该数据库的数据库信息和备库信息记录在更新元数据中,返回步骤S403,继续弹出下一个数据库标识。 [0062] That is, if the stack corresponding to the identifier in a database of the database is not in service, then the database is already offline database, the database information and therefore does not prepare a database of library information recorded in the update element data returns to step S403, the identification continues to pop up a database.

[0063] S405:获取该数据库的配置文件。 [0063] S405: obtaining the configuration file for the database.

[0064] S406:根据获取到的该数据库的配置文件,确定该数据库当前的数据库信息以及该数据库当前的备库信息,并记录在更新元数据中。 [0064] S406: The obtained configuration file of the database, the database information to determine the current and the current database of library information database, and recorded in the update metadata.

[0065] S407:确定该数据库当前的备库信息中包含的备库的数据库标识,如果当前该堆栈中不存在该备库的数据库标识,则将该备库的数据库标识添加到该堆栈中。 [0065] S407: determining the current database identified by the library of library information contained in the database, if the absence of the library prepared in the stack of the current identification database, then the database identified by the library was added to the stack.

[0066] S408:判断当前该堆栈中是否存在数据库标识,若是,则返回步骤S403,否则执行步骤S409。 [0066] S408: determining whether there is a database that identifies the current in the stack, if yes, returns to step S403, otherwise step S409.

[0067] S409:将该更新元数据重新作为该数据库集群的元数据保存。 [0067] S409: The re-update metadata as the metadata stored in the database cluster.

[0068] 通过上述方法,当如图3所示的Oracle数据库集群的主备关系发生改变时,更新装置可根据各数据库的配置文件,准确的对元数据进行更新。 [0068] By the method described above, when the master and slave relationship shown in FIG. 3 Oracle database cluster is changed, updating means it may be based on the profile of each database, accurate updating the metadata.

[0069] 当如图3所示的Oracle数据库集群中某个数据库下线时,更新装置也会通过上述步骤S404判断出该数据库未处于服务状态,因此不将该数据库的数据库信息和备库信息记录在更新元数据中。 [0069] When the Oracle database cluster illustrated in Figure 3 when an offline database, updating means also determines that the above-described step S404 by the database is not in service, the database information is not prepared by the library information database and recorded in the update metadata.

[0070] 当如图3所示的Oracle数据库集群中新增某个数据库,或者如图3所示的Oracle数据库集群是一个新上线的数据库集群时,虽然通过上述步骤S402第一次添加到堆栈中的数据库标识可能并不完整,但是通过步骤S407,更新装置则可逐步的将Oracle数据库集群中的所有数据库标识都添加到堆栈中,后续则可以准确的将每个数据库(包括新增数据库)的数据库信息和备库信息记录在更新元数据中。 When [0070] When the Oracle database cluster shown in FIG. 3 in a new database, Oracle database cluster or, as shown in FIG. 3 is a new on-line database cluster, although the first addition to the above-described step S402 the stack the database identification may not be comprehensive, but the S407, the device can be gradually updated database of all identify the Oracle database in the cluster are added to the stack by step, you can accurately follow each database (including the new database) Preparation of database information and library information recorded in the update metadata.

[0071] 而且,当如图3所示的Oracle数据库集群是一个新上线的数据库集群时,只需要人工预置一次预置文件(记录主库的数据库标识)即可,后续再对该Oracle数据库集群的元数据进行更新时,则由于更新装置已经保存了该Oracle数据库集群的元数据,因此无需再人工预置该预置文件,直接读取保存的元数据即可。 [0071] Further, when the Oracle database cluster shown in FIG. 3 is a new on-line database cluster, only one artificial preset preferences file (database records identifying the primary library) to, and then follow the Oracle Database metadata cluster is updated, since the device has been updated to save metadata of the Oracle database cluster, and therefore no longer need to manually preset the preferences file, read directly saved to the metadata.

[0072] 以上是本申请实施例提供的对Oracle数据库集群的元数据进行更新的过程。 [0072] The above is the process of the present application metadata Oracle database cluster is updated according to an embodiment. 下面再以更新MySQL数据库集群的元数据为例,对元数据的更新过程进行详细说明。 Here again to update the MySQL database cluster metadata, for example, the process of updating the metadata described in detail.

[0073] 图5为本申请实施例提供的MySQL数据库集群的拓扑结构示意图,如图5所示,该数据库集群中共包括6个数据库,分别是数据库A、数据库B、数据库C、数据库D、数据库E、数据库F。 [0073] FIG. 5 is a schematic view of the application topology MySQL database cluster according to an embodiment, shown in Figure 5, the database cluster comprises six CCP database, the database are A, B database, database C, D database, the database E, F. database 其中,数据库A和数据库B均是主库,数据库C、数据库D是数据库A的备库,数据库B是数据库C的备库,数据库A是数据库B的备库,数据库E、数据库F是数据库D的备库。 Wherein the database A, and database B are the primary library, database C, database D is prepared by the library database A, and database B is prepared by the library database C, the database A is prepared by the library database B, the database E, database F is a database D library equipment.

[0074] 由图5可见,与如图3所示的Oracle数据库集群的拓扑结构有所不同的是,MySQL数据库集群并不完全是一个树形结构,其中存在环形结构,图5中的环形结构就是由数据库A、数据库B、数据库C构成的,即,数据库A是数据库B的备库、数据库B是数据库C的备库、数据库C是数据库A的备库。 [0074] seen from Figure 5, the Oracle database cluster topology shown in Figure 3 is somewhat different, MySQL database cluster is not entirely a tree structure, wherein there is an annular structure, the annular structure of FIG. 5 a is a database, database B, C database configuration, i.e., a standby database a database library of B, B is the standby database repository database of C, C is a database library database a standby. 也即,在MySQL数据库集群中,可以存在多个主库,而且主库也可以作为其他数据库的备库。 That is, in the MySQL database cluster, there may be a plurality of the primary library, and the library may be used as the primary standby database to other databases. 对该MySQL数据库集群的元数据进行更新的过程具体可以如图6所示。 The process of updating the metadata MySQL database cluster specifically shown in FIG.

[0075] 图6为本申请实施例提供的对MySQL数据库集群的元数据进行更新的详细过程,具体包括以下步骤: [0075] FIG 6 is a detailed application process metadata MySQL database cluster is updated according to an embodiment, includes the following steps:

[0076] S601:更新装置读取当前保存的该数据库集群的元数据,确定读取的该元数据中记录的各数据库标识。 [0076] S601: updating means for reading the metadata currently stored in the database cluster, each of the database to determine the identification of the metadata recorded in the read.

[0077] 具体的,如果该MySQL数据库集群是一个新上线的数据库集群,则更新装置当前尚未保存该MySQL数据库集群的元数据,此时更新装置可以将预先保存的预置文件作为该数据库集群的元数据进行读取。 [0077] Specifically, if the cluster is a MySQL database on a new line database cluster, updating metadata means MySQL database cluster is currently not saved, this time preferences file updating means may be pre-stored as the database cluster reading metadata.

[0078] 其中,可预先在更新装置中预置一个预置文件,该预置文件中记录该MySQL数据库集群中的至少一个数据库标识。 [0078] wherein, may be preset in advance in a pre-set file updating means, the preset recording at least one database file identifies the MySQL database cluster. 较佳的,可将至少一个主库(数据库A或数据库B)的数据库标识记录在该预置文件中。 Preferably, the at least one main repository (database A database or B) is recorded in the database identifies the preferences file.

[0079] S602:将确定的各数据库标识添加到预置的堆栈中。 [0079] S602: Each database identifying the determined preset added to the stack.

[0080] S603:从该堆栈中弹出一个数据库标识,访问弹出的该数据库标识对应的数据库。 [0080] S603: identifying from the database a pop the stack, pop-up access to the database of the database corresponding to the identifier.

[0081] S604:判断该数据库标识对应的数据库是否处于服务状态,若是,则执行步骤S605,否则返回步骤S603。 [0081] S604: judging whether the database corresponding to the identifier database in service, if yes, perform step S605, otherwise returns to step S603.

[0082] S605:获取该数据库的配置文件.[0083] S606:根据获取到的该数据库的配置文件,确定该数据库当前的数据库信息以及该数据库当前的备库信息,并记录在更新元数据中。 [0082] S605: obtaining the configuration file of the database [0083] S606:. The profile acquisition to the database to determine the current database of information of the database and the current by the library information database and recorded in the update metadata .

[0084] S607:确定该数据库当前的备库信息中包含的备库的数据库标识,如果当前该堆栈中不存在该备库的数据库标识,且在本次更新元数据的过程中未访问过该备库,则将该备库的数据库标识添加到该堆栈中。 [0084] S607: determining the database identified by the library of the current standby database information contained in the database, if the current database identifies the prepared library does not exist in the stack, and during this update the metadata is not accessed the Preparation of library, the library standby database identifier added to the stack.

[0085] S608:判断当前该堆栈中是否存在数据库标识,若是,则返回步骤S603,否则执行步骤S609。 [0085] S608: determining whether there is a database that identifies the current in the stack, if yes, returns to step S603, otherwise step S609.

[0086] S609:将该更新元数据重新作为该数据库集群的元数据保存。 [0086] S609: The re-update metadata as the metadata stored in the database cluster.

[0087] 由图6所示的过程可以看出,图6所示的步骤S607与图4所示的步骤S407的区别就在于,当对MySQL数据库集群的元数据进行更新时,如果某个数据库当前的备库的数据库标识不存在于堆栈中,则还要确定在本次对元数据进行更新的过程中未访问过该备库,才将该备库的数据库标识添加到该堆栈中,如果已经访问过该备库,则不将该备库的数据库标识添加到该堆栈中。 [0087] The process shown in Figure 6 can be seen, the difference between the step shown in FIG. 6 in step S607 shown in FIG. 4 S407 is that when the metadata is updated MySQL database cluster, if a database identifying the current database of library is not present in the stack, it is also determined during this updating the metadata is not accessed the standby database, only the backup repository database identifier added to the stack, if has accessed the standby database, the database identifier is not added to the standby database stack.

[0088] 仍以图5所示的MySQL数据库集群为例进行说明,假设将数据库A、数据库B、数据库C的数据库标识添加到了堆栈中,S卩,当前堆栈中的数据库标识为:数据库A、数据库B、数据库C的数据库标识。 [0088] FIG still MySQL database cluster shown in FIG. 5 as an example, assuming add the database A, database B, C database database identifier to the stack, S Jie, a database identifying the current stack is: database A, database B, C of the database identifies the database. 则: then:

[0089] 先从堆栈中弹出数据库C的数据库标识,并将数据库C当前的数据库信息和备库信息记录在更新元数据中,而该数据库C的备库是数据库B,数据库B的数据库标识存在于堆栈中,因此不向堆栈添加数据库B的数据库标识,此时,堆栈中的数据库标识为:数据库A、数据库B的数据库标识; [0089] start the stack pop database identifies the database of C, and C of the current database and database information in standby database update metadata information recorded in the database of the standby library database B is C, B is present in the database identifies the database in the stack, and therefore not added to the database identifier database B stack, this time, the database for the identified stack: database a, B identifies the database of the database;

[0090] 再从堆栈中弹出数据库B的数据库标识,并将数据库B当前的数据库信息和备库信息记录在更新元数据中,而该数据库B的备库是数据库A,数据库A的数据库标识也存在于堆栈中,因此不向堆栈添加数据库A的数据库标识,此时,堆栈中的数据库标识为:数据库A的数据库标识; [0090] and then popped from the stack database identifier database B, the current backup database information and library information database record and update metadata in B, and B is prepared by the library of the database is a database A, A database also identifies the database present in the stack, and therefore not added to the database identifier database a stack, and the database for identifying the stack: a database of the database identifier;

[0091] 最后从堆栈中弹出数据库A的数据库标识,并将数据库A当前的数据库信息和备库信息记录在更新元数据中,而该数据库A的备库是数据库C和数据库D,由于此时数据库C和数据库D的数据库标识并不存在于堆栈中,但数据库C在本次对元数据进行更新的过程中已经访问过,因此不向堆栈添加数据库C的数据库标识,只添加数据库D的数据库标识,此时,堆栈中的数据库标识为:数据库D的数据库标识。 [0091] The last popped from the stack database identifier database A, and database A standby current library information and database information recorded in the update metadata, and the standby database is a database of the database A database D and C, since at this time C database identifies the database and database D is not present in the stack, but the database C during this updating the metadata has been accessed, and therefore do not add to the database identifies the database stack C, D database of the database only add identifying, at this time, the database for the identified stack: identifies the database D is a database.

[0092] 可见,由于图5中MySQL数据库集群的拓扑结构中存在由数据库A、数据库B、数据库C构成的环形结构,因此,如果在弹出数据库A的数据库标识时,将作为该数据库A的备库的数据库C的数据库标识添加到堆栈中,则会造成死循环。 [0092] visible, since there is an annular structure composed of a base A, database B, database C topology 5 MySQL database cluster, and therefore, if the pop-up database identifier database A, as prepared by the database A C library database identifies the database is added to the stack, will result in an endless loop. 从而,在上述图6所示的对MySQL数据库集群的元数据进行更新时,步骤S607中就需要仅将当前堆栈中不存在的、且本次对元数据进行更新的过程中未访问过的备库的数据库标识添加到堆栈中,对于当前堆栈中已经存在的,或者本次对元数据进行更新的过程中已经访问过的备库的数据库标识,则不添加到堆栈中。 Process whereby, when a MySQL database cluster metadata illustrated in FIG 6 described above is updated, in step S607 requires only the current stack is not present, and the present time of the metadata update is not visited prepared identification database library to the stack, for, or during this updating the metadata already exists in the current stack have been visited in the identification database library prepared, is not added to the stack.

[0093] 当然,上述图6所示的方法也可以应用于对Oracle的元数据进行更新的过程,可以达到同样的效果。 [0093] Of course, the method shown in FIG. 6 may be applied to the process of Oracle updating metadata, you can achieve the same effect.

[0094] 以上是本申请实施例提供的元数据的更新方法,基于同样的思路,本申请实施例还提供一种元数据的更新装置,如图7所示。 [0094] The present application is a method for updating the above embodiments provide metadata embodiment, based on the same idea, the present application further provides an apparatus for updating metadata, as shown in FIG.

[0095] 图7为本申请实施例提供的元数据的更新装置结构示意图,具体包括: [0095] Figure 7 is a schematic view of the application updating means structural diagram of a metadata embodiment, comprises:

[0096] 读取模块701,用于针对数据库集群,读取当前保存的所述数据库集群的元数据,确定读取的所述元数据中记录的各数据库标识; [0096] The read module 701, against a database cluster, read the metadata currently stored in the database of the cluster, each of the database to determine the identification of the metadata read recorded;

[0097] 收集模块702,用于访问确定的各数据库标识对应的数据库,从各数据库中获取各数据库当前的数据库信息以及各数据库当前的备库信息,并记录在更新元数据中,将所述更新元数据重新作为所述数据库集群的元数据保存。 [0097] The collection module 702 is configured to identify each database corresponding to the determined database access, the current acquired by the library information database of the current database of information for each of the databases and from each database, and recorded in the update metadata, the the re-updating the metadata as metadata storage database cluster.

[0098] 所述收集模块702具体包括: [0098] The collection module 702 comprises:

[0099] 堆栈单元7021,用于将确定的各数据库标识添加到预置的堆栈中; [0099] The stack unit 7021, for each of the determined database ID is added to the pre-stack;

[0100] 访问单元7022,用于从所述堆栈中弹出一个数据库标识,访问弹出的该数据库标识对应的数据库,获取该数据库的配置文件; [0100] access unit 7022, a database identifying for ejecting from said stack, pop-up access to the database corresponding to the identifier of the database, acquires the profile database;

[0101] 记录单元7023,用于根据获取到的该数据库的配置文件,确定该数据库当前的数据库信息以及该数据库当前的备库信息,并记录在更新单元中; [0101] The recording unit 7023, according to the acquired profile database, the database information to determine the current and the current database of library information of the database, and record update unit;

[0102] 判断更新单元7024,用于判断当前所述堆栈中是否存在数据库标识,若是,则指示所述访问单元7022再次从所述堆栈中弹出一个数据库标识,并继续进行后续步骤,否则,将所述更新元数据重新作为所述数据库集群的元数据保存。 [0102] Analyzing updating unit 7024, configured to determine whether there is a database that identifies the current in the stack, and if yes, again indicating that the access unit 7022 from the identification database a pop the stack, and continues a subsequent step, otherwise, the re-updating the metadata as the metadata stored in the database cluster.

[0103] 所述记录单元7023还用于,在将该数据库当前的数据库信息以及该数据库当前的悲苦信息记录在更新元数据中之前,确定该数据库处于服务状态。 [0103] The recording unit 7023 is further configured to, in the current database of the database information and the current record of the database information in misery before the update metadata, it is determined that the database is in service.

[0104] 所述记录单元7023还用于,在所述判断更新单元7024判断当前所述堆栈中是否存在数据库标识之前,确定该数据库当前的备库信息中包含的该备库的数据库标识,如果当前所述堆栈中不存在该备库的数据库标识,则将该备库的数据库标识添加到所述堆栈中。 [0104] The recording unit 7023 is further configured, in determining the updating unit 7024 determines whether there is a database that identifies the current before the stack, it is determined that the standby database identifies the database of library information currently contained in the database, if the database identifies the current library is prepared by the stack does not exist, then the database identifier is added to the library prepared stack.

[0105] 所述读取模块701具体用于,当未保存所述数据库集群的元数据时,将预先保存的预置文件作为当前保存的所述数据库集群的元数据进行读取,其中,所述预置文件中记录了所述数据库集群中的至少一个数据库的数据库标识。 [0105] The reading module 701 is specifically configured to, when the metadata database cluster unsaved when the preset pre-stored in the database file as the metadata currently stored in the cluster is read, wherein the said pre-recorded in the database file identifying at least one database of the database cluster.

[0106] 本申请实施例提供一种元数据的更新方法及装置,该方法更新装置读取当前保存的数据库集群的元数据,确定读取的元数据中记录的各数据库标识,并访问确定的各数据库标识对应的数据库,从各数据库中获取各数据库当前的数据库信息以及各数据库当前的备库信息,并记录在更新元数据中,将该更新元数据重新作为该数据库集群的元数据保存。 [0106] Application of the present embodiment provides a method and apparatus for updating meta data, the method reads the metadata means updating the currently stored database cluster, each of the database to determine the identification of the metadata read recorded, and accesses the determined each database identity database, to obtain the current standby current library information database and database information of each of the databases from various databases, and recorded in the update metadata, and the re-updating the metadata stored as metadata in the database cluster. 通过上述方法,更新装置可根据当前保存的数据库集群的元数据中记录的各数据库标识,访问该数据库集群中的各数据库,以获取各数据库当前的数据库信息以及当前的备库信息,并据此对元数据进行更新,而无需人为对元数据进行更新,因此提高了元数据更新的效率和准确性。 By the above method, each database updating means according to the cluster database identifying metadata currently stored in the record, accessing the databases of the database cluster, to obtain the current information of each database and the current database of library information, and accordingly meta data is updated, without human meta data is updated, thereby increasing the metadata updates of efficiency and accuracy.

[0107] 本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。 [0107] skilled in the art should understand that the embodiments of the present disclosure may provide a method, system, or computer program product. 因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。 Accordingly, the present disclosure may be of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in conjunction with the form of software and hardware aspects. 而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。 Further, the present application may take the form of a computer program product embodied in one or more of which comprises a computer usable storage medium having computer-usable program code (including but not limited to, disk storage, CD-ROM, optical memory, etc.).

[0108] 本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。 [0108] The present application is a method according to an embodiment of the present application, a flowchart of a computer program product and apparatus (systems) and / or described with reference to block diagrams. 应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。 It should be understood and implemented by computer program instructions and block, and the flowchart / or block diagrams each process and / or flowchart illustrations and / or block diagrams of processes and / or blocks. 可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。 These computer program instructions may be provided to a processor a general purpose computer, special purpose computer, embedded processor or other programmable data processing apparatus to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing apparatus generating in a device for implementing the flow chart or more flows and / or block diagram block or blocks in a specified functions.

[0109] 这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。 [0109] These computer program instructions may also be stored in a computer can direct a computer or other programmable data processing apparatus to function in a particular manner readable memory produce an article of manufacture such that the storage instruction means comprises a memory in the computer-readable instructions the instruction means implemented in a flowchart or more flows and / or block diagram block or blocks in a specified function. [0110] 这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。 [0110] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps on the computer or other programmable apparatus to produce a computer implemented so that the computer or other programmable apparatus execute instructions to provide processes for implementing a process or flows and / or block diagram block or blocks a function specified step.

[0111] 尽管已描述了本申请的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。 [0111] While the present disclosure has been described with preferred embodiments, but those skilled in the art from the underlying inventive concept can make further modifications and variations to these embodiments. 所以,所附权利要求意欲解释为包括优选实施例以及落入本申请范围的所有变更和修改。 Therefore, the appended claims are intended to explain embodiments including the preferred embodiment as fall within the scope of this application and all changes and modifications.

[0112] 显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。 [0112] Obviously, those skilled in the art can make various modifications and variations of the present application without departing from the spirit and scope of the present disclosure. 这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。 Thus, if these modifications and variations of the present disclosure of the present application claims and their equivalents within the scope thereof, the present application is intended to cover these modifications and variations.

Claims (10)

  1. 1.一种元数据的更新方法,其特征在于,包括: 更新装置针对数据库集群,读取当前保存的所述数据库集群的元数据,确定读取的所述元数据中记录的各数据库标识;并访问确定的各数据库标识对应的数据库,从各数据库中获取各数据库当前的数据库信息以及各数据库当前的备库信息,并记录在更新元数据中;以及将所述更新元数据重新作为所述数据库集群的元数据保存。 1. A method for updating metadata, characterized by comprising: means for updating a database cluster, read the metadata currently stored in the database of the cluster, each of the database to determine the identification of the metadata read recorded; and determining access to the databases corresponding to the identifier of the database, the database acquired from each of the current database and the current information of each database of library information of each database, and record the metadata is updated; and the re-updating metadata as the metadata database cluster storage.
  2. 2.如权利要求1所述的方法,其特征在于,访问确定的各数据库标识对应的数据库,从各数据库中获取各数据库当前的数据库信息以及各数据库当前的备库信息,并记录在更新元数据中,将所述更新元数据重新作为所述数据库集群的元数据保存,具体包括: 所述更新装置执行下述步骤Al: 步骤A、将确定的各数据库标识添加到预置的堆栈中; 步骤B、从所述堆栈中弹出一个数据库标识,访问弹出的该数据库标识对应的数据库,获取该数据库的配置文件; 步骤C、根据获取到的该数据库的配置文件,确定该数据库当前的数据库信息以及该数据库当前的备库信息,并记录在更新元数据中; 步骤D、判断当前所述堆栈中是否存在数据库标识,若是,则返回步骤B,否则执行步骤E ; 步骤E、将所述更新元数据重新作为所述数据库集群的元数据保存。 2. The method according to claim 1, wherein each database identifier to determine access to the corresponding database, acquires the current database and the current information of each database of library information from each of the databases in the database, and updates the metadata recorded in data, the update metadata as the metadata re-stored in the database cluster, comprises: updating means performs the following steps Al: step a, each of the determined identification database added to the preset stack; step B, and a pop-up database identifier from the stack, pop-up access to the database corresponding to the identifier of the database, acquires the profile database; step C, and according to the acquired profile of the database, the database information to determine the current database and current database of library information, and recorded in the update metadata; procedure D, the database is determined whether there is currently identified in the stack, if yes, returns to step B, and otherwise, to step E; step E, the update re metadata as the metadata stored in the database cluster.
  3. 3.如权利要求2所述的方法,其特征在于,将该数据库当前的数据库信息以及该数据库当前的备库信息记录在更新元数据中之前,所述方法还包括: 确定该数据库处于服务状态。 3. The method according to claim 2, wherein the current of library information database of the current record in the database and the information database before the update metadata, the method further comprising: determining that the in-service database .
  4. 4.如权利要求2所述的方法,其特征在于,判断当前所述堆栈中是否存在数据库标识之前,所述方法还包括: 确定该数据库当前的备库信息中包含的该备库的数据库标识; 如果当前所述堆栈中不存在该备库的数据库标识,则将该备库的数据库标识添加到所述堆栈中。 4. The method according to claim 2, characterized in that, prior to determining whether there is a database that identifies the current in the stack, the method further comprises: determining a database identifying the current library prepared by the library information contained in the database ; if the current database identifies the library prepared in the absence of the stack, then the database identifier is added to the library prepared stack.
  5. 5.如权利要求2所述的方法,其特征在于,读取当前保存的所述数据库集群的元数据,具体包括: 当所述更新装置未保存所述数据库集群的元数据时,将预先保存的预置文件作为当前保存的所述数据库集群的元数据进行读取,其中,所述预置文件中记录了所述数据库集群中的至少一个数据库的数据库标识。 5. The method according to claim 2, wherein said read the metadata currently stored in the database cluster, comprises: updating means when the metadata in the database cluster is not saved when the stored beforehand preference files saved in the database as the current cluster the read metadata, wherein the pre-recorded file database identifying at least one database of the database cluster.
  6. 6.一种元数据的更新装置,其特征在于,包括: 读取模块,用于针对数据库集群,读取当前保存的所述数据库集群的元数据,确定读取的所述元数据中记录的各数据库标识; 收集模块,用于访问确定的各数据库标识对应的数据库,从各数据库中获取各数据库当前的数据库信息以及各数据库当前的备库信息,并记录在更新元数据中,将所述更新元数据重新作为所述数据库集群的元数据保存。 6. An apparatus for updating metadata, characterized by comprising: a reading module configured to cluster the database for reading the metadata currently stored in the database cluster, determining the metadata recorded in the read each database identifier; collection module configured to identify each database corresponding to the determined database access, obtain the current standby current library information database and database information of each of the databases from various databases, and recorded in the update metadata, the the re-updating the metadata as metadata storage database cluster.
  7. 7.如权利要求6所述的装置,其特征在于,所述收集模块具体包括: 堆栈单元,用于将确定的各数据库标识添加到预置的堆栈中;访问单元,用于从所述堆栈中弹出一个数据库标识,访问弹出的该数据库标识对应的数据库,获取该数据库的配置文件; 记录单元,用于根据获取到的该数据库的配置文件,确定该数据库当前的数据库信息以及该数据库当前的备库信息,并记录在更新单元中; 判断更新单元,用于判断当前所述堆栈中是否存在数据库标识,若是,则指示所述访问单元再次从所述堆栈中弹出一个数据库标识,并继续进行后续步骤,否则,将所述更新元数据重新作为所述数据库集群的元数据保存。 Access unit, from said stack; stack unit, for each of the database to determine the identity of the preset stack added: 7. The apparatus as claimed in claim 6, wherein said collection module comprises pops up a database identifier, the pop-up access to the database corresponding to the identifier of the database, acquires the profile database; a recording unit, according to the acquired profile database, the database information to determine the current of the current database and database Preparation of library information, and recorded in the update unit; updating determining means for determining whether there is a database that identifies the current in the stack, and if yes, indicating that the database access unit identifies a pop up again from the stack and continue subsequent steps, otherwise, the update metadata as the metadata re-stored in the database cluster.
  8. 8.如权利要求7所述的装置,其特征在于,所述记录单元还用于,在将该数据库当前的数据库信息以及该数据库当前的悲苦信息记录在更新元数据中之前,确定该数据库处于服务状态。 8. The apparatus according to claim 7, wherein the recording unit is further configured to, prior to the current metadata database and the information database of the current record of the database in misery update information, the database is determined service status.
  9. 9.如权利要求7所述的装置,其特征在于,所述记录单元还用于,在所述判断更新单元判断当前所述堆栈中是否存在数据库标识之前,确定该数据库当前的备库信息中包含的该备库的数据库标识,如果当前所述堆栈中不存在该备库的数据库标识,则将该备库的数据库标识添加到所述堆栈中。 9. The apparatus according to claim 7, wherein the recording unit is further configured to, prior to the identification means determines whether there is a database of the current stack is determined in the updating, the current is determined by the library information database the database contains identification library prepared, if the identifier of the current database library prepared in the absence of the stack, then the database identifier is added to the library prepared stack.
  10. 10.如权利要求7所述的装置,其特征在于,所述读取模块具体用于,当未保存所述数据库集群的元数据时,将预先保存的预置文件作为当前保存的所述数据库集群的元数据进行读取,其中,所述预置文件中记录了所述数据库集群中的至少一个数据库的数据库标识。 10. The apparatus according to claim 7, characterized in that said module is configured to read, when the metadata database cluster unsaved, previously saved preset file as currently stored in the database reading metadata cluster, wherein the pre-recorded file database identifying at least one database of the database cluster.
CN 201210484979 2012-11-23 2012-11-23 A method of updating metadata means and CN103838761B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201210484979 CN103838761B (en) 2012-11-23 2012-11-23 A method of updating metadata means and

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201210484979 CN103838761B (en) 2012-11-23 2012-11-23 A method of updating metadata means and

Publications (2)

Publication Number Publication Date
CN103838761A true true CN103838761A (en) 2014-06-04
CN103838761B CN103838761B (en) 2017-03-01

Family

ID=50802272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201210484979 CN103838761B (en) 2012-11-23 2012-11-23 A method of updating metadata means and

Country Status (1)

Country Link
CN (1) CN103838761B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6366917B1 (en) * 1998-04-01 2002-04-02 Webputty, Inc. Method of modifying a populated database structure by modifying metadata describing the database structure
CN101008957A (en) * 2006-01-24 2007-08-01 国际商业机器公司 Method and system for building a database from backup data images
CN101271458A (en) * 2007-03-22 2008-09-24 阿里巴巴公司 Distributed computation file management method, system and device thereof
US7610317B2 (en) * 2005-02-22 2009-10-27 Microsoft Corporation Synchronization with derived metadata
US20100145949A1 (en) * 2004-06-25 2010-06-10 Yan Arrouye Methods and systems for managing data
CN101854400A (en) * 2010-06-09 2010-10-06 中兴通讯股份有限公司 Database synchronization deployment and monitoring method and device
CN102200977A (en) * 2010-03-23 2011-09-28 国际商业机器公司 Method and system for extending database table under multi-tenant environment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6366917B1 (en) * 1998-04-01 2002-04-02 Webputty, Inc. Method of modifying a populated database structure by modifying metadata describing the database structure
US20100145949A1 (en) * 2004-06-25 2010-06-10 Yan Arrouye Methods and systems for managing data
US7610317B2 (en) * 2005-02-22 2009-10-27 Microsoft Corporation Synchronization with derived metadata
CN101008957A (en) * 2006-01-24 2007-08-01 国际商业机器公司 Method and system for building a database from backup data images
CN101271458A (en) * 2007-03-22 2008-09-24 阿里巴巴公司 Distributed computation file management method, system and device thereof
CN102200977A (en) * 2010-03-23 2011-09-28 国际商业机器公司 Method and system for extending database table under multi-tenant environment
CN101854400A (en) * 2010-06-09 2010-10-06 中兴通讯股份有限公司 Database synchronization deployment and monitoring method and device

Also Published As

Publication number Publication date Type
CN103838761B (en) 2017-03-01 grant

Similar Documents

Publication Publication Date Title
US20120304179A1 (en) Workload-to-cloud migration analysis based on cloud aspects
US20150020059A1 (en) Migration services for systems
US20100250730A1 (en) Automated license reconciliation for deployed applications
US20150052108A1 (en) Method, computer readable storage medium and computer system for obtaining snapshots of data
US20090049438A1 (en) Method for Optimizing Migration of Software Applications to Address Needs
US20120079471A1 (en) Systems and methods for automatic upgrade and downgrade in package update operations
US20090006493A1 (en) Method For Enabling Traceability And Recovery From Errors During Migration Of Software Applications
US20150286495A1 (en) Metadata-driven workflows and integration with genomic data processing systems and techniques
US20130275369A1 (en) Data record collapse and split functionality
US20140358977A1 (en) Management of Intermediate Data Spills during the Shuffle Phase of a Map-Reduce Job
US20140297592A1 (en) Computer-readable medium storing program and version control method
US8260742B2 (en) Data synchronization and consistency across distributed repositories
US20150019487A1 (en) Online database migration
US20120089625A1 (en) Incremental conversion of database objects during upgrade of an original system
US20130047161A1 (en) Selecting processing techniques for a data flow task
US20130073515A1 (en) Column based data transfer in extract transform and load (etl) systems
US20120151443A1 (en) Globally sound and consistent configuration management for distributed datacenter components
US20130151492A1 (en) Information processing system
US20110270861A1 (en) Graph query adaptation
US9521052B1 (en) Methods, systems, and computer readable mediums for utilizing application programming interfaces for accessing key performance indicator information
US20150379072A1 (en) Input processing for machine learning
US20150379425A1 (en) Consistent filtering of machine learning data
US20110055151A1 (en) Processing Database Operation Requests
US20120185843A1 (en) Reconfiguration of computer system to allow application installation
US8577870B2 (en) Statistics management for database querying

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
GR01