Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
SYSTEM AND METHOD FOR HETEROGENEOUS DATABASE REPLICATION FROM A REMOTE SERVER
Document Type and Number:
WIPO Patent Application WO/2019/210220
Kind Code:
A1
Abstract:
In accordance with an embodiment, described herein is a system and method for heterogeneous database replication from a remote server, for example a remote database server. A capture process can be registered as a replication slave to the remote server, and configured to receive transaction event data from that server. Transaction log events associated with a modification to the database at the remote server can be processed, and output as change data, in a canonical format output, for use with one or more heterogeneous targets, for example a target database server or message queue. The process enables capture of transaction log events associated with database transactions at a remote server that may be located on a different computer or network, or within an access-restricted environment such as a cloud environment, without the need to create additional copies of its transaction logs.

Inventors:
KUMAR ASHISH (US)
DUBEY AVINASH (US)
SACHDEV VINAY (US)
CORBIN SCOTT (US)
Application Number:
PCT/US2019/029423
Publication Date:
October 31, 2019
Filing Date:
April 26, 2019
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
ORACLE INT CORP (US)
International Classes:
G06F16/25
Foreign References:
US20120030172A12012-02-02
US20180081924A12018-03-22
US20080027987A12008-01-31
Other References:
GAVIN SOORMA: "GoldenGate Tutorial 1 Concepts and Architecture", INTERNET CITATION, 18 February 2010 (2010-02-18), pages 1 - 4, XP002691436, Retrieved from the Internet [retrieved on 20130131]
Attorney, Agent or Firm:
KENNA, Karl, F. et al. (US)
Download PDF:
Claims:
Claims:

What is claimed is:

1. A system for heterogeneous database replication from a remote server, comprising:

a computer including a processor, and change data system operating thereon that enables replicating of data between database servers;

wherein a capture process is registered to a remote server, and configured to receive transaction log events that are indicative of database transactions to modify data at a database associated with the remote server,

wherein the transaction log events are processed and output as change data, in a canonical format output for use with one or more target database server or other systems.

2. The system of claim 1 ,

wherein the capture process is registered to operate as a replication slave to the remote server; and

wherein depending on the type of remote server, the capture process uses a method to be registered as the replication slave to the remote server, and to receive information from that server, including transaction event data.

3. The system of claim 1 or claim 2, wherein the environment is a change data capture system, and wherein the transaction log events are written to an output or trail file for use by the change data capture system with the target database server.

4. The system of claim 3, wherein the change data capture system is provided at a different computer or on a different network from the remote server.

5. The system of any preceding claim, wherein the remote server is provided within an access-restricted or cloud environment.

6. The system of any preceding claim, wherein the remote server is a MySQL server.

7. A method for heterogeneous database replication from a remote server, comprising:

providing, at computer including a processor, a change data system operating thereon that enables replicating of data between database servers, and a capture process that is registered to a remote server, and configured to

receive transaction log events that are indicative of database transactions to modify data at a database associated with the remote server,

wherein the transaction log events are processed and output as change data, in a canonical format output for use with one or more target database server or other systems.

8. The method of claim 7,

wherein the capture process is registered to operate as a replication slave to the remote server; and

wherein depending on the type of remote server, the capture process uses a method to be registered as the replication slave to the remote server, and to receive information from that server, including transaction event data.

9. The method of claim 7 or claim 8, wherein the environment is a change data capture system, and wherein the transaction log events are written to an output or trail file for use by the change data capture system with the target database server.

10. The method of claim 9, wherein the change data capture system is provided at a different computer or on a different network from the remote server.

11. The method of any of claims 7 to 10, wherein the remote server is provided within an access-restricted or cloud environment.

12. The method of any of claims 7 to 11 , wherein the remote server is a MySQL server.

13. A computer readable storage medium, including instructions stored thereon which when read and executed by one or more computers cause the one or more computers to perform a method comprising:

providing a change data system that enables replicating of data between database servers, and a capture process that is registered to a remote server, and configured to

receive transaction log events that are indicative of database transactions to modify data at a database associated with the remote server,

wherein the transaction log events are processed and output as change data, in a canonical format output for use with one or more target database server or other systems.

14. The computer readable storage medium of claim 13,

wherein the capture process is registered to operate as a replication slave to the remote server; and

wherein depending on the type of remote server, the capture process uses a method to be registered as the replication slave to the remote server, and to receive information from that server, including transaction event data.

15. The computer readable storage medium of claim 13 or claim 14, wherein the environment is a change data capture system, and wherein the transaction log events are written to an output or trail file for use by the change data capture system with the target database server.

Description:
SYSTEM AND METHOD FOR HETEROGENEOUS DATABASE REPLICATION

FROM A REMOTE SERVER

Claim of Priority and Cross-Reference to Related Applications:

[0001] This application claims the benefit of priority to U.S. Provisional Patent

Application titled “SYSTEM AND METHOD FOR HETEROGENOUS DATABASE REPLICATION FROM A REMOTE SERVER”, Application No. 62/663,954, filed April 27, 2018; and is related to U.S. Patent No. 8,510,270, titled “MYSQL DATABASE HETEROGENEOUS LOG BASED REPLICATION”, issued August 13, 2013; each of which above applications and patents are herein incorporated by reference.

Technical Field:

[0002] Embodiments described herein are generally related to change data capture environments, and are particularly related to a system and method for heterogeneous database replication from a remote server, for example a remote database server.

Background:

[0003] Organizations may at times need to move, copy, or otherwise replicate data between different database environments, for example to create a backup of a database, or to enable sharing of the data between different database applications.

[0004] Change data capture systems help address this need, for example by detecting and replicating changes to the data, such as might be made to a database table as a result of database transactions such as row operations, rather than copying the entire table and its data. Such an approach can be used, for example, to synchronize data in a source database with that in a target database.

