Schema:

ACCOUNT_USAGE

SESSIONS view

This Account Usage view provides information on the session, including information on the authentication method to Snowflake and the Snowflake login event. Snowflake returns one row for each session created over the last year.

Columns

Column NameData TypeDescription
SESSION_IDNumberThe unique identifier for the current session.
CREATED_ONTIMESTAMP_LTZDate and time (in the UTC time zone) when the session was created.
USER_NAMEStringThe user name of the user.
AUTHENTICATION_METHODStringThe authentication method used to access Snowflake.
LOGIN_EVENT_IDNumberThe unique identifier for the login event.
CLIENT_APPLICATION_VERSIONStringThe version number (e.g. 3.8.7) of the Snowflake-provided client application used to create the remote session to Snowflake.
CLIENT_APPLICATION_IDStringThe identifier for the Snowflake-provided client application used to create the remote session to Snowflake (e.g. JDBC 3.8.7)
CLIENT_ENVIRONMENTStringThe environment variables (e.g. operating system, OCSP mode) of the client used to create a remote session to Snowflake.
CLIENT_BUILD_IDStringThe build number (e.g. 41897) of the third-party client application used to create a remote session to Snowflake, if available. For example, a third-party Java application that uses the JDBC driver to connect to Snowflake.
CLIENT_VERSIONStringThe version number (e.g. 47154) of the third-party client application that uses a Snowflake-provided client to create a remote session to Snowflake, if available.
ACCESS_TIMETIMESTAMP_LTZDate and time when the session was last used.
IS_OPENBOOLEANWhether the session is currently open (TRUE) or closed (FALSE).
CLOSED_REASONStringThe reason why a Snowflake session closed. NULL for sessions that are currently open. For closed sessions, one of the values described in CLOSED_REASON values.

CLOSED_REASON values

ValueDescription
UNKNOWNSession closed for an unspecified or unclassified reason.
DROP_USERSession closed because the user was dropped.
LOGOUTSession closed because the user signed out.
FORCED_LOGOUTAn account administrator in your Snowflake account forced the user to log out.
ABANDONEDSession closed after it was left unused (for example, after a session timeout).
OAUTH_CRITICAL_CHANGE_INTEGRATIONSession closed after a critical change to the OAuth security integration associated with the session.
DROP_ACCOUNTSession closed because the account was dropped.
OAUTH_CONSENT_REVOKEDSession closed because OAuth consent was revoked.
TASK_COMPLETEDSession closed when the task that owned the session completed.
SFC_FORCED_LOGOUTA Snowflake administrator (for example, a Support engineer) forced the user to log out.
OAUTH_RESOURCE_NOT_AUTHORIZEDSession closed because the role in the session doesn’t have access to certain resources.
PAT_DELETEDSession closed because the programmatic access token (PAT) was deleted.
PAT_COMPROMISEDSession closed because the programmatic access token (PAT) was compromised.
WORKLOAD_IDENTITY_DELETEDSession closed because the workload identity (WIF authenticator) was deleted.
SPROC_COMPLETEDSession closed when the stored procedure that owned the session completed (for example, when using multiple sessions with native dbt).
WEB_SESSION_LIMIT_REACHEDSession closed because the web session limit was reached.
WEB_SESSION_EXPIREDSession closed because the web session expired.
MAX_LIFESPAN_EXCEEDEDSession closed because the session exceeded its maximum lifespan.
INTEGRATION_DISABLEDSession closed because the integration that backed the session was disabled or deleted.

FORCED_LOGOUT and SFC_FORCED_LOGOUT match the definitions in SESSIONS View (Account Usage): New Column in View.

Usage notes

  • Latency for the view may be up to 180 minutes (3 hours).
  • The view displays data starting from July 20-21, 2020.
  • The SESSIONS view does not currently track SQL API transient sessions.
  • This view does not record the activity of internal users the system defines to perform various operations (e.g. maintain Snowsight worksheets).