# US 12,007,957 B2 · Database connection refresh for server instances and live database updates

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

- Number: US 12,007,957 B2
- Document ID: US12007957B2
- Status: Granted
- Kind: B2
- Application number: 18/149,339
- Filed: 2023-01-03
- Published: 2023-05-11
- Granted: 2024-06-11
- Earliest claimed: 2021-01-12
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Pradip Kumar Pandey
- Web page: https://patentgrep.com/patent/US12007957B2

## CPC

- G06F 16/21: Design, administration or maintenance of databases
- G06F 8/65: Updates (security arrangements therefor G06F21/57)
- G06F 9/4881: {Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues}
- G06F 9/52: Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F 16/252: {between a Database Management System and a front-end application}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Threads and kernels across multiple server instances may maintain static connections to a database during operation. To apply a patch or other upgrade to the database, a notification may be sent to the database system that causes the database system to redirect new incoming connection requests for the database to a backup database. A second notification may also be sent to each of the server instances where threads maintain active connections to the database. These threads may be allowed to finish executing a current job, then when entering the idle state these threads may be directed to refresh their connections. This refresh operation may be redirected to the backup database. The patch may be applied after all connections have been switched to the backup database. This process switches static connections to the backup database as quickly as possible without interrupting existing thread operations.

## Claims

### Claim 1

A non-transitory computer-readable medium comprising instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising:
receiving a patch to be applied to a first database in a database system;
sending a notification to a server instance, wherein the server instance comprises a thread that holds a connection to the first database, and the notification causes the thread to refresh the connection to a second database when the thread is idle;
determining that the connection to the first database has been refreshed such that the thread is instead connected to the second database; and
causing the patch to be applied to the first database in response to determining that the connection to the first database has been refreshed.

### Claim 2 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the second database comprises and mirror or copy of the first database.

### Claim 3 (depends on 2)

The non-transitory computer-readable medium of claim 2, wherein the second database comprises a plurality of databases which together provide the mirror or copy of the first database.

### Claim 4 (depends on 1)

The non-transitory computer-readable medium of claim 1, further comprising sending a first notification to the database system that causes the database system to redirect incoming connection requests for the first database to the second database, wherein the first notification comprises an indication that the patch will be applied to the first database.

### Claim 5 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein:
a request for a connection to the first database is received by the database system from a second thread operating on the server instance; and
the database system establishes a connection to the second database instead of a connection to the first database.

### Claim 6 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein:
the connection to the first database is maintained until a time after the notification is received by the server instance when the thread becomes idle.

### Claim 7 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the notification is addressed to a process or kernel associated with the thread and passed through a messaging system of the server instance.

### Claim 8 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the notification is addressed to the server instance, and the server instance generates a message through an internal messaging system of the server instance that instructs a process or kernel associated with the thread to refresh the connection when the thread is idle.

### Claim 9 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the server instance comprises a kernel or process that includes the thread among a plurality of threads, and wherein the plurality of threads further comprises a main thread that controls how jobs are distributed to other threads in the plurality of threads.

### Claim 10 (depends on 9)

The non-transitory computer-readable medium of claim 9, wherein the main thread places a lock on the thread in response to receiving the notification, wherein the lock prevents the thread from being assigned a new job from a workload until the connection is refreshed.

### Claim 11 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the main thread removes the lock when the main thread determines when a current job executed by the thread is completed and the thread becomes idle.

### Claim 12 (depends on 11)

The non-transitory computer-readable medium of claim 11, wherein the main thread causes the thread to refresh the connection after the lock is removed and prior to receiving a new job from a workload.

### Claim 13 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein refreshing the connection comprises terminating the connection and requesting a new connection to the second database.

### Claim 14 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein determining that the connection to the first database has been refreshed comprises sending one or more polling messages to the server instance until the server instance responds with an indication that any connections to the first database have been refreshed to instead connect to the second database.

### Claim 15 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein determining that the connection to the first database has been refreshed comprises sending one or more polling messages to the database system until the database system responds with an indication that any connections to the first database have been refreshed to instead connect to the second database.

### Claim 16 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the operations further comprise:
receiving an indication that the patch has been applied to the first database;
sending a third notification to the database system that causes the database system to redirect incoming connection requests for the second database to the first database; and
sending a fourth notification to the server instance, wherein the fourth notification causes the thread to refresh the connection when the thread is idle.

### Claim 17 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the operations further comprise:
receiving an indication that the patch has been applied to the first database;
sending a third notification to the database system that causes the database system to redirect incoming connection requests for the second database to the first database; and
allowing existing connections to the second database to expire over time.

### Claim 18 (depends on 1)

The non-transitory computer-readable medium of claim 1, wherein the operations further comprise:
receiving an indication that the patch has been applied to the first database;
receiving a patch to be applied to the second database, and in response:
sending a third notification to the database system that causes the database system to redirect incoming connection requests for the second database to the first database; and
sending a fourth notification to the server instance, wherein the fourth notification causes the thread to refresh the connection when the thread is idle.

### Claim 19

A method of applying patches to databases that maintain static connections to threads in multiple server instances, the method comprising:
receiving a patch to be applied to a first database in a database system;
sending a notification to a server instance, wherein the server instance comprises a thread that holds a connection to the first database, and the notification causes the thread to refresh the connection to a second database when the thread is idle;
determining that the connection to the first database has been refreshed such that the thread is instead connected to the second database; and
causing the patch to be applied to the first database in response to determining that the connection to the first database has been refreshed.

### Claim 20

A system comprising:
one or more processors; and
one or more memory devices comprising instructions that, when executed by the one or more processors, cause the one or more processors to perform operations comprising:
receiving a patch to be applied to a first database in a database system;
sending a notification to a server instance, wherein the server instance comprises a thread that holds a connection to the first database, and the notification causes the thread to refresh the connection to a second database when the thread is idle;
determining that the connection to the first database has been refreshed such that the thread is instead connected to the second database; and
causing the patch to be applied to the first database in response to determining that the connection to the first database has been refreshed.