[0005] In some data replication environments, a change data capture system can operate by reading a record of database transactions from transaction log files, and using that in replicating data, or modifications to a database, between source and target servers.

[0006] However, such an approach generally requires the capture process to know the location of, and be able to directly access, the transaction log files stored locally. If, for example, a source database server is running on a different computer from the capture process, or on a different network, or within an access-restricted environment such as a cloud environment, then the capture process may not be able to access its transaction log files.

[0007] The lack of a remote transaction processing ability restricts the use of change data capture or data replication in such environments.

[0008] In accordance with an embodiment, described herein is a system and method for heterogeneous database replication from a remote server, for example a remote database server. A capture process can be registered as a replication slave to the remote server, and configured to receive transaction event data from that server. Transaction log events associated with a modification to the database at the remote server can be processed, and output as change data, in a canonical format output, for use with one or more heterogeneous targets, for example a target database server or message queue.

[0009] A technical purpose of the systems and methods described herein includes that the process enables capture of transaction log events associated with database transactions at a remote server that may be located on a different computer or network, or within an access-restricted environment such as a cloud environment, without the need to create additional copies of its transaction logs.

[00010] Advantages of the systems and methods described herein include that the capture process does not require local access to the transaction log, but can instead access transaction logs at a different computer from the capture process, or on a different network, or within an access-restricted environment such as a cloud environment.

[00011] Further advantages of the systems and methods described herein include support for replication of transaction log data between heterogeneous servers, i.e. , servers of different types; for example between a remote server of a first type, and a second type of target server; by use of a canonical format output and forming commands or queries according to each particular target, and applying those commands or queries to that target.

[00012] Additional advantages of the systems and methods described herein include enabling communication of transaction log events associated with a modification to the database at a remote server communication without the need to operate with a native application program interface (API) at that remote server.

[00013] Further advantages of the systems and methods described herein include that the capture process can be configured to operate a process or algorithm for determining a log positioning information, for example according to time or index, that enables operation with the remote server; so that once this command is successfully returned, the server can start sending the transaction log data, beginning from the start position. Brief Description of the Drawings:

[00014] Figure 1 illustrates the use of a change data capture system to enable heterogeneous database replication, in accordance with an embodiment.

[00015] Figure 2 illustrates a change data capture system that includes the copying of transaction logs, in accordance with an embodiment.

[00016] Figure 3 illustrates the use of a change data capture system to enable heterogeneous database replication from a remote server, including the use of a capture process operating as an (emulated) replication slave, in accordance with an embodiment.

[00017] Figure 4 further illustrates the use of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[00018] Figure 5 further illustrates the use of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[00019] Figure 6 further illustrates the use of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[00020] Figure 7 illustrates how the change data capture system provides a canonical format output that enables heterogeneous database replication between servers of different types.

[00021] Figure 8 illustrates a process for providing heterogeneous database replication from a remote server, in accordance with an embodiment.

[00022] Figure 9 further illustrates a process for providing heterogeneous database replication from a remote server, in accordance with an embodiment.

[00023] Figure 10 illustrates an example of a change data capture system with a remote server that uses dump threads, in accordance with an embodiment.

[00024] Figure 11 further illustrates an example of a change data capture system with a remote server that uses dump threads, in accordance with an embodiment.

[00025] Figure 12 illustrates an example process for providing heterogeneous database replication from a remote server that uses dump threads, in accordance with an embodiment.

[00026] Figure 13 further illustrates an example process that uses dump threads, in accordance with an embodiment.

[00027] Figure 14 illustrates the use of a client device and user interface to configure a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[00028] Figure 15 illustrates an example user interface that enables configuration of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[00029] Figure 16 further illustrates an example user interface that enables configuration of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

Detailed Description:

[00030] As described above, in some data replication environments, a change data capture (CDC) system can operate by reading a record of database transactions from transaction log files, and using that in replicating data, or modifications to a database, between source and target servers.

[00031] However, such an approach generally requires the capture process to know the location of, and be able to directly access, the transaction log files stored locally. If, for example, a source database server is running on a different computer from the capture process, or on a different network, or within an access-restricted environment such as a cloud environment, then the capture process may not be able to access its transaction log files.

[00032] Examples of approaches that can be used to address these considerations, although with various limitations, include:

[00033] If the storage location or directory in which the transaction logs are located can be shareably-mounted, e.g., using network file system (NFS), then a capture process can process remote transaction log files as local files. However, as described above, if, for example, a source database server is running on a different computer from the capture process, or on a different network, or within an access-restricted environment such as a cloud environment, then the capture process may not be able to access its transaction log files.

[00034] A transaction log utility software or program can be used to download and stream transaction logs from a remote server to a local computer or machine, where they can be processed. However, this includes creating an additional copy of the transaction log files, resulting in input/output (I/O) and coordination overhead; and also incurs an additional layer of processing between the reading and the processing of the transaction log.

[00035] A separate (native) replication slave, configured on the same computer or machine as the change data capture system, can connect to the remote server, replicate database transactions locally, and generate a replica transaction log for those database transactions that are on the remote server, which can then be processed locally. However, this approach similarly includes creating an additional copy of the transaction log files; together with the associated I/O, coordination overhead; and additional layer of processing.

Database Replication from Remote Servers

[00036] In accordance with an embodiment, described herein is a system and method for heterogeneous database replication from a remote server, for example a remote database server. A capture process can be registered as a replication slave to the remote server, and configured to receive transaction event data from that server. Transaction log events associated with a modification to the database at the remote server can be processed, and output as change data, in a canonical format output, for use with one or more heterogeneous targets, for example a target database server or message queue.

