# US 2023/0066989 A1 · Schema Change Operations

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

- Number: US 2023/0066989 A1
- Document ID: US20230066989A1
- Status: Published application
- Kind: A1
- Application number: 17/460,495
- Filed: 2021-08-30
- Published: 2023-03-02
- Earliest claimed: 2021-08-30
- Assignees: salesforce.com, inc.
- Applicants: salesforce.com, inc.
- Inventors: Gokcen Iskender; Kadir Ozdemir
- Web page: https://patentgrep.com/patent/US20230066989A1

## CPC

- G06F 16/211: {Schema design and management}
- G06F 16/213: {with details for schema evolution support}
- G06F 16/214: {Database migration support}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 16/2445: {Data retrieval commands; View definitions}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques are disclosed in which a computer system implements schema changes for existing database objects by maintaining a logical name and a current physical name corresponding to an existing database object, where the logical name points to the current physical name. The system receives a schema change request specifying the logical name and format changes for the existing object. The system performs a schema change operation in response to the request, including: creating a new database object having a new physical name, copying and transforming data from the existing object to the new object according to the format changes, mirroring new writes directed to the logical name to both the existing and new objects, and causing the logical name to point to the new physical name instead of the current physical name after completing the copying. The system responds to subsequent queries, specifying the logical name, from the new object.

## Claims

### Claim 1

A method, comprising:
maintaining, by a server computer system, a logical name and a current physical name corresponding to an existing database object, wherein the logical name points to the current physical name;
receiving, by the server computer system, a schema change request that specifies the logical name and one or more data format changes for the existing database object;
performing, by the server computer system in response to the schema change request, a schema change operation that includes:
creating a new database object having a new physical name;
copying existing data from the existing database object to the new database object while transforming the copied data according to the one or more data format changes specified in the schema change request;
mirroring newly received writes directed to the logical name to both the existing database object and the new database object;
after completing the copying, causing the logical name to point to the new physical name instead of the current physical name; and
after completing the schema change operation, responding, by the server computer system, to subsequent database queries specifying the logical name from the new database object.

### Claim 2 (depends on 1)

The method of claim 1, wherein the copying includes:
recording, based on results of transforming the copied data according to the one or more data format changes, whether the transformation is committed; and
performing, after completing the copying based on the recording, a repair process, wherein the repair process transforms copied data associated with recorded, uncommitted changes according to the one or more data format changes specified in the schema change request.

### Claim 3 (depends on 1)

The method of claim 1, wherein performing the schema change operation further includes:
placing a lock on the existing database object, wherein the lock prevents additional schema change requests from altering a schema of the existing database object during the schema change operation.

### Claim 4 (depends on 3)

The method of claim 3, wherein performing the schema change operation further includes:
in response to completing the schema change operation, removing the lock from the existing database object.

### Claim 5 (depends on 1)

The method of claim 1, wherein performing the schema change operation further includes:
generating, prior to the copying, a snapshot of the existing database object, wherein the copying existing data from the existing database object to the new database object is performed based on the data included in the snapshot of the existing database object.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
responding, by the server computer system prior to completing the schema change operation, to database queries specifying the logical name from the existing database object.

### Claim 7 (depends on 6)

The method of claim 6, wherein database queries received during performance of the schema change operation and specifying the logical name are consistent with writes received during performance of the schema change operation.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
storing, by the server computer system in a database object, metadata for a plurality of schema change operations performed on one or more existing database objects.

### Claim 9 (depends on 1)

The method of claim 1, wherein performing the schema change operation further includes:
retrieving, from a catalog object stored in a database utilized by the server computer system to store the existing database object and the new database object, metadata for the existing database object, wherein the metadata specifies a physical name corresponding to a database object to which the logical name is currently pointing.

### Claim 10

A non-transitory computer-readable medium having program instructions stored thereon that are capable of causing a computer system to perform operations comprising:
maintaining a logical name and a current physical name corresponding to an existing database object, wherein the logical name points to the current physical name;
receiving a schema change request that specifies the logical name and one or more data format changes for the existing database object;
performing, in response to the schema change request, a schema change operation that includes:
creating a new database object having a new physical name;
copying existing data from the existing database object to the new database object while transforming the copied data according to the one or more data format changes specified in the schema change request;
mirroring newly received writes directed to the logical name to both the existing database object and the new database object;
after completing the copying, causing the logical name to point to the new physical name instead of the current physical name; and
after completing the schema change operation, responding to subsequent database queries specifying the logical name from the new database object.

### Claim 11 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the copying includes:
recording, based on results of transforming the copied data according to the one or more data format changes, whether the transformation is committed; and
performing, after completing the copying, a repair process, wherein the repair process transforms copied data associated with recorded, uncommitted changes according to the one or more data format changes specified in the schema change request.

### Claim 12 (depends on 10)

The-transitory computer-readable medium of claim 10, wherein performing the schema change operation further includes:
placing a lock on the existing database object, wherein the lock prevents additional schema change requests from altering a schema of the existing database object during the schema change operation.

### Claim 13 (depends on 10)

The-transitory computer-readable medium of claim 10, wherein performing the schema change operation further includes:
generating, prior to the copying, a snapshot of the existing database object, wherein copying existing data from the existing database object to the new database object is performed based on the data included in the snapshot of the existing database object.

### Claim 14 (depends on 10)

The-transitory computer-readable medium of claim 10, further comprising:
responding, prior to completing the schema change operation, to database queries specifying the logical name from the existing database object.

### Claim 15 (depends on 10)

The-transitory computer-readable medium of claim 10, wherein one or more data format changes include at least a primary key attribute change.

### Claim 16

A system, comprising:
at least one processor; and
memory having program instructions stored thereon that are executable by the at least one processor to cause the system to perform operations comprising:
maintaining a logical name and a current physical name corresponding to an existing database object, wherein the logical name points to the current physical name;
receiving a schema change request that specifies the logical name and one or more data format changes for the existing database object;
performing, in response to the schema change request, a schema change operation that includes:
creating a new database object having a new physical name;
copying existing data from the existing database object to the new database object while transforming the copied data according to the one or more data format changes specified in the schema change request;
mirroring newly received writes directed to the logical name to both the existing database object and the new database object;
after completing the copying, causing the logical name to point to the new physical name instead of the current physical name; and
after completing the schema change operation, responding to subsequent database queries specifying the logical name from the new database object.

### Claim 17 (depends on 16)

The system of claim 16, wherein the copying includes:
recording, based on results of transforming the copied data according to the one or more data format changes, whether the transformation is committed; and
performing, after completing the copying based on the recording, a repair process, wherein the repair process transforms copied data associated with recorded, uncommitted changes according to the one or more data format changes specified in the schema change request.

### Claim 18 (depends on 16)

The system of claim 16, wherein performing the schema change operation further includes:
in response to detecting that at least one of the copying and the mirroring have failed during performance of the schema change operation, relaunching the schema change operation, wherein relaunching includes restarting the schema change operation for the existing database object.

### Claim 19 (depends on 16)

The system of claim 16, wherein performing the schema change operation further includes:
generating, prior to the copying, a snapshot of the existing database object, wherein copying existing data from the existing database object to the new database object is performed based on the data included in the snapshot of the existing database object.

### Claim 20 (depends on 16)

The system of claim 16, wherein the program instructions are further executable by the at least one processor to cause the system to perform operations comprising:
responding, prior to completing the schema change operation, to database queries specifying the logical name from the existing database object, wherein database queries received during performance of the schema change operation and specifying the logical name are consistent with writes received during performance of the schema change operation.
