Add New Warehouse for Auto-Management
Grant Revefi permissions to monitor and auto-manage a new Snowflake warehouse on an existing account.
This guide is for users who already have Revefi connected to Snowflake and want to add a new warehouse for auto-management.
Prerequisites
- You have already set up Revefi with Snowflake (completed the initial setup from the main Snowflake guide)
- The
REVEFI_ROLEexists in your Snowflake account - You have a new warehouse you want Revefi to monitor and auto-manage
Step 1: Verify REVEFI_DB exists (One-time setup)
If you've never enabled auto-management before, you need to create the REVEFI_DB database first. Skip this step if REVEFI_DB already exists.
-- Configuration
SET revefi_role_name = 'REVEFI_ROLE';
SET revefi_db = 'REVEFI_DB';
-- Create a dedicated database for Revefi to store tasks and procedures
CREATE DATABASE IF NOT EXISTS identifier($revefi_db);
-- Grant usage on database and schemas
GRANT USAGE ON DATABASE identifier($revefi_db) TO ROLE identifier($revefi_role_name);
GRANT USAGE ON ALL SCHEMAS IN DATABASE identifier($revefi_db) TO ROLE identifier($revefi_role_name);
USE DATABASE identifier($revefi_db);
-- Grant permissions to create procedures and tasks
GRANT CREATE PROCEDURE ON SCHEMA PUBLIC TO ROLE identifier($revefi_role_name);
GRANT CREATE TASK ON SCHEMA PUBLIC TO ROLE identifier($revefi_role_name);
GRANT EXECUTE TASK ON ACCOUNT TO ROLE identifier($revefi_role_name);
-- Required for cluster management: allows Revefi to run a serverless task
-- that acts as a safety net for your warehouse's cluster settings
GRANT EXECUTE MANAGED TASK ON ACCOUNT TO ROLE identifier($revefi_role_name);Step 2: Grant permissions on the new warehouse
Replace <your_warehouse_name> with the actual name of your warehouse.
-- Configuration
SET revefi_role_name = 'REVEFI_ROLE';
SET warehouse_name = '<your_warehouse_name>';
-- Grant monitoring and usage permissions
GRANT USAGE ON WAREHOUSE identifier($warehouse_name) TO ROLE identifier($revefi_role_name);
GRANT MONITOR ON WAREHOUSE identifier($warehouse_name) TO ROLE identifier($revefi_role_name);
-- Grant auto-management permissions
GRANT MODIFY ON WAREHOUSE identifier($warehouse_name) TO ROLE identifier($revefi_role_name);
GRANT OPERATE ON WAREHOUSE identifier($warehouse_name) TO ROLE identifier($revefi_role_name);What these permissions enable
- USAGE: Allows Revefi to view warehouse configuration parameters
- MONITOR: Enables Revefi to analyze query performance and identify bottlenecks
- MODIFY: Allows Revefi to adjust warehouse size based on recommendations
- OPERATE: Enables Revefi to start and stop the warehouse as needed
- EXECUTE MANAGED TASK: Allows the cluster management safety-net task to run on Snowflake-managed (serverless) compute
Next Steps
Once you've granted these permissions, the new warehouse will be visible in your Revefi dashboard and available for auto-management. Revefi will begin monitoring queries running on this warehouse and can execute optimization recommendations.
Updated 7 days ago
Did this page help you?
