# US 10,769,034 B2 · Caching DML statement context during asynchronous database system replication

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

- Number: US 10,769,034 B2
- Document ID: US10769034B2
- Status: Granted
- Kind: B2
- Application number: 15/452,391
- Filed: 2017-03-07
- Published: 2018-09-13
- Granted: 2020-09-08
- Earliest claimed: 2017-03-07
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Sarika Iyer; Vivek Kandiyanallur; Martin Heidel; Rolando Blanco; Stephan Kottler; Carsten Thiel; Peter Steinemann; Jörn Schmidt; Colin Florendo; Michael Muehle; Chaitanya Gottipati
- Web page: https://patentgrep.com/patent/US10769034B2

## CPC

- G06F 11/1471: involving logging of persistent data for recovery
- G06F 11/1458: {Management of the backup or restore process}
- G06F 11/1464: {for networked environments}
- G06F 11/2035: {without idle spare hardware}
- G06F 11/2097: {maintaining the standby controller/processing unit updated (initialisation or re-synchronisation thereof G06F11/1658 and subgroups)}
- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F 16/24539: {using cached or materialised query results}
- G06F 2201/80: Database-specific techniques
- G06F 2201/855: Details of asynchronous mirroring using a journal to transfer not-yet-mirrored changes
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Objects across multiple database manipulation language (DML) redo log records are cached, during continuous replay of redo log records on a secondary system, for the same table partition to enable reuse of such cached objects. Later, these cached objects can be reused as they are accessed during the sequential processing of DML redo records for a specific table partition.

## Claims

### Claim 1

A method for implementation in connection with a database system including a primary database system having an associated and separate secondary database system mirroring data stored in the primary database system, the method comprising:
continuously replaying, as part of a database recovery operation, redo log records on the secondary database system in each of a plurality of recovery queues, wherein redo log records of a table partition are placed and processed in a specific one of the plurality of recovery queues corresponding to such table partition, wherein each table partition has its own in-memory store;
caching, during the continuous replay of redo log records on the secondary database system and on a per table partition basis, objects that are created during replaying of the redo log records which are common across multiple database manipulation language (DML) redo log records for a same table partition, the objects comprising table level metadata information or column level metadata information;
reusing, as part of the continuous replay of the redo log records on the secondary database system, cached objects as they are accessed during sequential processing of DML redo records for the same table partition;
deleting, as part of the continuous replay of the redo log records on the secondary database system, cached objects when certain conditions associated with a database definition language (DDL) operation are met preventing such deleted cached objects from being reused, the certain conditions comprising encountering a redo log record that modifies content within a particular cached object;
and wherein a flag is set for a DDL redo operation that spans multiple DDL redo log records for which there are interspersed DML redo log records, the flag indicating that redundant synchronization primitives are to be skipped when processing the interspersed DML redo log records; the flag is unset when the last DDL redo log record of the DDL operation is processed.

### Claim 2 (depends on 1)

The method of claim 1 further comprising: initiating recovery of the primary database system by taking the primary database system offline.

### Claim 3 (depends on 2)

The method of claim 2 further comprising: initiating, by the secondary database system, replay of recovery operations specified by a redo log of the primary database system, the redo log being shipped to the secondary database system from the primary database system and comprising redo log records that specify redo operations specific to each of a plurality of table partitions.

### Claim 4 (depends on 3)

The method of claim 3 further comprising: sequentially processing log records from the redo log for each table partition in a different recovery queue.

### Claim 5 (depends on 4)

The method of claim 4 further comprising: bringing the primary database system online after all of the recovery operations are replayed.

### Claim 6 (depends on 1)

The method of claim 1, wherein the database system comprises an in-memory database storing data in main memory.

### Claim 7 (depends on 1)

The method of claim 1, wherein redo log records of different table partitions that are assigned to a same recovery queue are interleaved within such same recovery queue.

### Claim 8

