1. Technical Field
The present invention relates to a method and system for transferring of one or more instances of a table from a source database to corresponding destination databases.
2. Related Art
Current methods in the related art for transferring an instance of a table from a source database to a destination database are inefficient. Thus, there is a need for a method of transferring an instance of a table from a source database to a destination database, wherein said method is more efficient than currently exists in the related art.
The present invention provides a method for transferring table instances X1, X2, . . . , XN of a table T from a source database S to destination databases D1, D2, . . . , DN, respectively, said method being implemented by executing a computer code by a processor of a computer system, said N being at least 1, said method comprising for I=1, 2, . . . , N:
determining whether the table T has been defined for destination database DI, and if said determining determines that the table T has not been defined for the destination database DI then defining the table T for the destination database DI; and
transferring the instance XI of the N table instances from the source database S into the defined table T of the destination database DI.
The present invention provides a computer system comprising a processor and a computer readable memory unit coupled to the processor, said memory unit containing computer code that when executed by the processor implement a method for transferring table instances X1, X2, . . . , XN of a table T from a source database S to destination databases D1, D2, . . . , DN, respectively, said N being at least 1, said method comprising for I=1, 2, . . . , N:
determining whether the table T has been defined for destination database DI, and if said determining determines that the table T has not been defined for the destination database DI then defining the table T for the destination database DI; and
transferring the instance XI of the N table instances from the source database S into the defined table T of the destination database DI.
The present invention provides a computer program product, comprising a computer usable medium having a computer readable program code embodied therein, said computer readable program code comprising an algorithm adapted to implement a method for transferring table instances X1, X2, . . . , XN of a table T from a source database S to destination databases D1, D2, . . . , DN, respectively, said N being at least 1, said method comprising:
determining whether the table T has been defined for destination database DI, and if said determining determines that the table T has not been defined for the destination database DI then defining the table T for the destination database DI; and
transferring the instance XI of the N table instances from the source database S into the defined table T of the destination database DI.
The present invention provides a method for deploying computing infrastructure, comprising integrating computer-readable code into a computing system, wherein the code in combination with the computing system is capable of performing a process for transferring table instances X1, X2, . . . , XN of a table T from a source database S to destination databases D1, D2, . . . , DN, respectively, said process being implemented by executing a computer code by a processor of a computer system, said N being at least 1, said process comprising for I=1, 2, . . . , N:
determining whether the table T has been defined for destination database DI, and if said determining determines that the table T has not been defined for the destination database DI then defining the table T for the destination database DI; and
transferring the instance XI of the N table instances from the source database S into the defined table T of the destination database DI.
The present invention advantageously provides a method of transferring an instance of a table from a source database to a destination database, wherein said method is more efficient than currently exists in the related art.
The present invention is directed to transferring N instances of a table T in a source database S to the same table (i.e., having the same name and schema) in N corresponding destination databases on a one-to one basis, as described in the database configuration of
Step 12 builds a database query statement from the one or more instance configurations of step 11 for selecting or extracting the table instance of the table T from the source database S. A “database query statement” is any statement framed in a database query language for interacting with a database such as by reading data from the database, writing data into the database, etc. Thus, the database query statement may be, inter alia, a Structured Query Language (SQL) statement, such as: SELECT * FROM T WHERE Division=“25” for the instance configuration specified in step 11. The preceding SQL statement will return the table instance X1 shown in
Step 13 transfers the table instance to the same table T in the destination database D1. If the table T in the destination database D1 was empty (i.e., not having any rows) or undefined prior to step 13, then the table T in the destination database DI is as shown in
Step 14 determines whether there are any more instances of the table T to be processed. If step 14 determines that there are no more instances of the table T to be processed, then the method of
Step 22 determines whether the results of step 21 are available (i.e., whether step 21 has returned a result from performance of the database query statement in step 21), which is indicative of whether the table T is defined in the source database S. If the results from step 21 are not available, then the table T may not have been defined in the source database S and the method accordingly stops executing after performing error diagnosis in step 23. If the results from step 21 are available, then step 24 is next executed.
In order to transfer a table instance from the source database S to the destination database, the table schema and associated metadata must exist in the destination database. The table schema define the structural organization of the table and include column names, column widths, and column data types. The data values of schema are called “metadata”. Accordingly, step 24 builds (i.e., generates) a database query statement for determining whether the table T exists in the destination database, which is equivalent to determining whether the table schema and associated metadata for table T exist in the destination database. An example of such a database query statement in SQL for the example of
Step 25 performs the query resulting from the database query statement built in step 24. Based on whether any table data is returned from the performance of step 25, step 26 determines whether the table schema and associated metadata for table T exist in the destination database.
If table data is returned from the performance of step 25, then step 26 determines that table schema and associated metadata for table T exist in the destination database and step 27 accordingly loads the destination database with the table instance from table T such as by executing the SQL pseudocode in Table 1 for the example of
If table data is not returned from the performance of step 25, then step 26 determines that table schema and associated metadata for table T does not exist in the destination database and steps 28-31 generate table schema and associated metadata for table T in the destination database.
Step 28 builds a database query statement to obtain the metadata needed to define the table T. Step 29 performs the database query statement performed in step 28. Step 30 determines whether the queried metadata in step 29 has been returned following performance of step 29.
If step 30 determines that the queried metadata in step 29 has not been returned following performance of step 29, then an error diagnosis is performed in step 23. If step 30 determines that the queried metadata in step 29 has been returned (see, e.g., the exemplary returned metadata shown
Step 31 creates the table schema and associated metadata for table T such by using the returned metadata to build a database query statement that creates the table schema and associated metadata for table T. Table 2 illustrates such a SQL statement using the metadata shown in
After step 31 is executed, step 27 is executed to load the destination database with the table instance from table T as described supra.
The flow chart of
Step 41 sets a table instance counter 1 to 1 for identifying the table instance XI of a table T and the corresponding destination database DI so that the instance XI may be transferred from a source database S to the destination database DI. By iteratively looping through steps 42-45, the method of
Step 42 determines whether the table T is defined in the destination database DI. If step 42 determines that the table T is defined in the destination database DI then step 44 is next executed.
If step 42 determines that the table T is not defined in the destination database DI then step 43 is performed to define the table T in the destination database DI, followed by execution of step 44. Defining the table T may comprise providing metadata sufficient for defining the table T; and executing a database table-defining query statement that defines the table T, wherein the database table-defining query statement utilizes the metadata (see, e.g, Table 2 discussed supra). Providing metadata may comprise executing a metadata database query statement on the source database S, wherein executing the metadata database query statement on the source database S includes results in returning the metadata from the source database S.
Given the table T being defined in the destination database DI, step 44 transfers the instance XI from the source database S into the defined table T of the database DI. The instance transfer of step 44 may comprise: selecting the instance XI from the source database S; and inserting the selected instance XI into the defined table T of the database DI. As discussed supra, in one embodiment selecting the instance XI from the source database S may be implemented by a database query statement that returns both the instance XI and the metadata.
Note that a single database query statement may be employed to determine whether the table T is defined in the destination database DI (step 42) and selecting the instance XI from the source database S (step 44). For the example of
Alternatively for implementation of step 44, the instance X1 from the source database S may be transferred (e.g., pushed or pulled) directly from the source database S to the destination database DI.
Step 45 determines whether I is equal to N. If step 45 determines that I is equal to N then the process ends. If step 45 determines that I is not equal to N then I is incremented by 1 in step 46 and the process loops back to step 42 to execute steps 42-46 for transferring the next table instance to its corresponding database.
Some or all of the table instances to be transferred to the corresponding destination databases may be equal or unequal to each other. For example if N is at least 2 then X1 may be equal to X2, or X1 may be unequal to X2.
Thus the present invention discloses a process for deploying or integrating computing infrastructure, comprising integrating computer-readable code into the computer system 90, wherein the code in combination with the computer system 90 is capable of performing a method for transferring of one or more instances of the table T from the source database S to corresponding destination databases D1, D2, . . . , DN.
While
While embodiments of the present invention have been described herein for purposes of illustration, many modifications and changes will become apparent to those skilled in the art. Accordingly, the appended claims are intended to encompass all such modifications and changes as fall within the true spirit and scope of this invention.
Number | Name | Date | Kind |
---|---|---|---|
5617565 | Augenbraun et al. | Apr 1997 | A |
5966135 | Roy et al. | Oct 1999 | A |
6266673 | Hong et al. | Jul 2001 | B1 |
6356901 | MacLeod et al. | Mar 2002 | B1 |
6496850 | Bowman-Amuah | Dec 2002 | B1 |
6542899 | Saulpaugh et al. | Apr 2003 | B1 |
6640244 | Bowman-Amuah | Oct 2003 | B1 |
6895417 | Obara et al. | May 2005 | B2 |
20020052893 | Grobler et al. | May 2002 | A1 |
20020072049 | Prahalad | Jun 2002 | A1 |
20020122063 | Weinberg et al. | Sep 2002 | A1 |
20020147725 | Janssen et al. | Oct 2002 | A1 |
20020161784 | Tarenskeen | Oct 2002 | A1 |
20030126152 | Rajak | Jul 2003 | A1 |
20040034669 | Smith et al. | Feb 2004 | A1 |
20040267744 | Becker et al. | Dec 2004 | A1 |
20050055351 | Barton et al. | Mar 2005 | A1 |
20050055382 | Ferrat et al. | Mar 2005 | A1 |
20050193024 | Beyer et al. | Sep 2005 | A1 |
20050198074 | Khayter et al. | Sep 2005 | A1 |
Number | Date | Country |
---|---|---|
WO 9746954 | Dec 1997 | WO |
Number | Date | Country | |
---|---|---|---|
20060173809 A1 | Aug 2006 | US |