[00037] A technical purpose of the systems and methods described herein includes that the process enables capture of transaction log events associated with database transactions at a remote server that may be located on a different computer or network, or within an access-restricted environment such as a cloud environment, without the need to create additional copies of its transaction logs.

[00038] For example, in accordance with an embodiment, the system and method described herein enables a change data capture system to utilize transaction log data from a remote server, irrespective of that server’s location, and without needing to be aware of the transaction logs’ physical location.

[00039] In accordance with an embodiment, a remote server’s connection parameters can be specified via a user interface or configuration file, which enables a capture process to make a connection to the server and receive transaction log data from the server. The received data can be processed in a similar manner as a local capture, including, for example, outputting the transaction log data to a canonical format output, e.g., an Oracle GoldenGate trail information or file, or another type of file format. The canonical format output can then be read and applied to a target by a delivery process.

[00040] With this approach, there is no need to create an additional copy of the transaction log files, nor is there a need for an additional layer of processing between the reading and the processing of the transaction log.

[00041] In accordance with an embodiment, a user interface or configuration file associated with the capture process, e.g., a capture parameter file, enables a user to specify that a remote server from where the transaction should be replicated is "remote"; together with any required connection parameters, for example a remote database server name, userid, and password; which the system can then use to replicate database transactions from that remote server. [00042] Figure 1 illustrates the use of a change data capture system to enable heterogeneous database replication, in accordance with an embodiment.

[00043] As illustrated in Figure 1 , in accordance with an embodiment, a change data capture system 100, which can be provided at a computer that includes one or more computer resources (e.g., CPU, memory) 101 , can be configured to capture change data from a remote server system 106, that similarly includes one or more computer resources 107, and further comprises a remote server 102 (e.g., a MySQL server).

[00044] In accordance with an embodiment, the change data capture system can include a capture component 110, that can be provided as software or program code executable by a computer system or other processing device, for example an Oracle GoldenGate component, which can include an extract processor / application program interface (API) 111 that enables communication with the remote server; an access module 112 (e.g., in an Oracle GoldenGate environment, a vendor access module (VAM)); and a CDC process manager 116.

[00045] In accordance with an embodiment, the access module can include one or more access thread 117, and reader thread 118, for use in accessing records at a data source, for example via a network connection/access to the remote server system 119.

[00046] In accordance with an embodiment, the remote server can include one or more nodes that enable transaction(s) 128 to be applied to a database 129, wherein data changes are written to a transaction log 104 (e.g., in a MYSQL environment, a MYSQL binary log or mysqlbinlog file).

[00047] In accordance with an embodiment, a capture process 150, and a delivery process 153, converts the change data that is read from the data source, into a canonical format output 120, including change data 121 indicative of the modifications caused to the database by the database transaction(s), for consumption by one or more heterogeneous targets 130, including, in some embodiments, forming commands or queries according to a particular target, and applying those commands or queries to that target.

[00048] In accordance with an embodiment, the one or more targets can be, for example, a target server 131 or other target system 132, examples of which can include one or more of a database, message queue, or other types of target servers or systems.

[00049] In accordance with an embodiment, the remote server can be associated with one or more replication slaves 141 , 142, which enable changes to the database to be replicated to other nodes for use within the remote server system.

Log-Based Replication

[00050] As described above, although a change data capture system can operate by reading a record of database transactions from transaction log files - if a source database server is running on a different computer from the capture process, or on a different network, or within an access-restricted environment such as a cloud environment, then the capture process may not be able to access its transaction log files.

[00051] Figure 2 illustrates a change data capture system that includes the copying of transaction logs, in accordance with an embodiment.

[00052] As illustrated in Figure 2, in accordance with an embodiment, the remote server 102 can, for example, be associated with a software utility (e.g., in a MYSQL environment, a mysqlbinlog utility), which can be used to download, stream, or otherwise copy transaction logs from the remote server to the computer where the capture process is running.

[00053] This approach includes writing the transaction logs to one or more intermediate or temporary transaction log files 112 on the computer running the capture process. The capture process can then read and process this intermediate file, and process and output or write the database transactions to one or more canonical format output, e.g., trail information or trail files, to be read by the delivery process and applied on a target, e.g., database server.

[00054] However, as described above, a problem with this approach is that it includes creating an additional copy of the transaction log files; together with the associated I/O, coordination overhead; and additional layer of processing.

Capture Process

[00055] To address the above considerations, in accordance with an embodiment, a capture process can instead be registered as a replication slave to the remote server, and configured to receive information from that server, including transaction event data.

[00056] Figure 3 illustrates the use of a change data capture system to enable heterogeneous database replication from a remote server, including the use of a capture process operating as an (emulated) replication slave, in accordance with an embodiment.

[00057] As illustrated in Figure 3, in accordance with an embodiment, the remote server is configured to deliver transaction log data to its replication slaves. Replication slaves can make requests for the transaction log data as long as they can make a connection to the remote server. The replication slaves can be located on the same computer or machine where the remote server runs, or can be located on a different machine.

[00058] In accordance with an embodiment, the capture process is configured (154) to appear and operate as an (emulated) replication slave 151 to the remote server, including use of a process or algorithm for determining a slave server identifier (ID) 157, wherein the slave server ID 155 enables operation with the remote server. An example process or algorithm for determining a slave server ID is illustrated below. Once the capture process is connected to the server to appear and operate as an (emulated) replication slave, it can request data from the server in a loop.

[00059] In accordance with an embodiment, a user can configure the remote server connection parameters using a capture parameters file, or other manner or means of specifying capture parameters 148. The capture process can use this information to make the connection to the server, and start receiving the transaction log data from the server, irrespective of where the server is located. Once the capture process starts reading the transaction log data from the remote server, this data can then be processed in a similar manner as a local capture, including, for example, outputting the transaction log data to a canonical format output or file.

