Programming-Lover
Programming-Lover

Reputation: 1265

What permissions are required to access information_schema.warehouse_load_history from snowsql?

What permissions are required to access information_schema.warehouse_load_history from snowsql? I created a role and user like the below and this shows 0 results.

create role TESTROLE;
grant imported privileges on database SNOWFLAKE to role TESTROLE;

create user TEST_USER
LOGIN_NAME = TEST_USER
password = 'Testsnowflake$1234'
default_warehouse = TEST_WH
default_role = TESTROLE
default_namespace = SNOWFLAKE.INFORMATION_SCHEMA;
grant role TESTROLE to user TEST_USER;
grant usage on WAREHOUSE TEST_WH to role TESTROLE;

Upvotes: 0

Views: 589

Answers (1)

akshindesnowflake
akshindesnowflake

Reputation: 601

Please see this link for required privileges

https://docs.snowflake.com/en/sql-reference/functions/warehouse_load_history.html#usage-notes

To get results from this function, one of the following roles or privileges are required:

The ACCOUNTADMIN role can get results from this function as it has all of the global account permissions.

A role with the MONITOR USAGE global privilege on the ACCOUNT can query this function for any warehouses in the account.

A role with the MONITOR privilege on the WAREHOUSE can query this function for the warehouse it has permissions on.

A role with the OWNERSHIP privilege on the WAREHOUSE has all permissions on the warehouse including MONITOR.

For more details, see Access Control Privileges.

When calling an Information Schema table function, the session must have an INFORMATION_SCHEMA schema in use or the function name must be fully-qualified. For more details, see Snowflake Information Schema.

Upvotes: 3

Related Questions