Snowflake as Target

Note – Snowflake is supported as a Target by Repstance Advanced Edition only (see Supported Database Requirements).

These parameters are used by prepare, validate and remove with database=target dbtype=snowflake (see Prepare Target Database, Validate Database and Remove Repstance Objects from Database). The login that is given in user needs the privileges that are described in Database Privileges.

Parameters

ParameterDescription
databasetarget. Required.
dbtypesnowflake. Required.
generatesql1 makes prepare return the SQL script and change nothing. The default is 0: prepare creates the objects. validate does not use the parameter, and remove removes the objects whatever its value.
accountThe Snowflake account. Required.
regionThe Snowflake region of the account. Required.
warehouseThe warehouse that runs the statements. Required.
dbnameThe database in which the schema REPI is created. Required.
userThe Snowflake user. Required.
passwordThe password of the user. It is not needed for the key pair authentication.
authtypeHow the user logs in: 0, the default, with the user name and the password, 1 with a key pair, the private key is given by privatekey.
privatekeyThe RSA private key in PEM format, for authtype=1. The key must not be encrypted (no passphrase). With repcli the key can be taken from a file: privatekeyfile=path_to_the_file.

For the key pair authentication the public key has to be assigned to the Snowflake user (see Key-pair authentication in the Snowflake documentation). The account and the region are in the address of the Snowflake web interface: in https://ab12345.eu-west-2.aws.snowflakecomputing.com the account is ab12345 and the region is eu-west-2.aws.

Examples

Return the script instead of running it. No connection is made:

repcli prepare database=target dbtype=snowflake account=ab12345 region=eu-west-2.aws warehouse=DEMO_WH dbname=DWH user=repuser password=Passw0rd123 generatesql=1
[Completed]:
---- SQL ----
create schema if not exists repi;

create table if not exists REPI.APPLY_CKPT(
 apply_id int,
 file_sequence int not null,
 md_sequence int not null,
 position int not null,
 first_lsn varchar(22) not null,
 ckpt_lsn varchar(22) not null,
 ckpt_lsntime timestamp,
 ldckpt int not null default 0,
...

Validate with a key pair:

repcli validate database=target dbtype=snowflake account=ab12345 region=eu-west-2.aws warehouse=DEMO_WH dbname=DWH user=repuser authtype=1 privatekeyfile=/home/repstance/snowflake_key.p8

Web UI

The form “Database Settings” of an Apply Process for Snowflake has the fields “Account”, “Username”, “Database Name”, “Region”, “Auth Type”, “Password” and “Warehouse”. The buttons that prepare the database are shown in Prepare Target Database:

Web UI, Database Settings of a Snowflake Target: account, region, warehouse, database, login, Password Auth
 

For the key pair authentication choose “Key Pair” in “Auth Type”. The field “Password” is replaced by “Private Key”. Click “Add Private Key”:

Web UI, Database Settings of a Snowflake Target: Auth Type Key Pair with the Add Private Key link highlighted
 

The window takes the private key in PEM format: paste the key or upload the key file.

Web UI, Snowflake private key window: a box to paste the key and the Upload Private Key button
 
 
On this page