[00060] In accordance with an embodiment, the registering of a capture process as a replication slave to a remote server, and configuring the capture process to receive information from that server, including transaction event data, enables transaction log events, that are indicative of database transactions to modify data at a database associated with the remote server, to be processed and output for use with a target database server.

[00061] Figure 4 further illustrates the use of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[00062] As illustrated in Figure 4, in accordance with an embodiment, the capture process connects to the remote server as a client or client process. When the capture process connects to the remote server, it is first registered with the server as a replication slave. In accordance with an embodiment, a command such as a “register slave” command 152 (e.g., in a MYSQL environment, a COM_REGISTER_SLAVE command) can be sent to the remote server by the capture process, in order to register itself as a replication slave of the remote server.

[00063] In accordance with an embodiment, the“register slave” command enables the capture process to communicate with the remote server, after making connection to the remote server, and before the remote server can send any data to the capture process. The command arguments can include the remote server’s network address, user name on remote server, the password and a slave server ID (e.g., ServerJD) associated with the capture process.

[00064] In accordance with an embodiment, after making connection to the remote server, the capture process sends the “register slave” command with connection parameters and its slave server ID. The remote server can then register the capture process as one of its replication slaves. [00065] Figure 5 further illustrates the use of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[00066] As illustrated in Figure 5, in accordance with an embodiment, once the capture process is registered as a replication slave to the remote server, the capture process can request the server to send data, including transaction (TX) event data 158, for example using a command 156 to“receive transaction (TX) events”.

[00067] For example, in accordance with an embodiment, to receive the transaction log data from the server, after registering with the remote server, the server can start a dump thread to the capture process; by which the capture process can receive the transaction log data; and wherein the slave server ID associated with the dump thread is the same as that which was registered in the previous step, and request transaction event data via that dump thread.

[00068] In accordance with other embodiments, depending on the type of remote server, the capture process can instead use other methods that enable it to be registered as a replication slave to the remote server, and configured to receive information from that server, including transaction event data.

[00069] Figure 6 further illustrates the use of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[00070] As illustrated in Figure 6, in accordance with an embodiment, the capture process is configured to operate a process or algorithm 161 for determining a log positioning information that enables operation with the remote server. Once this command is successfully returned, the server can start sending the transaction log data, beginning from the start position 162 (e.g., a log number and position) sent to the server. The capture process then can request the data from the server, for example in a cli_safe_read call in a loop 163, which data can then be written as an output 164, e.g., to the canonical format output.

Setting the Start Position

[00071] As described above, in accordance with an embodiment, the capture process is configured to operate a process or algorithm for determining a log positioning information that enables operation with the remote server. Once this command is successfully returned, the server can start sending the transaction log data, beginning from the start position.

[00072] For example, in accordance with an embodiment, a command, e.g., COM_BINLOG_DUMP can be sent with a transaction log name and start offset position. Initial positioning can be supported by timestamp, offset and default.

[00073] In accordance with an embodiment, when setting the initial position by log offset, a log number received from the user can be mapped to the log name. Then, the binary log name and the start offset given by user is supplied to the command, and the command is sent to the server

[00074] In accordance with an embodiment, a timestamp of the events can be matched with timestamp to be positioned. On finding the correct match in a particular binlog file, the initial offset of the event corresponding to that timestamp is retrieved, and then the start position is set at that offset.

[00075] In accordance with an embodiment, a first binary log name can be retrieved from the list of binlogs created at the start of the capture process, and the default log offset sent.

[00076] The above examples are provided in accordance with an embodiment, to illustrate various methods of setting the start position; in accordance with other embodiments, other methods can be used.

Heterogeneous Database Replication

[00077] Figure 7 illustrates how the change data capture system provides a canonical format output that enables heterogeneous database replication between servers of different types.

[00078] As described above, in accordance with an embodiment, transaction log events associated with a modification to the database at the remote server can be processed, and output as change data, in a canonical format output, for use with one or more heterogeneous targets, for example a target database server or message queue.

[00079] For example, as illustrated in Figure 7, in accordance with an embodiment, the capture process, together with one or more delivery process(es) 176, can be used to convert the change data that is read from the data source, for example a remote server of a first type, into a canonical format output, for consumption by one or more heterogeneous targets, including in this example, a second type of target server 172 and/or a third type of target server 174, by forming commands or queries according to each particular target, and applying those commands or queries to that target.

Database Replication Method

[00080] Figure 8 illustrates a process for providing heterogeneous database replication from a remote server, in accordance with an embodiment.

[00081] As illustrated in Figure 8, in accordance with an embodiment, a method for heterogeneous database replication from a remote server, for example a remote server, can include, at step 182, setting up a connection to a remote server.

[00082] At step 184, the process can include registering a capture process (e.g., Oracle GoldenGate capture) as a capture process operating as an (emulated) replication slave to the remote server.

[00083] At step 186, the process can include configuring a capture process to receive transaction event data from the remote server.

[00084] At step 188, the process can include processing remote server transaction log events, to be output or written as a canonical format output, for use with a target server.

[00085] At step 190, a canonical format output is provided for use with one or a plurality of heterogeneous target servers of different server type from the remote server.

[00086] Figure 9 further illustrates a process for providing heterogeneous database replication from a remote server, in accordance with an embodiment.

[00087] As illustrated in Figure 9 (wherein steps 184 and 186 can be as described above), in accordance with an embodiment, the process can include, at step 192, determining an existing replication slave list.

[00088] At step 193, a slave server ID is determined for the capture process operating as the (emulated) replication slave.

[00089] At step 194, the capture process is registered as the (emulated) replication slave to the remote server.

[00090] At step 196, a start position is set for use with the transaction log.

