Snowflake Setup

Pre Installation Requirements

Snowflake Instance Requirements

  1. Truelty supports the following Snowflake editions:
    1. Enterprise
    2. Business Critical
    3. Virtual Private Snowflake (VPS)
  2. The user performing the Truelty Snowflake install must have access to the Snowflake AccountAdmin role.

Snowflake Account Setup Requirements

The Snowflake installation for Truelty requires the following:

  1. The URL to the Snowflake Account Instance where Truelty will be installed
  2. The Snowflake User running the SQL install scripts must have access to the following base Snowflake roles:
    1. AccountAdmin
    2. SecurityAdmin
  3. Passwords for the two Snowflake users that will be created as part of the install
    1. _TRUELTY_UI
      1. The UI uses this isolated user account to connect to Snowflake
    2. _TRUELTY_SVC
      1. The Python application uses this service user account to connect to Snowflake and do the heavy lifting of the back-end processing.
  4. The Truelty Snowflake and Python setup scripts and python app will either be sent to you from Truelty or to the consultant doing the installation jointly with you.

Truelty Snowflake Install Prep and Overview

There are three setup script files:

  1. truelty_setup_1.sql
    1. Creates and configures the following:
      1. Users
      2. Roles
      3. Warehouse
      4. Database
      5. Schemas
    2. Access and ownership role grants to created objects
  2. truelty_setup_2.sql
    1. Creates the following objects in their respective schemas
      1. Sequencers
      2. Tables
      3. Views
      4. Stored Procedures
  3. truelty_setup_3.sql
    1. Populates control tables with base data needed to run Truelty

We will run the truelty_setup_1.sql SQL script first. In this script, we will need to add a few details to the script before we run them.

  1. Password for the _truelty_svc user
  2. Password for the _truelty_ui user
  3. Optionally we can add on or Snowflake admin users to the truelty_svc role.

We recommend you run the truelty_setup_1.sql Snowflake Setup Script using the Snowflake Classic UI to accommodate the role changes in the scripts currently not supported in SnowSight UI. The other two scripts we will run in the SnowSight UI, as it supports the Snowflake Scripting Stored Procedure creation.

Steps to run the Truelty Install Scripts on Snowflake

Running Setup Script truelty_setup_1.sql

  1. Open up a new worksheet in the Snowflake Classic UI logged in as a user that has access to AccountAdmin role.
  2. Copy and paste the entire script from the truelty_setup_1.sql file into the new worksheet.
  3. Find the comments in the script indicating where to:
    1. Replace the text <add password> with the password for the _truelty_svc user.
    2. Replace the text <add password> with the password for the _truelty_ui user.
    3. Recommended, but optional, to add a Snowflake admin user(s) to the truelty_svc role by replacing the text <ADD USER NAME> with the name of the Snowflake admin user.
    4. NOTE: We recommend that the user running the initial setup script add their Snowflake user to have access to the truelty_svc role. This makes running the two additional scripts easier.
      1. If you choose not to add an admin user to the truelty_svc role, comment out the line of the script.
        1. If you have chosen not to add an admin user to the truelty_svc role, you will need to log back into Snowflake using the _truelty_svc user to install the last two scripts.
  4. Run the entire script.

Running Setup Script truelty_setup_2.sql

  1. Switch from the Snowflake classic UI to Snowsight UI
  2. Open a new worksheet and copy and paste the entire script from the truelty_setup_2.sql file into the worksheet.
  3. Select the entire script and execute it.

Running Setup Script truelty_setup_3.sql

  1. Open a new worksheet in Snowsight and copy and paste the entire script from the truelty_setup_3.sql file into the worksheet.
  2. Select the entire script and execute it.

    Once all three setup scripts have successfully run, you can delete the three worksheets created for the installation.