ALTER DATABASE (zero-copy connector-linked)

Modifies the properties of a catalog-linked database that you created from a Zero-Copy connector with CREATE DATABASE … LINKED_ZEROCOPY_CONNECTOR.

You can use this command to do the following:

  • Change how often Snowflake discovers new and removed schemas and tables.
  • Change the Salesforce view options of a database that is linked to a Salesforce connector.
  • Suspend or resume automatic discovery.
  • Set or unset the comment of the database.

To modify a catalog-linked database for an Apache Iceberg™ REST catalog, see ALTER DATABASE (catalog-linked).

See also:

CREATE DATABASE (zero-copy connector-linked) , ALTER ZEROCOPY CONNECTOR , DESCRIBE ZEROCOPY CONNECTOR

Syntax

ALTER DATABASE [ IF EXISTS ] <name> UPDATE LINKED_ZEROCOPY_CONNECTOR
  SET { SYNC_INTERVAL_SECONDS = <value>
      | LEGACY_SALESFORCE_SCHEMA_ALIAS = { TRUE | FALSE }
      | SALESFORCE_USER_FRIENDLY_NAME = { TRUE | FALSE } } [ , ... ]

ALTER DATABASE [ IF EXISTS ] <name> SUSPEND DISCOVERY

ALTER DATABASE [ IF EXISTS ] <name> RESUME DISCOVERY

ALTER DATABASE [ IF EXISTS ] <name> SET COMMENT = '<string_literal>'

ALTER DATABASE [ IF EXISTS ] <name> UNSET COMMENT

Parameters

name

Specifies the identifier for the catalog-linked database to alter.

If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.

For more information, see Identifier requirements.

UPDATE LINKED_ZEROCOPY_CONNECTOR SET ...

Sets one or more properties of the link to the connector. You can set the following properties:

SYNC_INTERVAL_SECONDS = value

Specifies the time interval in seconds that Snowflake uses to discover new and removed schemas and tables in the partner. This interval controls discovery only. It isn’t how often existing tables pick up the latest table metadata.

Values: 30 to 86400 (1 day), inclusive

To read the current value, call the SYSTEM$GET_CATALOG_LINKED_DATABASE_CONFIG function and check the sync_interval_seconds field.

LEGACY_SALESFORCE_SCHEMA_ALIAS = { TRUE | FALSE }

Salesforce only. Specifies whether Snowflake also exposes each share under its Salesforce Data Cloud V1 schema name as pass-through views.

SALESFORCE_USER_FRIENDLY_NAME = { TRUE | FALSE }

Salesforce only. Specifies whether Snowflake adds views with short names, in which the object type suffix and the __c suffix of column names are removed.

For the defaults, see CREATE DATABASE (zero-copy connector-linked).

SUSPEND DISCOVERY

Suspends automatic discovery of schemas and tables for the database. For a Salesforce database, Snowflake also stops updating the views.

RESUME DISCOVERY

Resumes automatic discovery for the database.

To check whether discovery is suspended, call the SYSTEM$CATALOG_LINK_STATUS function.

SET COMMENT = 'string_literal'

Adds a comment or overwrites an existing comment for the database.

UNSET COMMENT

Removes the comment from the database.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

PrivilegeObjectNotes
OWNERSHIPThe catalog-linked database being modified.Required to suspend or resume automatic discovery.
OWNERSHIP or MODIFYThe catalog-linked database being modified.Required for all other operations.

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.

Usage notes

  • You can change only SYNC_INTERVAL_SECONDS and the two Salesforce properties after you create the database. The connector and the shares (CONNECTOR_NAME, SHARE_NAME, SHARE_NAME_FILTER, and ALL_SHARES) are fixed. To change them, create a new database.
  • The Salesforce properties are accepted only for databases that are linked to a Salesforce connector.
  • When you change a Salesforce property, Snowflake adds or removes the corresponding views the next time it updates the views in the database.
  • UPDATE LINKED_ZEROCOPY_CONNECTOR applies only to databases that are linked to a Zero-Copy connector. UPDATE LINKED_CATALOG isn’t supported on these databases.
  • How often existing tables pick up the latest table metadata from the partner is set for each connector, not for each database. To read or change it, use the SYSTEM$GET_ZEROCOPY_METADATA_AUTO_REFRESH_INTERVAL and SYSTEM$SET_ZEROCOPY_METADATA_AUTO_REFRESH_INTERVAL functions.
  • To read the connector name and the Salesforce properties of the database, call the SYSTEM$GET_ZEROCOPY_CONNECTOR_LINKED_DATABASE_CONFIG function.

Examples

Change how often Snowflake discovers new schemas and tables:

ALTER DATABASE my_workday_db UPDATE LINKED_ZEROCOPY_CONNECTOR
  SET SYNC_INTERVAL_SECONDS = 3600;

Change the Salesforce view options:

ALTER DATABASE my_sfdc_db UPDATE LINKED_ZEROCOPY_CONNECTOR
  SET LEGACY_SALESFORCE_SCHEMA_ALIAS = TRUE,
      SALESFORCE_USER_FRIENDLY_NAME = FALSE;

Suspend and later resume automatic discovery:

ALTER DATABASE my_sales_order SUSPEND DISCOVERY;

ALTER DATABASE my_sales_order RESUME DISCOVERY;