[00091] At step 197, the transaction log at the remote server is processed from the start position.

[00092] At step 198, the transaction log events are read and used to prepare the canonical format output.

Example Implementation

[00093] The following section provides, for purposes of illustration, a description of an example embodiment for capture of change data from a distributed data source system, such as, for example, a MySQL server operating a MySQL database.

[00094] In accordance with other embodiments, other types of distributed data sources or databases can be supported. For purposes of illustration, various details are provided below in order to provide an understanding of various embodiments. However, embodiments can also be practiced without specific details. The following description is not intended to be restrictive.

[00095] Figure 10 illustrates an example of a change data capture system with a remote server that uses dump threads 206, in accordance with an embodiment. [00096] As illustrated in Figure 10, in accordance with an embodiment, the capture process connects to the remote server system 202 and remote server (e.g., a MySQL server) 204 as a client or client process. When the capture process connects to the remote server, it is first registered with the server as a replication slave. In accordance with an embodiment, a“register slave” command (e.g., in a MYSQL environment, a COM_REGISTER_SLAVE command) can be sent to the remote server by the capture process, in order to register itself as a replication slave of the remote server.

[00097] In accordance with an embodiment, and as described above, the“register slave” command enables the capture process to communicate with the remote server, after making connection to the remote server, and before the remote server can send any data to the capture process. The command arguments can include the remote server’s network address, user name on remote server, the password and a slave server ID (e.g., ServerJD) associated with the capture process.

[00098] In accordance with an embodiment, after making connection to the remote server, the capture process sends the “register slave” command with connection parameters and its slave server ID. The remote server can then register the capture process as one of its replication slaves.

[00099] Figure 11 further illustrates an example of a change data capture system with a remote server that uses dump threads, in accordance with an embodiment.

[000100] As illustrated in Figure 11 , in accordance with an embodiment, and as described above, the capture process is configured to operate a process or algorithm for determining a log positioning information that enables operation with the remote server. Once this command is successfully returned, the server can start sending the transaction log data, beginning from the start position (e.g., a log number and position) sent to the server. The capture process then can request the data from the server, for example in a cli_safe_read call in a loop 210, which data can then be written as an output to the canonical format output.

[000101] In accordance with an embodiment, a“dump thread” command 208 (e.g., in a MYSQL environment, a COM_BINLOG_DUMP command) creates the dump thread inside the remote server, and the capture process starts receiving the transaction log data over the network via this dump thread. The“dump thread” command is sent to the server with the transaction (binary) log name, start position and flags, wherein the flag values indicate whether the dump thread continues after reading the last set of data in the last transaction log.

Setup Connection to Remote Server

[000102] In accordance with an embodiment, the capture process creates a dedicated connection to the remote server, in order to setup the capture process to appear and operate as an (emulated) replication slave and to continuously retrieve event stream data from the remote server. After the connection is established, the following connection attributes are also set:

[000103] MYSQL_OPT_SSL_MODE: The client's SSL requirements.

[000104] MYSQL_OPT_PROTOCOL: The default communication protocol is TCP.

[000105] MYSQL_OPT_CONNECT_ATTR_ADD: This adds connection information into performance_schema.session_connect_attrs; for example, the program name can be added, which can be helpful on monitoring or troubleshooting the program.

[000106] In accordance with an embodiment, the remote server can be informed whether the client is checksum aware or not, since, e.g., MySQL server does not support replication slaves that are not checksum aware. For example, SET @master_binlog_checksum='NONE' tells the server if the client understands checksum algorithms. If the client does not inform the remote server, then the server returns an error on cli_safe_read, instead of sending the data back to the client.

Registration of Capture Process

[000107] In accordance with an embodiment, the remote server registers the list for all of its replication slaves for checkpointing and bookkeeping purposes.

[000108] As described above, in accordance with an embodiment, the command COM_REGISTER_SLAVE can be sent to the remote server, by the capture process, to cause itself to be registered as a replication slave to the server, and can be supplied with connection parameters (e.g., the remote server’s network address, userid, and password) and a slave server ID.

[000109] In accordance with an embodiment, the slave server ID, with which the capture process is registered, is unique across all existing remote server replication slaves. If the slave server ID supplied with the capture process conflicts with any other existing replication slave processes, then the already running process is terminated by the server. A unique slave server ID is generated by the capture process and sent to the server as a command argument to the command COM_REGISTER_SLAVE, as further described below.

Replication Slave List

[000110] In accordance with an embodiment, a “show slave hosts” command provides detailed information of all the hosts which are registered as replication slaves to the remote server. This list includes actual/true replication slaves, as well as processes that are registered as replication slaves but are not actual/true replication slaves to the remote server, for example capture processes operating as (emulated) replication slaves.

[000111] In accordance with an embodiment, the‘ServerJD’ column from the output of this command gives the IDs of all the replication slave servers. The value in the ‘ServerJD’ column is the same as that supplied by the capture process at the time of sending the command COM_REGISTER_SLAVE to the remote server. This variable is used by the server as an internal variable, and the“show slave hosts” command provides a way to obtain the ServerJD values for all the replication slave servers in a client application. The output from this command is parsed to take the‘ServerJD’ values, and then store these values in a sorted list.

[000112] The example provided below (Example 1) illustrates an example software method or program code to determine a list of all the slave server IDs, in accordance with an embodiment:

Example 1

Slave Server ID Determination

[000113] As described above, in accordance with an embodiment, the capture process is configured to appear and operate as an (emulated) replication slave to the remote server, including use of a process or algorithm for determining a slave server ID that enables operation with the remote server.

