# US 2019/0102421 A1 · Method and system for supporting data consistency on an active standby database after dml redirection to a primary database

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

- Number: US 2019/0102421 A1
- Document ID: US20190102421A1
- Status: Published application
- Kind: A1
- Application number: 15/885,281
- Filed: 2018-01-31
- Published: 2019-04-04
- Earliest claimed: 2017-09-29
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Sachin Vijaykumar SONAWANE; Mahesh Baburao GIRKAR; Yunrui LI; Thomas Baby; Vivekanandhan Raja
- Web page: https://patentgrep.com/patent/US20190102421A1

## CPC

- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F 11/1471: involving logging of persistent data for recovery
- G06F 11/2028: {eliminating a faulty processor or activating a spare}
- G06F 11/2035: {without idle spare hardware}
- G06F 11/2048: {where the redundant components share neither address space nor persistent storage}
- G06F 11/2094: {Redundant storage or storage space (G06F11/2056 takes precedence)}
- G06F 11/2097: {maintaining the standby controller/processing unit updated (initialisation or re-synchronisation thereof G06F11/1658 and subgroups)}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 16/275: {Synchronous replication}
- G06F 11/1458: {Management of the backup or restore process}
- G06F 2201/80: Database-specific techniques
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A database session in an active standby server on which an active standby database resides receives a DML statement. The session is suspended while the statement is redirected over a database link to a primary database on which the statement is executed. Information associated with execution of the statement is communicated to the session in the active standby server. Redo records describing changes to the contents of the primary database are applied to the active standby database and control is returned to the session. Prior to commitment of a transaction including the statement, a query directed to data to which the statement was directed is received at the active standby server from a client and executed on the active standby database absent use of a database link based on whether information associated with a database session associated with the client matches the information associated with execution of the statement.

## Claims

### Claim 1

A method for supporting data consistency on an active standby database after redirecting a Data Manipulation Language (DML) statement to a primary database, the method comprising:
receiving the DML statement at a database session in an active standby server on which the active standby database resides;
redirecting the DML statement from the active standby server to the primary database;
executing the DML statement on the primary database;
communicating information associated with execution of the DML statement on the primary database to the database session in the active standby server;
receiving a query at the active standby database through an additional database session in the active standby server, the query directed to data to which the DML statement is directed; and
determining whether the additional database session is associated with additional information that matches a subset of the information associated with execution of the DML statement on the primary database; and
sending a set of results to a client from which the query originated, wherein the set of results include one or more changes made by the DML statement responsive to determining the additional database session is associated with additional information that matches the subset of the information associated with execution of the DML statement and the set of results do not include the one or more changes made by the DML statement responsive to determining the additional database session is not associated with additional information that matches the subset of the information associated with execution of the DML statement.

### Claim 2 (depends on 1)

The method of claim 1, wherein the information associated with execution of the DML statement on the primary database comprises at least: a transaction identifier, a system change number, and an undo block address.

### Claim 3 (depends on 1)

The method of claim 1, wherein the additional information associated with the additional database session comprises a transaction identifier.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
accessing the set of results from a shared buffer cache.

### Claim 5 (depends on 1)

The method of claim 1, wherein sending the set of results to the client from which the query originated comprises:
responsive to determining that the additional database session is not associated with additional information that matches the subset of the information associated with execution of the DML statement on the primary database, undoing the one or more changes made to the data by executing the DML statement on the primary database by applying a set of undo records to the data to which the DML statement is directed; and
sending the set of results to which the set of undo records have been applied to the client from which the query originated.

### Claim 6 (depends on 5)

The method of claim 5, wherein a location of a subset of the set of undo records is specified by the information associated with execution of the DML statement on the primary database.

### Claim 7 (depends on 1)

The method of claim 1, wherein the information associated with execution of the DML statement on the primary database is communicated to the database session in the active standby server in conjunction with a set of redo records communicated to the database session.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
responsive to redirecting the DML statement from the active standby server to the primary database, creating a session in a primary database server on which the primary database resides, the session associated with the database session in the active standby server.

### Claim 9 (depends on 1)

