Snowflake Connection Configuration: Difference between revisions
No edit summary |
|||
Line 30: | Line 30: | ||
== Tables created in Snowflake == | == Tables created in Snowflake == | ||
When datatables are created in QPR ProcessAnalyzer, | When datatables are created in QPR ProcessAnalyzer, corresponding tables are created to the Snowflake. The table is not yet created when a new datatable is created, but when data is the first time imported to the datatable. The Snowflake tables created by QPR ProcessAnalyzer are named as follows: qprpa_dt_<databaseId>_<datatableId>, where <databaseId> identifies the QPR ProcessAnalyzer environment and <datatableId> identify the datatable within the environment. The database id is set in the [[PA_Configuration_database_table|QPR ProcessAnalyzer configuration table]]. Due to the naming, it's possible to configure several QPR ProcessAnalyzer environments to the same Snowflake database and schema. |
Revision as of 23:13, 28 January 2022
This page describes how to setup a Snowflake account and then configure QPR ProcessAnalyzer to use the account though an ODBC connection.
Snowflake account configuration
These instructions provide one possible way to configure the Snowflake account for QPR ProcessAnalyzer. Configurations can also be done differently based on requirements, such as other usage of the same Snowflake account. These instructions set the minimum possible permissions for the Snowflake user accessing the account (minimum privilege principle).
- Create a new Snowflake account in the Snowflake site: https://www.snowflake.com/ (or use an existing account). The account is created to the selected cloud platform and site, so consider a location that is close to the QPR ProcessAnalyzer hosting site.
- Go to https://app.snowflake.com and login in to your Snowflake account.
- In Account > Roles, click the Role button to create a new role. Define Name QPRPA, and click Create Role.
- In Account > Users, click the User button to create a new user. Define User Name QPRPA and define a strong password. Check also that the Force user to change password on first time login is disabled. Click the Create User button.
- Select the created user, and click the Grant Role button. In the Role to grant list, select QPRPA, and click Grant.
- In Compute > Warehouses, click the Warehouse button to create a new warehouse. Define Name QPRPA, and select a suitable Size for the warehouse. In the Advanced Warehouse Options, check that Auto Resume and Auto Suspend are enabled. Set the Suspend After time based on your performance requirements (for example 5 minutes is a good initial value). Click Create Warehouse.
- Select the created warehouse and in the Privileges section and click the Privilege button. For Role, select the QPRPA role. For Privileges, select MONITOR, OPERATE and USAGE. Click the Grant Privileges button.
- In Data > Databases, click the Database button to create a new database. Define Name QPRPA, and click the Create button.
- Select the created database, and in the Privileges section, click the Privilege button. For Role, select the QPRPA role. For Privileges, select USAGE. Click Grant Privileges.
- Select the created database, and click the Schema button to create a new schema. Define Name QPRPA, and click the Create button.
- Select the created schema, and in the Privileges section, click the Privilege button. For Role, select the QPRPA role. For Privileges, select CREATE VIEW, CREATE TABLE, CREATE FILE FORMAT and USAGE. Click the Grant Privileges button.
- Running a Snowflake warehouse consumes credits in the Snowflake account, and thus it's a good practice to set resource monitoring to control the credit usage: In Compute > Resource Monitors, click the Resource Monitor button to create a new resources monitor. Choose suitable monitor settings for your needs, and click the Create Resource Monitor button.
Set Snowflake ODBC connection
To set the Snowflake ODBC connection to QPR ProcessAnalyzer, following steps are needed:
- Install Snowflake ODBC driver in the machine running QPR ProcessAnalyzer Server. More information about the ODBC driver installation: https://docs.snowflake.com/en/user-guide/odbc.html
- Configure Snowflake ODBC connection string to the QPR ProcessAnalyzer configuration table. When configuring Snowflake as instructed above, the following connection string can be used:
Driver={SnowflakeDSIIDriver};Server=<account_identifier>.snowflakecomputing.com;Database=QPRPA;Schema=QPRPA;Warehouse=QPRPA;Role=QPRPA;uid=QPRPA;pwd=<password>
Replace <password> with the password of the QPRPA user. In addition, replace <account_identifier> with the account identifier of your Snowflake account. More information about finding your Snowflake account identifier: https://docs.snowflake.com/en/user-guide/admin-account-identifier.html.
More information about Snowflake ODBC connection strings: https://docs.snowflake.com/en/user-guide/odbc-parameters.html
Tables created in Snowflake
When datatables are created in QPR ProcessAnalyzer, corresponding tables are created to the Snowflake. The table is not yet created when a new datatable is created, but when data is the first time imported to the datatable. The Snowflake tables created by QPR ProcessAnalyzer are named as follows: qprpa_dt_<databaseId>_<datatableId>, where <databaseId> identifies the QPR ProcessAnalyzer environment and <datatableId> identify the datatable within the environment. The database id is set in the QPR ProcessAnalyzer configuration table. Due to the naming, it's possible to configure several QPR ProcessAnalyzer environments to the same Snowflake database and schema.