A method for implementation in connection with a database system comprising:
continuously replaying, as part of a database recovery operation, redo log records on the database system in each of a plurality of recovery queues, wherein redo log records of a table partition are placed and processed in a specific one of the plurality of recovery queues corresponding to such table partition, wherein each table partition has its own in-memory store;
caching, during the continuous replay of redo log records and on a per table partition basis, objects that are created during replaying of the redo log records which are common across multiple database manipulation language (DML) redo log records for a same table partition, the objects comprising table level metadata information or column level metadata information;
reusing, as part of the continuous replay of the redo log records on the secondary database system, cached objects as they are accessed during the sequential processing of DML redo records for the same table partition;
deleting, as part of the continuous replay of the redo log records, cached objects when certain conditions associated with a database definition language (DDL) operation are met preventing such deleted cached objects from being reused, the certain conditions comprising encountering a redo log record that modifies content within a particular cached object;
and wherein a flag is set for a DDL redo operation that spans multiple DDL redo log records for which there are interspersed DML redo log records, the flag processing the interspersed DML redo log records; the flag is unset when the last DDL redo log record of the DDL operation is processed.

### Claim 9 (depends on 8)

The method of claim 8 further comprising: sequentially processing log records from the redo log for each table partition in a different recovery queue.

### Claim 10 (depends on 9)

The method of claim 9, wherein the database comprises a plurality of programmable processor cores and the threads are striped such that each core executes a maximum of one recovery thread.

### Claim 11 (depends on 9)

The method of claim 9 further comprising: bringing the database system online after all of the recovery operations are replayed.

### Claim 12 (depends on 8)

The method of claim 8, wherein the database system comprises an in-memory database storing data in main memory.

### Claim 13

A system comprising: a primary database system; and a secondary database system separate from the primary database system mirroring data stored in the primary database system;
wherein the secondary database system: continuously replays redo log records in each of a plurality of recovery queues as part of a database recovery operation, wherein redo log records of a table partition are placed and processed in a specific one of the plurality of recovery queues corresponding to such table partition, wherein each table partition has its own in-memory store;
caches, during the continuous replay of redo log records and on a per table partition basis, objects that are created during replaying of the redo log records which are common across multiple database manipulation language (DML) redo log records for a same table partition, the objects comprising table level metadata information or column level metadata information;
reuses, as part of the continuous replay of the redo log records, cached objects as they are accessed during sequential processing of DML redo records for the same table partition; and deletes, as part of the continuous replay of the redo log records, cached objects when certain conditions associated with a database definition language (DDL) operation are met preventing such deleted cached objects from being reused, the certain conditions comprising encountering a redo log record that modifies content within a particular cached object;
and wherein a flag is set for a DDL redo operation that spans multiple DDL redo log records for which there are interspersed DML redo log records, the flag indicating that redundant synchronization primitives are to be skipped when processing the interspersed DML redo log records; the flag is unset when the last DDL redo log record of the DDL operation is processed.

### Claim 14 (depends on 13)

The system of claim 13, wherein recovery of the primary database system is initiated by taking the primary database system offline.

### Claim 15 (depends on 14)

The method of claim 14, wherein: the secondary database system initiates replay of recovery operations specified by a redo log of the primary database system; the redo log is shipped to the secondary database system from the primary database system and comprises redo log records that specify redo operations specific to each of a plurality of table partitions.

### Claim 16 (depends on 15)

The system of claim 15, wherein log records from the redo log are sequentially processed for each table partition in a different recovery queue.

### Claim 17 (depends on 16)

The system of claim 16. wherein the primary database system is brought online after all of the recovery operations are replayed.

### Claim 18 (depends on 17)

The system of claim 17, wherein the secondary database system comprises a plurality of programmable processor cores and the threads are striped such that each core executes a maximum of one recovery thread.

### Claim 19 (depends on 18)

The system of claim 18, wherein at least one of the primary database system and the secondary database system comprises an in-memory database storing data in main memory.
