ALTER ZEROCOPY CONNECTOR

Modifies the properties of an existing Zero-Copy connector. You can use this command to do the following:

  • Connect the connector to your SAP BDC or Workday tenant, or disconnect it.
  • Set or unset the comment of the connector.
  • Enable or turn off share back, and associate shares with the connector, for SAP BDC connectors.
  • Rename the connector.
See also:

CREATE ZEROCOPY CONNECTOR , DROP ZEROCOPY CONNECTOR , SHOW ZEROCOPY CONNECTORS , DESCRIBE ZEROCOPY CONNECTOR , CREATE DATABASE (zero-copy connector-linked)

Syntax

ALTER ZEROCOPY CONNECTOR [ IF EXISTS ] <name> RENAME TO <new_name>

ALTER ZEROCOPY CONNECTOR [ IF EXISTS ] <name> CONNECT WITH CONFIG = (
  <config_key> = '<value>' [ , <config_key> = '<value>' , ... ]
)

ALTER ZEROCOPY CONNECTOR [ IF EXISTS ] <name> DISCONNECT

ALTER ZEROCOPY CONNECTOR [ IF EXISTS ] <name> SET
  [ COMMENT = '<string_literal>' ]
  [ SHARE_BACK = { TRUE | FALSE } ]

ALTER ZEROCOPY CONNECTOR [ IF EXISTS ] <name> UNSET COMMENT

ALTER ZEROCOPY CONNECTOR [ IF EXISTS ] <name> ADD SHARE <share_name>

ALTER ZEROCOPY CONNECTOR [ IF EXISTS ] <name> REMOVE SHARE <share_name>

Parameters

name

Specifies the identifier for the connector 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.

RENAME TO new_name

Changes the name of the connector to new_name. The new identifier must be unique for the schema.

For more information, see Identifier requirements.

CONNECT WITH CONFIG = ( config_key = 'value' [ , ... ] )

Connects an SAP BDC or Workday connector to the partner by using the specified configuration. All keys for the partner are required. For the keys, see Configuration keys for CONNECT.

The connection completes in the background. For more information, see Connect and disconnect usage notes.

DISCONNECT

Disconnects the connector from the partner. The operation completes in the background. For the prerequisites, see Connect and disconnect usage notes.

SET ...

Specifies one or more properties to set for the connector, separated by blank spaces, commas, or new lines:

COMMENT = 'string_literal'

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

SHARE_BACK = { TRUE | FALSE }

SAP BDC only. Specifies whether share back is enabled for the connector. With share back, you publish Snowflake data as data products to SAP BDC. For more information, see Publish Data from Snowflake to SAP® BDC Connect for Snowflake.

  • TRUE: Enables share back. The connector must be in the CONNECTED state.
  • FALSE: Turns off share back and removes all shares that are associated with the connector. This doesn’t unpublish data products that you already published. Unpublishing a data product isn’t supported.

Default: FALSE

UNSET COMMENT

Removes the comment from the connector.

ADD SHARE share_name

Associates a share with an SAP BDC connector so that you can publish the objects of the share to SAP BDC. Share back must be enabled for the connector. For the requirements for the share, see Share back usage notes.

REMOVE SHARE share_name

Removes the association between the share and the connector.

Configuration keys for CONNECT

The keys depend on the partner of the connector.

SAP BDC

KeyDescription
INVITATION_LINK

The invitation link that you copy from SAP for Me. Each link can be used only once.

Workday

KeyDescription
TENANTYour Workday tenant name.
DOMAINThe Workday services host, for example impl-services1.wd12.myworkday.com.
CATALOG_ENDPOINTThe Workday Data Cloud catalog host, for example impl-catalog.wd12.myworkday.com.
CLIENT_IDThe identifier of the API client that your Workday administrator registered.
CLIENT_SECRETThe secret of the API client.
REFRESH_TOKENThe refresh token that was issued for the API client.

For DOMAIN and CATALOG_ENDPOINT, specify a host name or an https:// URL without a path.

Snowflake stores CLIENT_SECRET and REFRESH_TOKEN encrypted, masks them in the recorded query text, and never displays them. Specifying them as bind variables isn’t supported. If the client secret or the refresh token expires or is revoked, queries on the connector’s catalog-linked databases fail.

Salesforce

You don’t connect a Salesforce connector with this command. Instead, you read the connector’s enrollment code with the SYSTEM$GET_ZEROCOPY_CONNECTOR_CONFIG function and give it to your Salesforce administrator, who completes the connection from Salesforce Data Cloud. See Set up the Salesforce Data Cloud Zerocopy Connector.

