Purpose
Forces one or more sessions to be logged off the database.
Syntax
where:
- sessnumber
- Session number, in decimal, of the session to be logged off. Leading zeros need not be specified.
- ALL
- Specification that all sessions are to be logged off.
- jobname
- Job name (in all environments), or
- TSO user identification (in z/OS only) whose sessions are to be logged off.
- taskid
- z/OS TCB address that established the sessions to be logged off.
- SUCCESS
- Specification that messages indicating success of the command are suppressed.
- WARNING
- Specification that messages indicating warnings that no sessions were affected are suppressed.
- ALL
- Specification that both success and warning messages are suppressed.
Usage Notes
When the LOGOFF command is executed, a logoff request is sent to the database for each session to be logged off. When the SES ALL operand is used, database logons are disabled when all sessions have been logged off.
Outstanding requests for sessions to be logged off are aborted, and any results are returned to the requesting application. Subsequent requests for a logged-off session are returned to an application with an error message.
To log off a session, issue the LOGOFF command from the TDP that the session is running on.
Performance Monitor ABORT SESSION Command
There is a separate performance monitor command, ABORT SESSION, that is executed from the RDBMS console. The ABORT SESSION command can log off any database session on any mainframe or LAN client. It can also log off sessions based on username only (the host id and session number are not required).
Example 1: LOGOFF
LOGOFF SES 1259
Completion Message 1
TDP0864 LOGOFF COMMAND ACCEPTED FOR SESSION 1259
Example 2: LOGOFF
LOGOFF SES ALL
Completion Message 2
TDP0860 LOGOFF INITIATED FOR number_of_sessions SESSIONS
Example 3: LOGOFF
LOGOFF JOB AWVRET
Completion Message 3
TDP0850 JOB AWVRET number_of_sessions LOGOFFS INITIATED