Create a Service User
Once your ALTR account is created, use ALTR’s stored procedure to create your service user and grant privileges.
There are two options:
1. Use the default service user objects
2. Use a custom service user name or role name
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:
Create a database with a well-known name (our recommendation is PC_ALTR_DB) that will house ALTR’s stored procedure.
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.
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).
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.
If you need to use a different service user name or role name (to stay in compliance with your naming convention for example), create a custom service user and grant privileges. We have a specific stored procedure to accomplish this task. If you need help along the way, contact ALTR Support.
To create a service user with custom service user objects and grant privileges:
Create a service user.
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.
Create a role. For the list of privileges required by the service role, refer to Service User Privilege Requirements.
Create a warehouse.
Create a database. By default, the stored procedure grants access to everything in your Snowflake account. Specify a list of databases to limit what the role can access.
Update the following SnowSQL by setting the the required parameters:
SERVICE_USER—The username for the service user. This service user must be created before executing the stored procedure. It defaults to ALTR_SERVICE_USER if it is not supplied. If you created your ALTR account from Snowflake Partner connect and would like to use the default Partner Connect user, set this to PC_ALTR_USER.
SERVICE_ROLE—The default role for the service user. This defaults to ALTR_SERVICE_ROLE if not set, and PC_ALTR_ROLE if SERVICE_USER is set to PC_ALTR_USER. The procedure attempts to create this role if it does not already exist.
SERVICE_WAREHOUSE—The default warehouse of the service user. This defaults to ALTR_SERVICE_WH if not set, and PC_ALTR_WH if SERVICE_USER is set to PC_ALTR_USER. The procedure attempts to create this warehouse if it does not already exist.
DATABASE_NAMES—An array of databases to which privileges are granted. If left blank or set to an empty array, this defaults to all databases in your Snowflake account. By specifying an array of specific databases, this parameter limits the stored procedure to only grant database, schema and table/view level privileges within the specified databases. This is useful for reducing the amount of time the stored procedure takes to execute for troubleshooting.
Run the 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.
Execute the following command to run the stored procedure, setting the parameters as defined above. Add single quotes around the string parameters. The stored procedure may take several minutes to run, especially for Snowflake accounts with many databases, schemas and tables. You can reduce this time be specifying a limited number of databases in the relevant argument.
CALL SETUP_ALTR_SERVICE_ACCOUNT('<SERVICE_USER>',['<DATABASE_NAME1>','<DATABASE_NAME2>', ..., '<DATABASE_NAMEn>'],'<SERVICE_ROLE>','<SERVICE_WAREHOUSE>');
Note
ALTR recommends assigning a network policy to the service user to further secure the user and to prevent unauthorized access. Learn more.