- Schema:
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 Name | Data Type | Description |
|---|---|---|
| SESSION_ID | Number | The unique identifier for the current session. |
| CREATED_ON | TIMESTAMP_LTZ | Date and time (in the UTC time zone) when the session was created. |
| USER_NAME | String | The user name of the user. |
| AUTHENTICATION_METHOD | String | The authentication method used to access Snowflake. |
| LOGIN_EVENT_ID | Number | The unique identifier for the login event. |
| CLIENT_APPLICATION_VERSION | String | The version number (e.g. 3.8.7) of the Snowflake-provided client application used to create the remote session to Snowflake. |
| CLIENT_APPLICATION_ID | String | The identifier for the Snowflake-provided client application used to create the remote session to Snowflake (e.g. JDBC 3.8.7) |
| CLIENT_ENVIRONMENT | String | The environment variables (e.g. operating system, OCSP mode) of the client used to create a remote session to Snowflake. |
| CLIENT_BUILD_ID | String | The 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_VERSION | String | The 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_TIME | TIMESTAMP_LTZ | Date and time when the session was last used. |
| IS_OPEN | BOOLEAN | Whether the session is currently open (TRUE) or closed (FALSE). |
| CLOSED_REASON | String | The 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¶
| Value | Description |
|---|---|
| UNKNOWN | Session closed for an unspecified or unclassified reason. |
| DROP_USER | Session closed because the user was dropped. |
| LOGOUT | Session closed because the user signed out. |
| FORCED_LOGOUT | An account administrator in your Snowflake account forced the user to log out. |
| ABANDONED | Session closed after it was left unused (for example, after a session timeout). |
| OAUTH_CRITICAL_CHANGE_INTEGRATION | Session closed after a critical change to the OAuth security integration associated with the session. |
| DROP_ACCOUNT | Session closed because the account was dropped. |
| OAUTH_CONSENT_REVOKED | Session closed because OAuth consent was revoked. |
| TASK_COMPLETED | Session closed when the task that owned the session completed. |
| SFC_FORCED_LOGOUT | A Snowflake administrator (for example, a Support engineer) forced the user to log out. |
| OAUTH_RESOURCE_NOT_AUTHORIZED | Session closed because the role in the session doesn’t have access to certain resources. |
| PAT_DELETED | Session closed because the programmatic access token (PAT) was deleted. |
| PAT_COMPROMISED | Session closed because the programmatic access token (PAT) was compromised. |
| WORKLOAD_IDENTITY_DELETED | Session closed because the workload identity (WIF authenticator) was deleted. |
| SPROC_COMPLETED | Session closed when the stored procedure that owned the session completed (for example, when using multiple sessions with native dbt). |
| WEB_SESSION_LIMIT_REACHED | Session closed because the web session limit was reached. |
| WEB_SESSION_EXPIRED | Session closed because the web session expired. |
| MAX_LIFESPAN_EXCEEDED | Session closed because the session exceeded its maximum lifespan. |
| INTEGRATION_DISABLED | Session 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).