The method of claim 1, wherein the DML, statement is redirected from the active standby server to the primary database using a database link between the active standby server and a primary database server on which the primary database resides.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
suspending the database session in the active standby server upon redirecting the DML statement from the active standby server to the primary database.

### Claim 11 (depends on 1)

The method of claim 1, wherein executing the DML statement on the primary database comprises:
making the one or more changes to the data to which the DML statement is directed on the primary database; and
generating a set of redo records comprising the information associated with execution of the DML statement on the primary database.

### Claim 12 (depends on 11)

The method of claim 11, wherein communicating information associated with execution of the DML statement on the primary database to the database session in the active standby server comprises:
communicating the set of redo records from the primary database to the active standby server.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
applying the set of redo records to additional data stored in the active standby database.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
responsive to applying the set of redo records to the additional data stored in the active standby database, returning control to the database session in an active standby server.

### Claim 15

A computer program product embodied on a non-transitory computer readable medium, the computer readable medium having stored thereon a sequence of instructions which, when executed by a processor causes the processor to execute a method for supporting data consistency on an active standby database after redirecting a Data Manipulation Language (DML) statement to a primary database, comprising:
receiving the DML statement at a database session in an active standby server on which the active standby database resides;
redirecting the DML statement from the active standby server to the primary database;
executing the DML statement on the primary database;
communicating information associated with execution of the DML statement on the primary database to the database session in the active standby server;
receiving a query at the active standby database through an additional database session in the active standby server, the query directed to data to which the DML statement is directed; and
determining whether the additional database session is associated with additional information that matches a subset of the information associated with execution of the DML statement on the primary database; and
sending a set of results to a client from which the query originated, wherein the set of results include one or more changes made by the DML statement responsive to determining the additional database session is associated with additional information that matches the subset of the information associated with execution of the DML statement and the set of results do not include the one or more changes made by the DML statement responsive to determining the additional database session is not associated with additional information that matches the subset of the information associated with execution of the DML statement.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein the information associated with execution of the DML statement on the primary database comprises at least: a transaction identifier, a system change number, and an undo block address.

### Claim 17 (depends on 15)

The computer program product of claim 15, wherein the additional information associated with the additional database session comprises a transaction identifier.

### Claim 18 (depends on 15)

The computer program product of claim 15, wherein the method further comprises:
accessing the set of results from a shared buffer cache.

### Claim 19 (depends on 15)

The computer program product of claim 15, wherein sending the set of results to the client from which the query originated comprises:
responsive to determining that the additional database session is not associated with additional information that matches the subset of the information associated with execution of the DML statement on the primary database, undoing the one or more changes made to the data by executing the DML statement on the primary database by applying a set of undo records to the data to which the DML statement is directed; and
sending the set of results to which the set of undo records have been applied to the client from which the query originated.

### Claim 20 (depends on 19)

The computer program product of claim 19, wherein a location of a subset of the set of undo records is specified by the information associated with execution of the DML statement on the primary database.

### Claim 21 (depends on 15)

The computer program product of claim 15, wherein the information associated with execution of the DML statement on the primary database is communicated to the database session in the active standby server in conjunction with a set of redo records communicated to the database session.

### Claim 22 (depends on 15)

The computer program product of claim 15, wherein the method further comprises:
responsive to redirecting the DML statement from the active standby server to the primary database, creating a session in a primary database server on which the primary database resides, the session associated with the database session in the active standby server.

### Claim 23 (depends on 15)

The computer program product of claim 15, wherein the DML statement is redirected from the active standby server to the primary database using a database link between the active standby server and a primary database server on which the primary database resides.

### Claim 24 (depends on 15)

The computer program product of claim 15, wherein the method further comprises:
suspending the database session in the active standby server upon redirecting the DML statement from the active standby server to the primary database.

### Claim 25 (depends on 15)

The computer program product of claim 15, wherein executing the DML statement on the primary database comprises:
making the one or more changes to the data to which the DML statement is directed on the primary database; and
generating a set of redo records comprising the information associated with execution of the DML statement on the primary database.

### Claim 26 (depends on 25)

The computer program product of claim 25, wherein communicating information associated with execution of the DML statement on the primary database to the database session in the active standby server comprises:
communicating the set of redo records from the primary database to the active standby server.

