# US 2016/0259837 A1 · Database management system and method for controlling synchronization between databases

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2016/0259837 A1
- Document ID: US20160259837A1
- Status: Published application
- Kind: A1
- Application number: 14/425,427
- Filed: 2014-03-24
- Published: 2016-09-08
- Earliest claimed: 2014-03-24
- Assignees: Hitachi, Ltd.
- Applicants: Hitachi, Ltd.
- Inventors: Akihiro ITOH
- Web page: https://patentgrep.com/patent/US20160259837A1

## CPC

- G06F 16/275: {Synchronous replication}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Data synchronization requires much time if synchronization is started from an initial state where synchronization between databases is not performed, and when a synchronized record is updated during the synchronization process, synchronization of records must be performed again, so that the amount of communication for synchronization is increased. Therefore, when starting synchronization, data synchronization is performed based on a method using a table indicating the synchronization statuses between databases, and at the final stage of synchronization, data synchronization is performed based on a query transmission method using update logs. The remaining synchronization time is periodically calculated of a case where synchronization is continued via the table method and a case where synchronization is performed by switching to the query transmission method, and the synchronization method is switched if the calculated remaining synchronization time becomes shorter when switched to the query transmission method.

## Claims

### Claim 1

A database management system comprising:
databases for a synchronization source and a synchronization destination;
a management server for controlling data synchronization between databases of the synchronization source and the synchronization destination;
a table for storing entries at least including an identifier for identifying a record of the database of the synchronization source, and a synchronization flag indicating whether the record is non-synchronized or synchronized between the databases of the synchronization source and the synchronization destination;
wherein the management server
executes switching from a synchronization control based on a table method, which performs data synchronization between databases by transmitting the record where the synchronization flag extracted from the table is set to non-synchronized from the database of the synchronization source to the database of the synchronization destination, to a synchronization control based on a query transmission method, which utilizes an update log to perform data synchronization between databases by transmitting an update log extracted from the database of the synchronization source to the database of the synchronization destination; and
based on a non-synchronized status and a synchronized status indicated by the synchronization flag in the table, periodically calculates a remaining synchronization time when synchronization is continued based on the table method and a remaining synchronization time by switching to the query transmission method, and when it is determined that the remaining synchronization time by switching to the query transmission method is shorter based on the result of the calculation, sets a timing for executing the switching.

### Claim 2 (depends on 1)

The database management system according to claim 1, wherein
when switching the synchronization control, the management server extracts a transaction log corresponding to the record not included in an entry of the table at a point of time of starting extraction of the non-synchronized file out of the transaction logs executed before the point of time of starting extraction of the non-synchronized files of extracting records where the synchronization flag in the table is set to non-synchronized as a difference log after the point of time of starting extraction of the non-synchronized file, and transmitting the difference log and the non-synchronized file to the database of the synchronization destination.

### Claim 3 (depends on 1)

The database management system according to claim 1, wherein
the management server determines an isolation property of a transaction from other transactions having an overlapped execution period with said transaction based on a query log of the transaction during synchronization control based on the query transmission method, and when it is determined that isolation is possible, transmits the query log to the database of the synchronization destination.

### Claim 4 (depends on 1)

The database management system according to claim 1, wherein
the management server determines an isolation property of a transaction from other transactions having an overlapped execution period with said transaction based on a transaction log of the transaction during synchronization control based on the query transmission method, and when it is determined that isolation is possible, transmits the query log corresponding to the transaction log to the database of the synchronization destination.

### Claim 5 (depends on 1)

The database management system according to claim 1, wherein
the management server calculates a remaining synchronization time of a case where synchronization is continued based on the table method by performing a simulation calculation of a time required for updating all entries in the table from non-synchronized to synchronized, based on an update frequency of each record stored in the table.

### Claim 6 (depends on 1)

The database management system according to claim 1, wherein
the management server calculates a remaining synchronization time of a case where the system is switched to the query transmission method by adding a transmission time of a record indicating non-synchronized and a synchronization time based on the query transmission method accompanying a number of non-synchronized transactions during the transmission time.

### Claim 7

A method for controlling synchronization between databases, comprising:
a table for storing entries at least including an identifier for identifying a record of a database of a synchronization source, and a synchronization flag indicating whether the record is non-synchronized or synchronized between the database of the synchronization source and a database of a synchronization destination;
wherein following steps (1) and (2) are executed based on a table method, which performs data synchronization between databases by transmitting the record where the synchronization flag is set to non-synchronized to the database of the synchronization destination using the table and a query transmission method, which performs data synchronization between databases by transmitting an update log of the database of the synchronization source to the database of the synchronization destination;
(1) a step of periodically respectively calculating a remaining synchronization time when synchronization is continued using the table method and a remaining synchronization time by switching to the query transmission method, based on the non-synchronized and synchronized statuses indicated by the synchronization flag in the table; and
(2) a step of switching synchronization control when it is determined based on the result of the calculation that the remaining synchronization time is shorter when switched to the query transmission method.

### Claim 8 (depends on 7)

The method for controlling synchronization between databases according to claim 7, wherein
said step (2) includes:
a step of extracting a transaction log as a difference log after a point of time of starting extraction of a non-synchronized file, the difference log being the transaction log corresponding to the record not included in an entry of the table at the point of time of starting extraction of the non-synchronized file out of the transaction logs executed before the point of time of starting extraction of the non-synchronized files, and the point of time of starting extraction of the non-synchronized files being the point of time when the records where a synchronization flag in the table is set to non-synchronized are extracted as the non-synchronized files; and
a step of transmitting the difference log and the non-synchronized file to the database of the synchronization destination.

### Claim 9 (depends on 7)

The method for controlling synchronization between databases according to claim 7, further comprising:
during synchronization control based on the query transmission method,
a step of determining an isolation property of a transaction from other transactions having an overlapped execution period with said transaction based on a query log of the transaction; and
a step of transmitting the query log to the database of the synchronization destination when it is determined that isolation is possible.

### Claim 10 (depends on 7)

The method for controlling synchronization between databases according to claim 7, wherein
during synchronization control based on the query transmission method,
a step of determining an isolation property of a transaction from other transactions having an overlapped execution period with said transaction based on a transaction log of said transaction; and
a step of transmitting a query log corresponding to said transaction log to the database of the synchronization destination when it is determined that isolation is possible.

### Claim 11 (depends on 7)

The method for controlling synchronization between databases according to claim 7, wherein
a step of periodically calculating a remaining synchronization time of a case where synchronization is continued based on the table method in said step (1) performs calculation by simulating a time required for updating all entries in the table from non-synchronized to synchronized, based on an update frequency of each record stored in the table.

### Claim 12 (depends on 7)

The method for controlling synchronization between databases according to claim 7, wherein
a step of periodically calculating a remaining synchronization time of a case where synchronization is switched to the query transmission method in step (1) performs calculation by adding a transmission time of a record indicating non-synchronized and a synchronization time based on the query transmission method accompanying a number of non-synchronized transactions during the transmission time.