[000114] In accordance with an embodiment, the slave server ID of the registered replication slave must be a unique value and not conflict with other/existing registered replication slaves. An example process or algorithm to generate a unique slave server ID is provided below, for purposes of illustration. In accordance with other embodiment, other methods can be used to determine the unique server ID value.

[000115] If the lowest slave server ID is greater than 1 , then decrement the lowest slave server ID and assign the resultant value to the capture process.

[000116] If there are gaps between two existing consecutive slave server IDs, then increment the lower bound slave server ID by 1 , and assign the resultant value to the capture process.

[000117] If both above cases do not hold, then increment the highest slave server ID by 1 , and assign the resultant value to the capture process.

[000118] In accordance with an embodiment, the slave server IDs generated using the above process or algorithm should be unique across all the remote server’s replication slaves, and across all the instances of the capture component. To create unique slave server ID values for each instance of the capture process, the process or algorithm (logic) can be implemented inside a critical section, which guarantees that for the capture process the slave server ID values can be generated as unique values.

[000119] In some instances, a user can create a separate replication slave to the remote server, and can cause the existing process to terminate, before creating a new replication slave. In such instances, the user should be careful not to create a replication slave with an ID that conflicts with any existing replication slave.

[000120] The example provided below (Example 2) illustrates an example software method or program code to generate a slave server ID (e.g., ServerJD) within the capture process, in accordance with an embodiment:

Example 2

[000121] The example process or algorithm illustrated above is provided by way of example; in accordance with other embodiment, other methods can be used to determine a unique server ID value.

COM_REGISTER_SLAVE Command

[000122] In accordance with an embodiment, after generating the ServerJD value, the command COM_REGISTER_SLAVE is sent to the remote server by giving values to ServerJD, remote server name, user ID, and password, as a parameter to the command.

[000123] The example provided below (Example 3) illustrates an example software method or program code to register the capture process to operate as an (emulated) replication slave to a remote server, in accordance with an embodiment:

Example 3

Capture Process as a Dump Thread

[000124] In accordance with an embodiment, after registering the capture process as a replication slave server to the remote server, the command COM_BINLOG_DUMP is sent to the remote server.

[000125] In accordance with an embodiment, sending the command COM_BINLOG_DUMP to the remote server creates a capture process operating as an (emulated) replication slave of this remote server, and keeps capturing the binlog events remotely. The command COM_BINLOG_DUMP is packed with its parameter values, before sending to the remote server. The following are the parameters for the command COM_BINLOG_DUMP:

[000126] ServerJD: The capture process operates as an (emulated) replication slave and it should be given a ServerJD by which the remote server identifies it. This is set with the same ServerJD value that was used at the time of registering capture process as a replication slave to the remote server. If this ServerJD conflicts with any other running (emulated or actual/true) replication slave, then the already running instance will be killed.

[000127] Binlog Name: For remote capture, it is mandatory to provide the binlog file name upfront, since the command COM_BINLOG_DUMP requires it. The server then starts looking for data to be served following that binary log. If the binary log is not present, then the command execution returns back the error specifying the same reason.

[000128] Start position: The command COM_BINLOG_DUMP accepts only 4 bytes for the start position offset, so for remote capture, binary log files that are more than 4 GB in size cannot be supported.

[000129] Dump flags: There are two flags available for setting in the COM_BINLOG_DUMP. One of the flags is BINLOG_DUMP_NON_BLOCK; and the other is 0. Setting the flag to BINLOG_DUMP_NON_BLOCK will disconnect the capture process (capture application) after reading the end of the log. The capture process continuously keeps reading so the flag should be set to 0.

[000130] In accordance with an embodiment, after populating all the above fields, the command COM_BINLOG_DUMP is sent to the server using a simple_command library function.

[000131] The example provided below (Example 4) illustrates an example software method or program code to create a dump thread inside the capture process, in accordance with an embodiment:

Example 4

[000132] In accordance with an embodiment, once the command COM_BINLOG_DUMP is sent to the server, the capture process can use, e.g., the MySQL client library function cli_safe_read, or a mysql_binlog_fetch, in a loop to read the binlog events data streams from the remote server.

Setting the Start Position

[000133] As described above, in accordance with an embodiment, the capture process is configured to operate a process or algorithm for determining a log positioning information that enables operation with the remote server. Once this command is successfully returned, the server can start sending the transaction log data, beginning from the start position sent to the server.

[000134] In accordance with an embodiment, a command, e.g., COM_E3INLOG_DUMP can be sent with a binlog (transaction log) name, and the start offset position. After the COM_E3INLOG_DUMP is successful, the remote server starts sending transaction log data, beginning from that offset in that binlog. The command COM_E3INLOG_DUMP sets the initial read position for the capture process.

[000135] In accordance with an embodiment, initial positioning can be supported by timestamp, offset, and default. The command COM_E3INLOG_DUMP is used to achieve all of these positioning types for remote transaction replication.

Setting Start Position by Offset - COM_BINLOG_DUMP

[000136] In accordance with an embodiment, setting the initial position by log offset is natural to use of the command COM_E3INLOG_DUMP. The log number received from the user is mapped to the binary log name. Then the binary log name and the start offset given by the user is supplied to the command COM_E3INLOG_DUMP. The command is sent to the server, and the remote server starts sending the binlog events, beginning from that position.

Setting Start Position by Timestamp

[000137] In accordance with an embodiment, a list of all existing transaction log files along with their timestamps (format descriptor event timestamp) is created at the start of the capture process. Later, at the time of positioning by timestamp, all the binlog file names are sent to the COM_E3INLOG_DUMP in the reverse order and read from the beginning. The timestamp of the events are matched with timestamp to be positioned. On finding the correct match in a particular binlog file, the initial offset of the event corresponding to that timestamp is retrieved, and then the start position is set at that offset by sending the command COM_E3INLOG_DUMP. Setting Start Position Default

