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).
Syntax¶
Parameters¶
nameSpecifies 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 = valueSpecifies 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_secondsfield.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
__csuffix of column names are removed.
For the defaults, see CREATE DATABASE (zero-copy connector-linked).
SUSPEND DISCOVERYSuspends automatic discovery of schemas and tables for the database. For a Salesforce database, Snowflake also stops updating the views.
RESUME DISCOVERYResumes 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 COMMENTRemoves the comment from the database.
Access control requirements¶
A role used to execute this operation must have the following privileges at a minimum:
| Privilege | Object | Notes |
|---|---|---|
| OWNERSHIP | The catalog-linked database being modified. | Required to suspend or resume automatic discovery. |
| OWNERSHIP or MODIFY | The 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_SECONDSand the two Salesforce properties after you create the database. The connector and the shares (CONNECTOR_NAME,SHARE_NAME,SHARE_NAME_FILTER, andALL_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_CONNECTORapplies only to databases that are linked to a Zero-Copy connector.UPDATE LINKED_CATALOGisn’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_INTERVALandSYSTEM$SET_ZEROCOPY_METADATA_AUTO_REFRESH_INTERVALfunctions. - To read the connector name and the Salesforce properties of the database, call the
SYSTEM$GET_ZEROCOPY_CONNECTOR_LINKED_DATABASE_CONFIGfunction.
Examples¶
Change how often Snowflake discovers new schemas and tables:
Change the Salesforce view options:
Suspend and later resume automatic discovery: