Categories:

System functions (System Control)

SYSTEM$SYNC_ZEROCOPY_OBJECTS

Starts one discovery cycle for a catalog-linked database that was created from a Zero-Copy connector, without waiting for the next scheduled cycle. A discovery cycle finds schemas and tables that the partner added or removed.

The function schedules the cycle and returns immediately. It doesn’t wait for discovery to finish, and it doesn’t refresh table metadata.

Syntax

SYSTEM$SYNC_ZEROCOPY_OBJECTS('<database_name>')

Arguments

database_name

The name of the catalog-linked database to sync. Specify it as a string literal enclosed in single quotes.

The database must be a catalog-linked database that was created with CREATE DATABASE … LINKED_ZEROCOPY_CONNECTOR.

Returns

Returns a string that contains a JSON object.

FieldDescription
statusSCHEDULED if a discovery cycle was scheduled, NOT_SCHEDULED if none was, or ERROR if scheduling failed.
reasonFor NOT_SCHEDULED, either ALREADY_RUNNING (a discovery cycle is already in progress) or INELIGIBLE (discovery is suspended or the database isn’t eligible). Otherwise null.
messageExplanation for the NOT_SCHEDULED and ERROR outcomes.
databaseName of the database.

Usage notes

Access control requirements

A role used to execute this operation must have the MODIFY or OWNERSHIP privilege on the catalog-linked database.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Examples

Start a discovery cycle for a catalog-linked database named my_sales_order:

SELECT SYSTEM$SYNC_ZEROCOPY_OBJECTS('my_sales_order');
{
  "status": "SCHEDULED",
  "reason": null,
  "database": "MY_SALES_ORDER"
}

A call while a cycle is still running:

{
  "status": "NOT_SCHEDULED",
  "reason": "ALREADY_RUNNING",
  "message": "A catalog sync is already in progress for this database; no new run was scheduled.",
  "database": "MY_SALES_ORDER"
}