Use the nzsession command to view and manage sessions.
The nzsession command uses the following syntax:
nzsession subcmd [subcmd options]
Input | Description |
---|---|
nzsession abort options | Abort a running user session. |
nzsession abortTxn options | Abort a user transaction. |
nzsession listSessionTypes | Lists the session types, which include the following types:
|
nzsession priority options | Changes priority of the current and all subsequent jobs of this session. |
nzsession show options | Displays the list of current user sessions. |
Command | Option | Description |
---|---|---|
All nzsession commands | -u user | Specifies the database user name [NZ_USER]. |
-pw password | Specifies the user password [NZ_PASSWORD]. | |
-host name | Specifies host name or IP address [NZ_HOST]. Except listSessionTypes. | |
-caCertFile path | Specifies the path name of the root CA certificate file on the client system. This argument is used by IBM® Netezza® clients who use peer authentication to verify the Netezza host system. The default value is NULL, which skips the peer authentication process. | |
-securityLevel level | Specifies the security level that you want to use for the session.
The argument has four values:
|
|
-timeout secs | Specifies the time to wait in seconds for the command to complete. The default is 300. | |
nzsession abort, and abortTxn | -id num | Specifies the session ID. |
-force | Does not prompt for confirmation. | |
nzsession priority | -id num | Specifies the session ID. |
-high | Changes the session priority to high. | |
-normal | Changes the session priority to normal. | |
-low | Changes the session priority to low. | |
-critical | Changes the session priority to critical. | |
nzsession show | -activeTxn | Displays the active transactions for the system. |
-maxColW chars | Specifies the maximum number of characters to print in a column. The default is 24. |
When you run the nzsession abort command, the client manager uses the session ID to abort the process.
You can also abort active or idle nzsql sessions.
Column | Description |
---|---|
ID | The ID of the session. |
Type | The type of session, which can be one of the following:
|
User | The name of the session owner. |
Start Time | The time the session was started. |
PID | The process identification number of the command you are running. |
Database | The name of the database. |
Schema | The name of the schema. |
State | The state of the session, which can be one of the following:
|
Priority Name | The priority of the session, which can be one of the following:
|
Client IP | The IP address of the client system. |
Client PID | The process identification number of the client system. |
Command | The last command executed. |
nzsession show -u bob -pw password
ID Type User Start Time PID Database Schema State Priority
Client IP Client Command
Name
PID
----- ---- ----- ----------------------- ----- --------- ------ ------ --------
--------- ------ ------------------------
16049 sql ***** 24-Feb-13, 16:49:18 EST 14840 ***** ADMIN active normal
***** ***** *****
16054 sql bob 24-Feb-13, 16:49:31 EST 15093 SYSTEM ADMIN active normal
127.0.0.1 15092 SELECT session_id, clien
nzsession show -u sysadm -pw password
ID Type User Start Time PID Database Schema State Priority
Client IP Client Command
Name
PID
----- ---- ----- ----------------------- ----- --------- ------ ------ --------
--------- ------ ------------------------
16049 sql DBUSR 24-Feb-13, 16:49:18 EST 14840 TPCH1 ADMIN active normal
127.0.0.1 14839 select * from lineitem
16054 sql bob 24-Feb-13, 16:49:31 EST 15093 SYSTEM ADMIN active normal
127.0.0.1 15092 SELECT session_id, clien
nzsession abort -u user -pw password -host nzhost -id 1344
nzsession abortTxn -u user -pw password -host nzhost -id 437
nzsession listSessionTypes
nzsession priority -u user -pw password -host nzhost -id 437 -high
nzsession show -activeTxn
You can use the -activeTxn option to display the active sessions that will be impacted by a state change (such as pausing -now) before you initiate the state change.