Session timeout syntax

You can configure session timeouts at the user, group, or system level. The timeout is specified in minutes, or can be set to UNLIMITED or NONE to disable automatic disconnection.

Changes to the session timeout for the public group do not affect the admin user's settings.

  • To create a user with a session timeout, use the following syntax:
    CREATE USER username WITH SESSIONTIMEOUT [number | UNLIMITED]
  • To create a group with a session timeout, use the following syntax:
    CREATE GROUP name WITH SESSIONTIMEOUT [number | UNLIMITED]
  • To modify a user's session timeout, use the following syntax:
    ALTER USER username WITH SESSIONTIMEOUT [number | UNLIMITED]
  • To modify a group's session timeout, use the following syntax:
    ALTER GROUP name WITH SESSIONTIMEOUT [number | UNLIMITED]
  • To set session timeout to NONE for all users (desired):
    ALTER USER ALL WITH SESSIONTIMEOUT NONE
  • To set session timeout to NONE for all groups (desired):
    ALTER GROUP ALL WITH SESSIONTIMEOUT NONE
Note: After changing the system default or session timeout settings, restart Netezza using:
nzstop
nzstart

System default session timeout

The SYSTEM DEFAULT SESSIONTIMEOUT setting is intended to disconnect idle sessions after a specified period (e.g., 30 minutes). However, this default can be overridden by user or group-level settings.

Note:
  1. If a user or group has a specific SESSIONTIMEOUT set (e.g., UNLIMITED), it overrides the system default.
  2. This means sessions will not disconnect after the system-defined timeout if the user/group setting is UNLIMITED.
Syntax:
SYSTEM.ADMIN(ADMIN)=> SHOW SYSTEM DEFAULT sessiontimeout;
NOTICE:  'session timeout' = '0'
SHOW VARIABLE
Example:
SYSTEM.ADMIN(ADMIN)=> set SYSTEM DEFAULT sessiontimeout to 30;
SET VARIABLE