Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Even a user with the ACCOUNTADMIN role cannot view the results for a query run by another user. How can ACCOUNTADMIN can stop any sql running by any user. just want to check if this understanding is correct.

question from:https://stackoverflow.com/questions/66061852/how-to-stop-any-sql-by-accountadmin

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
855 views
Welcome To Ask or Share your Answers For Others

1 Answer

There are two functions in Snowflake that may help you:

  1. SYSTEM$CANCEL_QUERY to cancel a query by it's ID: https://docs.snowflake.com/en/sql-reference/functions/system_cancel_query.html
  2. SYSTEM$CANCEL_ALL_QUERIES to cancel all queries in a session: https://docs.snowflake.com/en/sql-reference/functions/system_cancel_all_queries.html

On top of that you can abort all queries of

  1. a warehouse by executing ALTER WAREHOUSE myWarehouse ABORT ALL QUERIES;
  2. an user by executing ALTER USER myUser ABORT ALL QUERIES;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...