A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/sql-reference/sql/create-session-policy below:

Website Navigation


CREATE SESSION POLICY | Snowflake Documentation

CREATE SESSION POLICY

Creates a new session policy or replaces an existing session policy.

A session policy defines the idle session timeout period in minutes. Administrators can optionally set different timeout values for the Snowflake web interface and other Snowflake clients.

After creating a session policy, apply the session policy to your Snowflake account using an ALTER ACCOUNT statement or a user using an ALTER USER statement.

See also:

Session Policy DDL Reference

Syntax
CREATE [OR REPLACE] SESSION POLICY [IF NOT EXISTS] <name>
  [ SESSION_IDLE_TIMEOUT_MINS = <integer> ]
  [ SESSION_UI_IDLE_TIMEOUT_MINS = <integer> ]
  [ ALLOWED_SECONDARY_ROLES = ( [ { 'ALL' | <role_name> [ , <role_name> ... ] } ] ) ]
  [ COMMENT = '<string_literal>' ]

Copy

Required parameters
name

Identifier for the session policy; must be unique for your account.

The identifier value must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g. "My object"). Identifiers enclosed in double quotes are also case-sensitive.

For more details, see Identifier requirements.

Optional parameters
SESSION_IDLE_TIMEOUT_MINS = integer

For Snowflake clients and programmatic clients, the number of minutes in which a session can be idle before users must authenticate to Snowflake again. If a value is not specified, Snowflake uses the default value.

The number of minutes can be any integer between 5 and 240, inclusive.

Default: 240 (4 hours)

SESSION_UI_IDLE_TIMEOUT_MINS = integer

For Snowsight, the number of minutes in which a session can be idle before a user must authenticate to Snowflake again. If a value is not specified, Snowflake uses the default value.

The number of minutes can be any integer between 5 and 240, inclusive.

Default: 240 (4 hours)

ALLOWED_SECONDARY_ROLES = ( [ { 'ALL' | role_name [ , role_name ... ] } ] )

Specifies the secondary roles for a session policy, if any.

The possible values for the property are:

()

Disallows secondary roles.

('ALL')

Allows all secondary roles.

( role_name [ , role_name ... ] )

Allows the specified roles as secondary roles. The secondary roles can be user-defined account roles or system roles. Specify the role name as it is stored in Snowflake. For details, see Identifier requirements.

Default: ('ALL'). If you do not set the property when you create a new session policy, all secondary roles are allowed.

COMMENT = 'string_literal'

Adds a comment or overwrites an existing comment for the session policy.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

Privilege

Object

Notes

CREATE SESSION POLICY

Schema

The USAGE privilege on the parent database and schema are required to perform operations on any object in a schema.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

For additional details on session policy DDL and privileges, see Managing session policies.

Usage notes Examples

Create a session policy for your current account:

CREATE SESSION POLICY session_policy_prod_1
  SESSION_IDLE_TIMEOUT_MINS = 30
  SESSION_UI_IDLE_TIMEOUT_MINS = 30
  COMMENT = 'session policy for use in the prod_1 environment'
;

Copy


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4