[000138] In accordance with an embodiment, the command COM_BINLOG_DUMP mandates it to pass the log number and the offset as a start position. The first binary log name can be retrieved from the list of binlogs created at the start of the capture process and the default log offset should be sent as 4, which is the first valid offset in MySQL binlog file.

Processing of Transaction Log

[000139] In accordance with an embodiment, the transaction logs store every transaction that takes place in any of the database of, e.g., a MySQL instance. A transaction log stores Insert, Update, Delete statements, DDL statements (e.g., Truncate, Alter, and so on). These transaction logs are called the“Write Ahead Logs” (WAL), as they are written first, and then only the data is written to the actual tables in the database. MySQL database uses to these transaction logs in case of database crash for its recovery.

[000140] MySQL transaction logs stores this information in the form of various events, wherein each event is specific to a particular task in the transaction, for example:

[000141] Query Event: Query event shows the start of a transaction or the statement of a DDL statement.

[000142] TableMap Event: TableMap event stores the metadata specific to each table that is logged into the transaction log.

[000143] RowsLogEvent: RowsLogEvent contain the actual column data of the table for the operations such as, for example, Insert/Delete/Update statements.

[000144] Xid Event: Xid event indicates the commit of a particular transaction.

[000145] RotateEvent: Rotate event indicates the end of one transaction log and provides the name of the successor transaction log.

[000146] Stop Event: Stop event indicates that the server was stopped.

[000147] There are many such events in the transaction logs but these are the most important ones.

Reading of Transaction Log Events

[000148] In accordance with an embodiment, a user interface or configuration file associated with the capture process, e.g., a capture parameter file as described above, enables a user to specify that a server from where the transaction is to be replicated is "remote"; together with connection parameters, for example a remote server name, userid and password; which the system can then use to replicate the database transactions from that remote server. [000149] In accordance with an embodiment, the mysqlclient library routine cli_safe_read is called in a loop to receive the continuous stream of binlog events buffer from the remote server. The cli_safe_read receives the complete event data.

[000150] In accordance with an embodiment, for small events, the network buffer passed to the cli_safe_read or mysql_binlog_fetch receives the data for the complete event. For the rows log event, a complete row is sent to the client, irrespective of the size.

[000151] In accordance with an embodiment, in the case of large objects (LOB), the assumption is that the users have sufficient memory to handle the large LOB row in the memory.

[000152] In accordance with an embodiment, in the case of multirow events, the multiple smaller rows can be combined and sent to the client using mysqld option binlog- row-event-max-size. Depending on the network bandwidth and memory availability, setting it to a reasonable size saves the round trip delay over network.

[000153] In accordance with an embodiment, the event buffer is then processed into different event objects based on the different events types. Cache management is not needed as every cli_safe_read call returns a complete event data. For the remote capture, it is not required to process all the events that are processed for the local capture. The library call handles these events within itself, including for example Query event, Tablemap event, Xid event, Write Rows event, Rotate event and Update Rows events, wherein the processing for these events is almost same as in the local capture. Other events such as, for example, Stop and GTID events are not needed, and hence are ignored.

[000154] In accordance with an embodiment, the events are processed and output or written to a database-agnostic output, e.g., as a canonically format output. A delivery process can then read the transaction, forms queries according to the target database server, and applies those queries to the target database server.

[000155] Figure 12 illustrates an example process for providing heterogeneous database replication from a remote server that uses dump threads, in accordance with an embodiment.

[000156] As illustrated in Figure 12, in accordance with an embodiment, a method for heterogeneous database replication from a remote server, for example a remote server, can include, at step 222, setting up a connection to a remote server (e.g., MySQL).

[000157] At step 224, the process can include registering a capture process (e.g., Oracle GoldenGate capture) as a capture process operating as an (emulated) replication slave to the remote server. [000158] At step 226, the process can include configuring a capture process as a dump thread of the remote server.

[000159] At step 228, the process can include processing remote server transaction log events, to be output or written, for example as a trail information (e.g., Oracle GoldenGate trail file) for use with a target database server (e.g., Oracle, MySQL, Db2).

[000160] At step 230, a canonical format output is provided for use with one or a plurality of heterogeneous target servers of different server type from the remote server.

[000161] Figure 13 further illustrates an example process which uses dump threads, in accordance with an embodiment.

[000162] As illustrated in Figure 13 (wherein steps 224 and 226 can be as described above), in accordance with an embodiment which uses, e.g., a MySQL environment, the process can include, at step 232, determining an existing replication slave list.

[000163] At step 233, a slave server ID is determined for the capture process operating as the (emulated) replication slave.

[000164] At step 234, a“register slave” command (e.g., COM_REGISTER_SLAVE) is sent to the remote server.

[000165] At step 236, following a “dump thread” command (e.g.,

COM_BINLOG_DUMP), the start position is set.

[000166] At step 237, the transaction log at the remote server is processed from the start position.

[000167] At step 238, the transaction log events are read and used to prepare the canonical format output.

User Interface and Administration

[000168] Figure 14 illustrates the use of a client device and user interface to configure a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[000169] As illustrated in Figure 14, in accordance with an embodiment, a client (computer) device 250, that includes device hardware 251 (e.g., processor/CPU, memory), a client software application (e.g., web browser) 252, and a graphical user interface 254, enables an administrator 260 to review and modify a remote server capture configuration 256, for example to configure the CDC process manager with capture parameters.

[000170] As described above, in accordance with an embodiment, the capture process can use this information to make the connection to the remote server, and start receiving the transaction log data from the server, irrespective of where the server is located. Once the capture process starts reading the transaction log data from the remote server, this data can then be processed in a similar manner as a local capture, including, for example, outputting the transaction log data to a canonical format output.

