- 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¶
Arguments¶
database_nameThe 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.
| Field | Description |
|---|---|
status | SCHEDULED if a discovery cycle was scheduled, NOT_SCHEDULED if none was, or ERROR if scheduling failed. |
reason | For 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. |
message | Explanation for the NOT_SCHEDULED and ERROR outcomes. |
database | Name of the database. |
Usage notes¶
- To follow the progress of the sync, use SYSTEM$CATALOG_LINK_STATUS.
- If the reason is
INELIGIBLEbecause discovery is suspended, resume it with ALTER DATABASE … RESUME DISCOVERY, which requires the OWNERSHIP privilege on the database, and call the function again. - To change how often discovery runs, set
SYNC_INTERVAL_SECONDSwith ALTER DATABASE … UPDATE LINKED_ZEROCOPY_CONNECTOR. - The function fails for a database that wasn’t created from a Zero-Copy connector.
- The function changes which schemas and tables exist in the database. To make existing tables pick up the partner’s latest table metadata sooner, change the connector’s interval with SYSTEM$SET_ZEROCOPY_METADATA_AUTO_REFRESH_INTERVAL.
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:
A call while a cycle is still running: