SHOW LOCKS

statementsupportedQueries & DML

docs.snowflake.com ↗

Lists all running transactions that have locks on resources. The command can be used to show locks for the current user in all the user’s sessions or all users in the account. For information about transactions and resource locking, see Transactions.

Syntax

supportedpartialnot supportednot scored

SHOW LOCKS [ IN ACCOUNT ]

Parameters

NameRequiredDescription
IN ACCOUNTReturns all locks across all users in the account. This parameter only applies when executed by users with the ACCOUNTADMIN role (account administrators). For all other roles, the function only shows locks across all sessions for the current user.

Usage notes

Output

The command output shows lock metadata in the following columns: Column | Description resource | A fully qualified table name or a transaction ID. type | PARTITIONS (for standard table locks) or ROW (for hybrid table locks). transaction | Transaction ID (a signed 64-bit integer). transaction_started_on | Timestamp that specifies when the transaction started executing. status | Current status of the transaction: HOLDING or WAITING. acquired_on | Timestamp that specifies when the lock was acquired. query_id | Internal/system-generated identifier for the SQL statement. session | Session ID (visible to users with the ACCOUNTADMIN role only).

See also

Referenced by