Netezza Alter User Command and Examples

  • Post author:
  • Post last modified:February 27, 2018
  • Post category:Netezza
  • Reading time:3 mins read

Once you created a user, you can change the parameters of the user at any time with Netezza ALTER USER command. You can read my other post Netezza CREATE USER command and examples.

Netezza Alter User Command Syntax

In the Netezza, username, database name and group name are unique. You cannot have same user as the group name.

Read:

Syntax for altering a user:

ALTER 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]
]
| CONCURRENT SESSIONS <limit>
| ALLOW CROSS JOIN [TRUE|FALSE|NULL]

Netezza Alter User Command Options

The alter user command takes following inputs. Below are the some of the important options associated with the Netezza alter user command:

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

Netezza Alter User Command Examples

Below are some examples on how to alter user:

TRAINING.ADMIN(ADMIN)=> ALTER USER testuser1 WITH PASSWORD 'test123' VALID UNTIL '2017-05-15'; 
ALTER USER 
TRAINING.ADMIN(ADMIN)=>

[nz@netezza ~]$ nzsql -u testuser1 -pw test123; 
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)=>

Netezza Alter User Command – RESET, RENAME

You can also use the Netezza alter user command to RESET user account and also to rename user.

ALTER USER user_name OWNER TO username 
ALTER USER user_name RESET ACCOUNT 
ALTER USER user_name RENAME TO newname