Skip to main content

Create a Service User with Default Service User Objects

Once your ALTR account is created, use ALTR’s stored procedure to create your service user and grant privileges.

Note

If your service username, role and warehouse are changed from the default objects (PC_ALTR_USER, PC_ALTR_ROLE and/or PC_ALTR_WAREHOUSE, or ALTR_SERVICE_USER, ALTR_SERVICE_ROLE and ALTR_SERVICE_WAREHOUSE), this stored procedure will not work. Instead, run the stored procedure with custom service user objects. If you need to create a custom service user, we have very specific instructions. Learn more. 

To create a service user with the default service user objects and grant privileges:

  1. Create a database with a well-known name (our recommendation is PC_ALTR_DB) that will house ALTR’s stored procedure.

  2. Run the following SnowSQL to create the service user named ALTR_SERVICE_USER with a TYPE of SERVICE. Later, you will execute a stored procedure that creates the default role (ALTR_SERVICE_ROLE) and the default warehouse (ALTR_SERVICE_WH) if they do not already exist.

    CREATE USER IF NOT EXISTS ALTR_SERVICE_USER TYPE = SERVICE;

    Note

    Although ALTR recommends key-pair authentication, if you wish to use password authentication set the TYPE parameter on the user to LEGACY_SERVICE instead of SERVICE. Note that Snowflake is taking steps to deprecate LEGACY_SERVICE users throughout 2025 and 2026 and will ultimately require all ALTR service users to migrate to key-pair authentication. Learn more.

  3. Run the following SnowSQL in the database to create the ALTR_SETUP_SERVICE_ACCOUNT stored procedure. You should take note of which database you create the procedure in.

    Note

    When you run the stored procedure, set the IS_PARTNER_CONNECT to FALSE, unless your service user was automatically created by Snowflake Partner Connect (PC_ALTR_USER).

  4. Execute the following command to run the stored procedure. The stored procedure may take several minutes to run, especially for Snowflake accounts with many databases, schemas and tables.

    Note

    If using PC_ALTR_USER, set the parameter to TRUE. If using ALTR_SERVICE_USER, set the parameter to FALSE.

    CALL SETUP_ALTR_SERVICE_ACCOUNT(FALSE); 

    Note

    ALTR recommends assigning a network policy to the service user to further secure the user and to prevent unauthorized access. Learn more.