[000171] Figure 15 illustrates an example user interface that enables configuration of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[000172] As illustrated in Figure 15, in accordance with an embodiment, the graphical user interface can enable an administrator to review and modify capture parameters such as, for example, cluster details, including cluster endpoints, reader endpoints, or network-accessible ports.

[000173] Figure 16 further illustrates an example user interface that enables configuration of a change data capture system to enable heterogeneous database replication from a remote server, in accordance with an embodiment.

[000174] As illustrated in Figure 16, in accordance with an embodiment, the graphical user interface can also enable an administrator to review and modify capture parameters such as, for example, transaction log formats, or other characteristics of the transaction log.

[000175] The above examples of a user interface and user thereof are provided by way of example,, and in accordance with an embodiment, to illustrate various interfaces by which an administrator can review and modify a remote server capture configuration, for example to configure the CDC process manager with capture parameters; in accordance with other embodiments, other types of user interfaces can be provided.

[000176] In accordance with various embodiments, the teachings herein may be conveniently implemented using one or more conventional general purpose or specialized computer, computing device, machine, or microprocessor, including one or more processors, memory and/or computer readable storage media programmed according to the teachings of the present disclosure. Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art.

[000177] In some embodiments, the teachings herein can include a computer program product which is a computer readable storage medium (media) having instructions stored thereon/in which can be used to program a computer to perform any of the processes of the present teachings. Examples of such mediums can include, but are not limited to, non-transitory mediums such as hard disk drives, hard disks, hard drives, fixed disks, or other electromechanical data storage devices, floppy disks, optical discs, DVD, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems, or other types of storage media or devices suitable for non-transitory storage of instructions and/or data. Other examples of such mediums include transitory mediums such as carrier signals or transmission media for transmitting signals within a computer or between computers.

[000178] The foregoing description has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the scope of protection to the precise forms disclosed. Many modifications and variations will be apparent to the practitioner skilled in the art.

[000179] For example, although many of the features and techniques described herein are illustrated using the example of capturing data from a MySQL database environment; in accordance with various embodiments, the features and techniques can be similarly used to capture data from other types of distributed data source systems, databases, data structures, or data streams.

[000180] The embodiments were chosen and described in order to best explain the principles of the present teachings and their practical application, thereby enabling others skilled in the art to understand the various embodiments and with various modifications that are suited to the particular use contemplated. It is intended that the scope be defined by the following claims and their equivalents.

[000181] Aspects of the present disclosure are set out in the following numbered clauses:

1. A system for heterogeneous database replication from a remote server, comprising:

a computer including a processor, and change data system operating thereon that enables replicating of data between database servers;

wherein a capture process is registered to a remote server, and configured to receive transaction log events that are indicative of database transactions to modify data at a database associated with the remote server,

wherein the transaction log events are processed and output as change data, in a canonical format output for use with one or more target database server or other systems.

2. The system of clause 1 , wherein the capture process is registered to operate as a replication slave to the remote server; and

wherein depending on the type of remote server, the capture process uses a method to be registered as the replication slave to the remote server, and to receive information from that server, including transaction event data. 3. The system of clause 1 or clause 2, wherein the environment is a change data capture system, and wherein the transaction log events are written to an output or trail file for use by the change data capture system with the target database server.

4. The system of clause 3, wherein the change data capture system is provided at a different computer or on a different network from the remote server.

5. The system of any preceding clause, wherein the remote server is provided within an access-restricted or cloud environment.

6. The system of any preceding clause, wherein the remote server is a MySQL server.

7. A method for heterogeneous database replication from a remote server, comprising:

providing, at computer including a processor, a change data system operating thereon that enables replicating of data between database servers, and a capture process that is registered to a remote server, and configured to

receive transaction log events that are indicative of database transactions to modify data at a database associated with the remote server,

wherein the transaction log events are processed and output as change data, in a canonical format output for use with one or more target database server or other systems.

8. The method of clause 7,

wherein the capture process is registered to operate as a replication slave to the remote server; and

wherein depending on the type of remote server, the capture process uses a method to be registered as the replication slave to the remote server, and to receive information from that server, including transaction event data.

9. The method of clause 7 or clause 8, wherein the environment is a change data capture system, and wherein the transaction log events are written to an output or trail file for use by the change data capture system with the target database server.

10. The method of clause 9, wherein the change data capture system is provided at a different computer or on a different network from the remote server. 11. The method of any of clauses 7 to 10, wherein the remote server is provided within an access-restricted or cloud environment.

12. The method of any of clauses 7 to 11 , wherein the remote server is a MySQL server.

13. A computer readable storage medium, including instructions stored thereon which when read and executed by one or more computers cause the one or more computers to perform a method comprising:

providing a change data system that enables replicating of data between database servers, and a capture process that is registered to a remote server, and configured to

receive transaction log events that are indicative of database transactions to modify data at a database associated with the remote server,

wherein the transaction log events are processed and output as change data, in a canonical format output for use with one or more target database server or other systems.

14. The computer readable storage medium of clause 13,

wherein the capture process is registered to operate as a replication slave to the remote server; and

wherein depending on the type of remote server, the capture process uses a method to be registered as the replication slave to the remote server, and to receive information from that server, including transaction event data.

15. The computer readable storage medium of clause 13 or clause 14, wherein the environment is a change data capture system, and wherein the transaction log events are written to an output or trail file for use by the change data capture system with the target database server.

16. The computer readable storage medium of clause 15, wherein the change data capture system is provided at a different computer or on a different network from the remote server.

17. The computer readable storage medium of any of clauses 13 to 16, wherein the remote server is provided within an access-restricted or cloud environment. 18. The computer readable storage medium of any of clauses 13 to 17, wherein the remote server is a MySQL server.