Use the Netezza CREATE USER command to define a new database user account. You can specify the parameters like password, expire date, default priority etc to the user while creating an account.
Netezza Create User Command Syntax
In the Netezza, username, database name and group name are unique. You cannot have same user as the group name.
Syntax for creating a user:
CREATE USER username [WITH [PASSWORD {'string' | NULL }] [SYSID uid] [ROWSETLIMIT [integer ] [IN GROUP groupname [, ...] ] [VALID UNTIL 'date' ] [SESSIONTIMEOUT [integer ] [QUERYTIMEOUT [integer ] [DEFPRIORITY [critical|high|normal|low|none]] [MAXPRIORITY [critical|high|normal|low|none]] [IN RESOURCEGROUP resourcegroupname] [EXPIRE PASSWORD] [AUTH [LOCAL | DEFAULT]] [EXPIRE PASSWORD] ] | CONCURRENT SESSIONS <limit> | ALLOW CROSS JOIN [TRUE|FALSE|NULL]
Netezza Create User Command Options
The create user command takes following inputs. Below are the some of the important options associated with the Netezza create user command:
- Netezza CREATE TABLE command and Examples
- Netezza Alter User Command and Examples
- How to Resolve Netezza too many Concurrent Sessions issue?
Option | Description |
username | Specifies the name of the user you are creating |
string | Specifies a password for this user account |
NULL | You can specify WITH PASSWORD NULL to explicitly create a user
with a null password |
date | Specifies the date when this user’s
account expires |
SESSIONTIMEOUT | Specifies the amount of time a session can be idle before the system terminates it. The value zero is unlimited |
QUERYTIMEOUT | Specifies the amount of time a query can run before the system
sends the administrator a message. |
DEFPRIORITY | Specifies the default priority for the user. critical, high, normal, low |
IN RESOURCEGROUP | Specifies the resource group into which to add a user |
IN GROUP | Specifies the group into which to insert the user as a new member. e.g Developer, Administrator etc |
CONCURRENT SESSIONS <limit> | Sets the maximum number of concurrent sessions this group can have |
EXPIRE
PASSWORD |
Creates a user with an expired/invalidated password. The first time
the user logs in, they must change their password. |
Netezza Create User Command Examples
Below are some examples on how to create user:
TRAINING.ADMIN(ADMIN)=> CREATE USER testuser1 TRAINING.ADMIN(ADMIN)-> WITH PASSWORD 'testuser1' EXPIRE PASSWORD; CREATE USER [nz@netezza ~]$ nzsql -u testuser1 -pw testuser1 ERROR: Restricted Session. User password has expired. Use 'ALTER USER' command to change it. NOTICE: Restricted Session. User password has expired. Use 'ALTER USER' command to change it. Welcome to nzsql, the IBM Netezza SQL interactive terminal. Type: \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit SYSTEM.ADMIN(TESTUSER1)=>