Connect and disconnect usage notes

  • CONNECT and DISCONNECT return before the operation completes. To check the result, run DESCRIBE ZEROCOPY CONNECTOR until the status column is no longer CONNECTING or DISCONNECTING. If the operation fails, the connection_error column contains the reason.
  • If a CONNECT statement for SAP BDC or Workday fails, the connector moves to CONNECT_ERROR. Snowflake doesn’t retry it. Correct the cause, for example get a new invitation link from SAP for Me, and run the statement again. You don’t have to drop and re-create the connector.
  • If a Salesforce connection that your administrator started can’t be completed right away, Snowflake retries it for a while. If the connector still ends in CONNECT_ERROR, repeat the enrollment from Salesforce Data Cloud. Check the status column in Snowflake to confirm the connection.
  • Before you run DISCONNECT, drop all catalog-linked databases that were created from the connector. If share back is enabled, set SHARE_BACK = FALSE first.
  • If the SAP BDC tenant that a connector is connected to is no longer available, drop the connector’s catalog-linked databases, run DISCONNECT, and then connect the connector again with an invitation link for an active tenant.

Connector states

The following table shows the operations that each state allows.

StateAllowed operations
NEWCONNECT, DROP, CREATE OR REPLACE
CONNECTINGNone, until the operation completes
CONNECTEDDISCONNECT, and creating catalog-linked databases
CONNECT_ERRORCONNECT, DROP, CREATE OR REPLACE
DISCONNECTINGNone, until the operation completes
DISCONNECTEDCONNECT, DROP, CREATE OR REPLACE
DISCONNECT_ERRORDISCONNECT, DROP, CREATE OR REPLACE

Share back usage notes

Share back applies only to SAP BDC connectors. For the end-to-end procedure, see Publish Data from Snowflake to SAP® BDC Connect for Snowflake.

  • A share that you add with ADD SHARE must meet the following requirements:
    • It has no consumer accounts and isn’t attached to a listing.
    • It contains only databases, schemas, Iceberg tables, and dynamic Iceberg tables, granted with USAGE (databases and schemas) or SELECT (tables).
    • It doesn’t use WITH GRANT OPTION, future grants, or grants on all objects in a schema or database.
  • A connector can have up to 1000 associated shares, and a share can be associated with up to 200 connectors.
  • Dropping a share that is associated with a connector isn’t supported. Run REMOVE SHARE first.
  • To view the associated shares, use DESCRIBE ZEROCOPY CONNECTOR.

Access control requirements

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

OperationPrivilegeObject
CONNECT, DISCONNECTOPERATEThe connector.
SET, UNSETMODIFYThe connector.
ADD SHARE, REMOVE SHAREUSAGEThe connector. You must also have the OWNERSHIP privilege on the share.
RENAME TOOWNERSHIPThe connector.

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

  • If you specify IF EXISTS and the connector doesn’t exist, the statement completes successfully without making a change.

Examples

Connect an SAP BDC connector with the invitation link from SAP for Me:

ALTER ZEROCOPY CONNECTOR IF EXISTS my_db.my_schema.my_sap_connector
  CONNECT WITH CONFIG = (
    INVITATION_LINK = 'https://my-tenant.hanacloud.ondemand.com/...?code=<one-time code>'
  );

Connect a Workday connector. Replace each placeholder with the value that your Workday administrator supplies:

ALTER ZEROCOPY CONNECTOR IF EXISTS my_db.my_schema.my_workday_connector
  CONNECT WITH CONFIG = (
    TENANT           = '<tenant>',
    DOMAIN           = 'impl-services1.wd12.myworkday.com',
    CATALOG_ENDPOINT = 'impl-catalog.wd12.myworkday.com',
    CLIENT_ID        = '<client_id>',
    CLIENT_SECRET    = '<client_secret>',
    REFRESH_TOKEN    = '<refresh_token>'
  );

Check the state of the connector:

DESC ZEROCOPY CONNECTOR my_db.my_schema.my_workday_connector;

Read the enrollment code of a Salesforce connector, and then give it to your Salesforce administrator:

SELECT SYSTEM$GET_ZEROCOPY_CONNECTOR_CONFIG('my_db.my_schema.my_sfdc_connector');

Set and remove a comment:

ALTER ZEROCOPY CONNECTOR IF EXISTS my_db.my_schema.my_sfdc_connector
  SET COMMENT = 'Salesforce Data Cloud connector for CRM data products';

ALTER ZEROCOPY CONNECTOR IF EXISTS my_db.my_schema.my_sfdc_connector
  UNSET COMMENT;

Disconnect a connector after you drop its catalog-linked databases:

DROP DATABASE IF EXISTS my_workday_db;

ALTER ZEROCOPY CONNECTOR IF EXISTS my_db.my_schema.my_workday_connector
  DISCONNECT;

Enable share back on an SAP BDC connector, associate a share, and later remove the association:

ALTER ZEROCOPY CONNECTOR my_db.my_schema.my_sap_connector SET SHARE_BACK = TRUE;

ALTER ZEROCOPY CONNECTOR my_db.my_schema.my_sap_connector ADD SHARE my_share;

ALTER ZEROCOPY CONNECTOR my_db.my_schema.my_sap_connector REMOVE SHARE my_share;

Rename a connector:

ALTER ZEROCOPY CONNECTOR my_db.my_schema.my_sap_connector
  RENAME TO my_sap_connector_v2;