This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2010-129441, filed on Jun. 4, 2010, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are directed to a schema definition generating device and a schema definition generating method.
An information management system recently known for information management in the case of linkage of a plurality of business systems or in an environment of multi-vendor operations management includes an FCMDB (federated configuration management database) that virtually integrates information of different systems.
As exemplified in
Accordingly, a schema definition responsive to an object of an information management system is manually generated. More specifically, in order to generate a schema definition, an item to be managed by an FCMDB is set as a CI or a Relationship, information required for integration is selected. An administrator thereafter manually generates a schema definition of the FCMDB.
Patent Document: Japanese National Publication of International Application No. 2001-518670
In the aforementioned way of manually generating a schema definition, a process should be repeated for a plurality of systems, and required information should be selected manually. Thus, a large number of man-hours are required for generating a schema definition, and accordingly, a schema definition cannot be generated promptly.
According to an aspect of an embodiment of the invention, a schema definition generating device includes an item comparison generating unit that compares configuration item information and table information, and generates correspondence information indicating a correspondence between the configuration item information and the table information, the configuration item information being contained in a query formula used to search for configuration item information indicating a configuration item targeted for management, the table information being contained in history information of queries made to a relational database; a relationship comparison generating unit that compares relational information and information indicating a relationship between tables contained in the query history information, and generates correspondence information indicating a correspondence between the relational information and the query history information, the relational information indicating a relationship between configuration items contained in the query formula; and a schema definition generating unit that generates a schema definition of the configuration item information and a schema definition of the relational information by using the correspondence information generated by the item comparison generating unit, and the correspondence information generated by the relationship comparison generating unit.
The object and advantages of the embodiment will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the embodiment, as claimed.
Preferred embodiments of the present invention will be explained with reference to accompanying drawings. The invention is not to be limited by the embodiment(s).
The structure of a schema generating device according to a first embodiment is described first by using
A schema generating device 1 according to the first embodiment includes an item comparison generating unit 2, a relationship comparison generating unit 3, and a schema generating unit 4, which are connected to a relational database 5 (represented as “RDB” in
The item comparison generating unit 2 compares configuration item information contained in a query formula used to search for configuration item information indicating a configuration item targeted for management, and table information contained in history information of queries made to the relational database 5. Then, the item comparison generating unit 2 generates correspondence information indicating a correspondence between the configuration item information and the table information.
The relationship comparison generating unit 3 compares relational information indicating a relationship between configuration items contained in the query formula, and information indicating a relationship between tables contained in the query history information. Then, the relationship comparison generating unit 3 generates correspondence information indicating a correspondence between the relational information and the query history information.
The schema generating unit 4 generates a schema definition of the configuration item information and a schema definition of the relational information by using the correspondence information generated by the item comparison generating unit 2, and the correspondence information generated by the relationship comparison generating unit 3.
As described above, in the schema generating device 1 of the first embodiment, a schema definition can be generated automatically by using existing information such as a query formula and query history information. As a result, the number of man-hours required for generating a schema can be reduced.
The structure of a schema generating device according to a second embodiment, and a flow of processes performed by the schema generating device according to the second embodiment will be described in this order. An effect achieved by the second embodiment will be described thereafter.
Structure of Schema Generating Device
The structure of a schema generating device 10 will be described first by using
The schema generating device 10 accepts a query formula (such as that illustrated in
A query formula extended for FCMDBs specifies the type of a CI or a Relationship the information of which is requested. As an example, a search query to search for information about a server, namely information about a CI with a CI type “Server” is expressed as “%Server”. Putting “%” before a name indicates that this name is a CI name.
Placing a CI and a Relationship alternately enables trace by following a relationship between CIs. As an example, a query formula to search for information about an administrator of a server is expressed as “%Server==>%User”, where “==>” means a Relationship.
Putting “*” after “%” enables search by specifying all CI types. As an example, a query formula expressed as “%Server==>%*” indicates that information about a CI having any relationship with the CI type “Server” is requested.
Inserting information for specifically designating a requested CI after a CI type enables detail search of the CI. As an example, a query formula to search for information about a server named A is expressed as “%Server[@name==‘A’]”.
The management DB 11 stores data necessary for various processes. The management DB 11 also stores a CI name list 11a, a table name list 11b, a CI candidate list 11c, and a Relationship candidate list 11d.
The CI name list 11a includes a CI name contained in a query formula. More specifically, as illustrated in
The table name list 11b includes a table name contained in an SQL log. More specifically, as illustrated in
The CI candidate list 11c includes a CI name as a CI candidate that coincides with a table name stored in the table name list 11b. The CI name stored in the CI candidate list 11c is one of those stored in the CI name list 11a. More specifically, as illustrated in
The Relationship candidate list 11d includes a set of table names in the CI candidate list 11c that correspond to CIs placed before and after a Relationship name in a query formula. More specifically, as illustrated in
A relationship in the SQL between table names in a set will be described next by using the exemplary SQL log illustrated in
Referring to the SQL log illustrated in
The query formula analyzing unit 12 analyzes a query formula described in the extended Xpath (XML path language) to create the CI name list 11a. More specifically, when accepting a query formula such as that illustrated in
The SQL log collecting unit 13 collects an SQL log from the RDB 20. More specifically, the SQL log collecting unit 13 collects an SQL log from the RDB 20, creates the table name list 11b, and stores the created table name list 11b into the management DB 11. As an example, if collecting the SQL log exemplified in
The item analyzing unit 14 compares CI information contained in a query formula to search for a CI, and table information contained in an SQL log into the relational database 20. Then, the item analyzing unit 14 creates the CI candidate list 11c indicating a correspondence between the configuration item information and the table information. More specifically, the item analyzing unit 14 retrieves one CI name from the CI name list 11a, and acquires one table name from the table name list 11b.
Then, the item analyzing unit 14 compares the CI name and the table name by using a group of comparison functions (including complete comparison and partial comparison) to determine if the CI name and the table name coincide with each other. If the CI name and the table name coincide, the item analyzing unit 14 generates a correspondence, and enters the correspondence into the CI candidate list 11c.
A process of generating a correspondence between a CI and a table will be described next by using
The item analyzing unit 14 acquires one CI from the CI name list 11a after making comparison of all table names. If the CI candidate list 11c includes a plurality of CI names that correspond to the acquired CI, the item analyzing unit 14 may create a dictionary in which a correspondence between the same CI names is stored.
A process of creating a dictionary across tables in different schemas is explained by using
The relationship analyzing unit 15 compares a Relationship contained in a query formula, and a specific SQL sentence indicating a relationship between tables contained in an SQL log. Then, the relationship analyzing unit 15 creates the Relationship candidate list 11d indicating a correspondence between the Relationship and the SQL. More specifically, the relationship analyzing unit 15 retrieves one Relationship from a query formula, and retrieves table names corresponding to CIs placed before and after the Relationship from the CI candidate list 11c.
Then, the relationship analyzing unit 15 lists a relationship in the SQL log, and enters the presence or absence, and the type of a relationship thereof with a corresponding Relationship into the Relationship candidate list 11d. A process of creating a correspondence between a Relationship and an SQL sentence will be described by using
As exemplified in
The acquired sentence contains “FOREIGN KEY” indicating key constraint. Accordingly, the relationship analyzing unit 15 enters the type of a relationship “key constraint” into the Relationship candidate list 11d.
The schema generating unit 16 generates a schema definition of a CI and a schema definition of a Relationship by using the CI candidate list 11c and the Relationship candidate list 11d. More specifically, the schema generating unit 16 retrieves one from the CI name list 11a, and retrieves a table name from the CI candidate list 11c and the table name list 11b.
Next, the schema generating unit 16 searches an SQL log to acquire an attribute name contained therein, and then generates a CI definition based on the table name and the acquired attribute name. After generating CI definitions of all CIs, the schema generating unit 16 retrieves one from the Relationship candidate list 11d, and generates a Relationship definition by referring to the CI candidate list 11c.
The schema generating unit 16 thereafter repeats the process of generating a Relationship definition until Relationship definitions are generated for all Relationship candidates. As exemplified in
In the example illustrated in
It is assumed, for example, that the schema generating unit 16 generates a CI definition of a CI type “Service” in “TABLE Service” in the SQL log illustrated in
As another example, as a Relationship definition of Relationship type “CPU”, the schema generating unit 16 defines “src” as an attribute name indicating a CI as a source of connection, and “dst” as an attribute name indicating a CI as a target of connection.
As described above, a schema definition can be generated automatically by using information that can be prepared easily such as a query formula, an SQL log, and the like. As a result, the number of man-hours required for generating a schema definition can be reduced, so that a schema definition can be generated promptly.
Process by Schema Generating Device
Processes by the schema generating device 10 according to the second embodiment will next be explained by using
As illustrated in
Next, the schema generating device 10 determines if all CIs have been processed (step S104). If all CIs have not been processed (No in step S104), the schema generating device 10 returns to step S102 to repeat the process.
If all CIs have been processed (Yes in step S104), the schema generating device 10 searches the query formula from the beginning to retrieve one Relationship (step S105), and performs the Relationship matching process (step S106) (described in detail later by using
The schema generating device 10 thereafter determines if all Relationships have been processed (step S107). If all Relationships have not been processed (No in step S107), the schema generating device 10 returns to step S105 to repeat the process. If all Relationships have been processed (Yes in step S107), the schema generating device 10 performs the schema generating process (step S108) (described in detail later by using
The CI matching process will be described by using
The item analyzing unit 14 thereafter determines if all table names have been subjected to the comparison (step S205). If all table names have not been subjected to the comparison (No in step S205), the item analyzing unit 14 returns to step S201 to repeat the process. If all table names have been subjected to the comparison (Yes in step S205), the item analyzing unit 14 acquires one CI from the CI name list 11a (step S206), and determines if the CI candidate list 11c includes a plurality of CI names that correspond to the acquired CI (step S207).
If the CI candidate list 11c includes a plurality of CI names corresponding to the acquired CI (Yes in step S207), the item analyzing unit 14 creates a dictionary in which a plurality of CI names are correlated (step S208). Next, the item analyzing unit 14 determines if all CIs have been processed (step S209). If all CIs have not been processed (No in step S209), the item analyzing unit 14 returns to step S206 to repeat the process. If all CIs have been processed (Yes in step S209), the item analyzing unit 14 finishes the CI matching process.
The Relationship matching process will now be described by using
As illustrated in
The schema generating process will be described next by using
Next, the schema generating unit 16 searches the SQL log to acquire an attribute name contained therein (step S403), and then generates a CI definition based on the table name and the acquired attribute name (step S404). The schema generating unit 16 thereafter determines if all CIs have been processed (step S405). If all CIs have not been processed (No in step S405), the schema generating unit 16 returns to step S401 to repeat the process.
If all CIs have been processed (Yes in step S405), the schema generating unit 16 retrieves one from the Relationship candidate list 11d (step S406), and generates a Relationship definition by referring to the CI candidate list 11c (step S407).
The schema generating unit 16 thereafter determines if Relationship definitions of all relationship candidates have been generated (step S408). If Relationship definitions of all Relationship candidates have not been generated (No in step S408), the schema generating unit 16 returns to step S406. If Relationship definitions of all Relationship candidates have been generated (Yes in step S408), the schema generating unit 16 finishes the schema generating process.
Effect of Second Embodiment
As described above, the schema generating device 10 compares CI information contained in a query formula to search for a CI, and table information contained in an SQL log into the relational database 20. Then, the schema generating device 10 creates the CI candidate list 11c indicating a correspondence between the configuration item information and the table information. The schema generating device 10 also compares a Relationship contained in the query formula, and a specific SQL sentence indicating a relationship between tables contained in the SQL log. Then, the schema generating device 10 creates the Relationship candidate list 11d indicating a correspondence between the Relationship and the SQL. The schema generating device 10 thereafter generates a schema definition of a CI and a schema definition of a Relationship by using the CI candidate list 11c and the Relationship candidate list 11d. Thus, a schema definition can be generated automatically. As a result, the number of man-hours required for generating a schema definition can be reduced, so that a schema definition can be generated promptly.
In the second embodiment, the name of CI information contained in a query formula and the name of table information contained in an SQL log are compared. Then, the name of the configuration item information and the name of the table information are defined in a set as the aforementioned correspondence information if the name of the configuration item information and the name of the table information coincide with each other. Thus, a schema definition can be generated automatically by using information that can be prepared easily such as a query formula and an SQL log. As a result, the number of man-hours required for generating a schema definition can be reduced, so that a schema definition can be generated promptly.
In the second embodiment described above, the schema generating process is performed after the CI matching process and the Relationship matching process are performed, to which the invention is not limited. By way of example, a CI merge process for assuming a target of reconciliation, and a verification process for determining if a CI and a Relationship can be followed according to a query formula, may be performed after the CI matching process and the relationship matching process are performed.
In a third embodiment, a CI merge process and a verification process are performed after the CI matching process and the Relationship matching process are performed. The structure and processes of a schema generating device 10A of the third embodiment will be described below.
The structure of the schema generating device 10A will first be described by using
The unallocated table list 11e includes a table name that is not related to any CIs. More specifically, as illustrated in
The reconciliation candidate list 11f includes a candidate for a target with which a table not related to any CIs is to be reconciled. More specifically, as illustrated in
The CI/Relationship list 11g includes a CI and a Relationship. More specifically, as illustrated in
The unallocated CI list 11h includes a CI that caused failure in verification. More specifically, as illustrated in
The subordinate item assuming unit 17 analyzes an SQL sentence associated with a remaining table that is left without having been related to any CIs, and assumes a CI with which the remaining table is to be reconciled. More specifically, the subordinate item assuming unit 17 searches a specific SQL sentence containing a remaining table left without having being related to any CIs to acquire a table name contained in the SQL sentence, and then lists a target of reconciliation. The specific SQL sentence mentioned here means a subquery, joining, key constraint, and others.
By using the example illustrated in
As a result of the search, the subordinate item assuming unit 17 acquires an SQL sentence “Select*FROM Service WHERE user_id=(SELECT id FROM User WHERE name=“Suzuki”);” from an SQL log. The acquired SQL sentence “Select*FROM Service WHERE user_id=(SELECT id FROM User WHERE name=“Suzuki”);” is a subquery containing the table name “User”.
Then, the subordinate item assuming unit 17 assumes that a different table name “Service” is a target of reconciliation that is contained in the SQL sentence “Select*FROM Service WHERE user_id=(SELECT id FROM User WHERE name=“Suzuki”);”. The subordinate item assuming unit 17 thereafter enters the remaining table that is left without having been related to any CIs, and the table assumed as a target of reconciliation into the reconciliation candidate list 11f, in a manner that the remaining table and the table assumed as a target of reconciliation are related to each other.
The verifying unit 18 determines if a CI and a Relationship can be followed according to a query formula. More specifically, the verifying unit 18 divides a query formula to create the CI/Relationship list 11g. Then, as illustrated in
In the example illustrated in
Verification may end in failure. A description will be given of this case. As an example, the verifying unit 18 cannot follow a CI and a Relationship according to a query formula if determining as a result of verification that there is a plurality of corresponding Relationships, or if a CI to be followed is related to a plurality of tables.
In the example illustrated in
If verification ends in failure, the verifying unit 18 enters a CI having caused failure in trace and a table corresponding to the CI into the unallocated CI list 11h. The verifying unit 18 also generates a conditional pattern according to which the number of associations between the CI having caused the failure in trace and the table is reduced, and enters the generated conditional pattern into the pattern list 11i. The verifying unit 18 repeats the verification process by adapting conditional patterns in turn until verification is performed successfully.
In the example illustrated in
The verifying unit 18 thereafter acquires table names “PhysicalServer”, “Server”, and “Server” related to the CI “Server” having caused the failure in trace from a CI candidate list. Then, the verifying unit 18 enters a pattern according to which a correspondence between a CI and a table is partially made invalid into the pattern list 11i. The verifying unit 18 retrieves patterns one by one, and repeats the verification process by adapting the retrieved patterns in turn until verification is performed successfully.
Like in the second embodiment, the schema generating unit 16 generates a schema definition of a CI and a schema definition of a Relationship. In the schema generating device 10A according to the third embodiment, the subordinate item assuming unit 17 assumes a CI with which a remaining table that is left without having been related to any CIs is to be reconciled. Thus, in the schema generating device 10A according to the third embodiment, information about a table that is left without having been related to any CIs is merged. Accordingly, compared to the schemas exemplified in
The operation of the schema generating device according to the third embodiment in its entire process will be described next by using
To be more specific, like in the second embodiment, the schema generating device 10A performs a matching process of all CIs (from step S501 to step S504), and performs a matching process of all Relationships (from step S505 to step S507) as illustrated in
The schema generating device 10A determines as a result of the verification if a definition satisfies a query formula (step S510). If the definition satisfies the query formula (Yes in step S510), the schema generating device 10A performs a schema generating process like in the second embodiment (step S511), and outputs a generated schema definition as a result (step S514).
If the definition does not satisfy the query formula as a result of the verification (No in step S510), the schema generating device 10A determines if a pattern can be changed (step S512). More specifically, the schema generating device 10A determines that a pattern cannot be changed if a pattern has already been changed and all patterns have been processed, or if an ending flag is set.
If a pattern can be changed (Yes in step S512), the schema generating device 10A performs the pattern changing process (step S513) (described in detail later by using
The CI merge process will be described next by using
Next, the schema generating device 10A determines if a table name exists in the specific SQL sentence containing the table name in the unallocated table list 11e (step S603). If there is a table name coinciding with that in a template (Yes in step S603), the schema generating device 10A enters this table name into the reconciliation candidate list 11f (step S604). If there is no table name coinciding with that in the template (No in step S603), the schema generating device 10A does not make entry into the reconciliation candidate list 11f, and proceeds to step S605.
The schema generating device 10A thereafter determines if all table names in the unallocated table list 11e have been processed (step S605). If all table names have not been processed (No in step S605), the schema generating device 10A returns to step S602 to repeat the process. If all table names in the unallocated table list 11e have been processed (Yes in step S605), the schema generating device 10A finishes the CI merge process.
The verification process will be described next by using
Next, the schema generating device 10A determines if there is a remainder in the CI/Relationship list 11g (step S702). If there is a remainder in the CI/Relationship list 11g (Yes in step S702), the schema generating device 10A retrieves one from the CI/Relationship list 11g (step S703). Then, the schema generating device 10A determines if what was retrieved is a CI (step S704). If what was retrieved is a CI (Yes in step S704), the schema generating device 10A retrieves a corresponding one from the CI candidate list 11c (step S705).
The schema generating device 10A thereafter determines if there is an additional corresponding one in the CI candidate list 11c (step S706). If there is an additional corresponding one (Yes in step S706), the schema generating device 10A determines if the same schema as that assigned to a CI immediately before is assigned to the CI/Relationship list 11g (step S707).
If the same schema as that assigned to a CI immediately before is assigned to the CI/Relationship list 11g (Yes in step S707), the schema generating device 10A determines if there is a schema in which a plurality of tables are allocated to the retrieved CI or Relationship (step S708).
If there is a schema in which a plurality of tables are allocated to the retrieved CI or Relationship (Yes in step S708), the schema generating device 10A outputs the IDs of the retrieved CI or Relationship and the IDs of these tables (step S709), and then finishes the verification process. If there is no schema in which a plurality of tables are allocated to the retrieved CI or Relationship (No in step S708), the schema generating device 10A returns to step S702.
If it is determined in step S706 that there is no additional corresponding one in the CI candidate list 11c (No in step S706), the schema generating device 10A sets an ending flag (step S714), and then finishes the verification process. If it is determined in step S707 that the same schema as that assigned to a CI immediately before is not assigned to the CI/Relationship list 11g (No in step S707), the schema generating device 10A sets an ending flag (step S714), and then finishes the verification process.
Turning back to step S704, if what was retrieved is not a CI (No in step S704), the schema generating device 10A retrieves corresponding ones from the CI candidate list 11c and the Relationship candidate list 11d by using a CI immediately before as a key (step S710). Next, the schema generating device 10A determines if there is a corresponding one in the Relationship candidate list 11d (step S711). If there is no corresponding one in the Relationship candidate list 11d (No in step S711), the schema generating device 10A sets an ending flag (step S714), and then finishes the verification process.
If there is a corresponding one in the Relationship candidate list 11d (Yes in step S711), the schema generating device 10A determines if the table name of the other of the corresponding ones include a plurality of table names (step S712). If the table name does not include a plurality of table names (No in step S712), the schema generating device 10A returns to step S702.
If the table name has a plurality of table names (Yes in step S712), the schema generating device 10A outputs the ID of the retrieved CI or Relationship in the CI/Relationship list 11g (step S713).
Turning back to step S702, if it is determined that there is no remainder in the CI/Relationship list 11g (No in step S702), the schema generating device 10A determines that the verification ends in success (step S715), and finishes the verification accordingly.
The pattern changing process will be described next by using
If there is no pattern list (No in step S801), the schema generating device 10A determines if the output as a result of the verification is a CI (step S802). If the output as a result of the verification is a CI (Yes in step S802), the schema generating device 10A extracts an item from the CI candidate list 11c containing both a table ID output during the verification, and a CI name except for that listed in the CI/Relationship list 11g, and creates the unallocated CI list 11h (step S803).
If the output as a result of the verification is not a CI but a Relationship (No in step S802), the schema generating device 10A acquires a CI name next to the ID of the Relationship in the CI/Relationship list 11g (step S804).
Next, the schema generating device 10A extracts a record containing the acquired CI from the CI candidate list 11c to create an unallocation list (step S805). The schema generating device 10A thereafter makes all combinations of every item in the unallocation list (step S806), sorts the combinations except an empty set in order of increasing number of items, and outputs a result as the pattern list 11i (step S807). Next, the schema generating device 10A sees a next pattern in the pattern list 11i, and makes a corresponding definition invalid (step S808).
As described above, if tables contained in an SQL include an unallocated table not related to any CIs, the schema generating device 10A according to the third embodiment analyzes an SQL associated with the unallocated table, and assumes a CI with which the unallocated table is to be reconciled. This means that an SQL sentence associated with a remaining table left without having been related to any CIs is also used to generate a schema definition.
Further, the schema generating device 10A according to the third embodiment determines if a query formula can be traced by using the CI candidate list 11c and the Relationship candidate list 11d created. Thus, a schema definition of a higher degree of accuracy can be generated.
Other embodiments of the invention may be implemented in addition to the embodiments of the invention described above. A fourth embodiment as one of other embodiments of the invention will be described below.
(1) System Structure and Others
The constituting units in the devices illustrated in the drawings are functionally conceptual parts, and the physical structures thereof are not necessarily limited to those illustrated in the drawings. More specifically, the details of distribution and integration of the devices are not limited to those illustrated in the drawings. Part of or all of the devices may functionally and physically be distributed or integrated in any units according to various burdens, conditions of use and the like. As an example, the item analyzing unit 14 and the relationship analyzing unit 15 may be integrated.
(2) Program
The foregoing processes described in the embodiments can be realized by causing a computer to execute a previously prepared program. In the below, an example of a computer that executes a program having the same functions as those in the aforementioned embodiments will be described by using
As illustrated in
Schema generating programs having the same functions as those of the aforementioned embodiments, more specifically a query formula analyzing program 631, an SQL log collecting program 632, an item analyzing program 633, a relationship analyzing program 634, and a schema generating program 635 are stored in advance in the ROM 630 as illustrated in
The CPU 640 reads the programs 631 to 635 from the ROM 630 and executes the read programs, by which the programs 631 to 635 become operative to realize a query formula analyzing process 641, an SQL log collecting process 642, an item analyzing process 643, a relationship analyzing process 644, and a schema generating process 645, respectively.
As illustrated in
A schema definition is generated automatically. Thus, the number of man-hours required for generating a schema definition is reduced, so that a schema definition can be generated promptly.
All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention
Number | Date | Country | Kind |
---|---|---|---|
2010-129441 | Jun 2010 | JP | national |