### Claim 27 (depends on 25)

The computer program product of claim 25, wherein the method further comprises:
applying the set of redo records to additional data stored in the active standby database.

### Claim 28 (depends on 27)

The computer program product of claim 27, wherein the method further comprises:
responsive to applying the set of redo records to the additional data stored in the active standby database, returning control to the database session in an active standby server.

### Claim 29

A computer system to implement a method for supporting data consistency on an active standby database after redirecting a Data Manipulation Language (DML) statement to a primary database, comprising:
a memory for storing data and instructions; and
a processor that executes a sequence of instructions which, when executed by the processor causes the processor to execute a process, the process comprising:
receiving the DML statement at a database session in an active standby server on which the active standby database resides;
redirecting the DML statement from the active standby server to the primary database;
executing the DML statement on the primary database;
communicating information associated with execution of the DML statement on the primary database to the database session in the active standby server;
receiving a query at the active standby database through an additional database session in the active standby server, the query directed to data to which the DML statement is directed; and
determining whether the additional database session is associated with additional information that matches a subset of the information associated with execution of the DML statement on the primary database; and
sending a set of results to a client from which the query originated, wherein the set of results include one or more changes made by the DML statement responsive to determining the additional database session is associated with additional information that matches the subset of the information associated with execution of the DML statement and the set of results do not include the one or more changes made by the DML statement responsive to determining the additional database session is not associated with additional information that matches the subset of the information associated with execution of the DML statement.

### Claim 30 (depends on 29)

The computer system of claim 29, wherein the information associated with execution of the DML statement on the primary database comprises at least: a transaction identifier, a system change number, and an undo block address.

### Claim 31 (depends on 29)

The computer system of claim 29, wherein the additional information associated with the additional database session comprises a transaction identifier.

### Claim 32 (depends on 29)

The computer system of claim 29, wherein the process further comprises:
accessing the set of results from a shared buffer cache.

### Claim 33 (depends on 29)

The computer system of claim 29, wherein sending the set of results to the client from which the query originated comprises:
responsive to determining that the additional database session is not associated with additional information that matches the subset of the information associated with execution of the DML statement on the primary database, undoing the one or more changes made to the data by executing the DML statement on the primary database by applying a set of undo records to the data to which the DML statement is directed; and
sending the set of results to which the set of undo records have been applied to the client from which the query originated.

### Claim 34 (depends on 33)

The computer system of claim 33, wherein a location of a subset of the set of undo records is specified by the information associated with execution of the DML statement on the primary database.

### Claim 35 (depends on 29)

The computer system of claim 29, wherein the information associated with execution of the DML statement on the primary database is communicated to the database session in the active standby server in conjunction with a set of redo records communicated to the database session.

### Claim 36 (depends on 29)

The computer system of claim 29, wherein the process further comprises:
responsive to redirecting the DML statement from the active standby server to the primary database, creating a session in a primary database server on which the primary database resides, the session associated with the database session in the active standby server.

### Claim 37 (depends on 29)

The computer system of claim 29, wherein the DML statement is redirected from the active standby server to the primary database using a database link between the active standby server and a primary database server on which the primary database resides.

### Claim 38 (depends on 29)

The computer system of claim 29, wherein the process further comprises:
suspending the database session in the active standby server upon redirecting the DML statement from the active standby server to the primary database.

### Claim 39 (depends on 29)

The computer system of claim 29, wherein executing the DML statement on the primary database comprises:
making the one or more changes to the data to which the DML statement is directed on the primary database; and
generating a set of redo records comprising the information associated with execution of the DML statement on the primary database.

### Claim 40 (depends on 39)

The computer system of claim 39, wherein communicating information associated with execution of the DML statement on the primary database to the database session in the active standby server comprises:
communicating the set of redo records from the primary database to the active standby server.

### Claim 41 (depends on 39)

The computer system of claim 39, wherein the process further comprises:
applying the set of redo records to additional data stored in the active standby database.

### Claim 42 (depends on 41)

The computer system of claim 41, wherein the process further comprises:
responsive to applying the set of redo records to the additional data stored in the active standby database, returning control to the database session in an active standby server.
