IBM Support

Stop TWS, WAS, and DB2 on the master

Question & Answer


Question

What commands should be used to stop Tivoli Workload Scheduler (TWS) processes, WebSphere (WAS), and DB2 if the system hosting the TWS master must be rebooted? What commands can be used in a shutdown script?

Cause

The workstation hosting the TWS master must be rebooted for maintenance periodically. When issuing the "db2stop" command, the following message is received: "SQL1025N The database manager was not stopped because databases are still active." message is received when issuing the "db2stop" command.

Answer

See the TWS User's Guide and Reference link for details about stopping the TWS processes:
http://www.ibm.com/support/knowledgecenter/SSGSPN_9.3.0/com.ibm.tivoli.itws.doc_9.3/distr/src_ref/awsrgstartstop.htm?cp=SSGSPN_9.3.0&lang=en

1. Use the following commands to unlink all agents in the TWS network and shut down TWS:

- as the TWS user:

conman "unlink @; noask"
conman "stop; wait"
conman "shut;wait"

NOTE: If jobs are scheduled to run on the master, make sure they have completed; otherwise some processes, such as jobmon or joblnch could still be active.

- Before stopping TWS, set the cpu limit to 0 to allow executing jobs to finish and prevent new ones from launching:

conman lc;0

- as root run "ps -u <tws_user>" to check if there are any TWS processes still active (where "tws_user" is your TWS user ID). As a Windows administrator, run the "listproc" command from the TWS_HOME\unsupported directory to check for TWS processes still active.

NOTE: Searching for processes for the tws_user may not show all running TWS processes (for example, those running as root, other users, WAS/java, jobman, etc.)

You can also use the following commands to check for running TWS processes:

ps -ef |grep <twshome> <---- prior to 8.5
ps -ef |grep <twahome> <----- post 8.5

2. Stop WebSphere Application Server (WAS) by using the stopWas.sh command from TWS_HOME/wastools directory (Unix) or TWS_Home\wastools (Windows).

- as root or Windows Administrator:

stopWas.sh -user <tws_username> -password <tws_user_password>

NOTE: Starting with TWS v8.4, the appservman process forwards the stop and start requests to WebSphere with root authority. If the command in 1. 'conman "shut;wait"' succeeds, then the appservman process is no longer running and the call to 'stopWas.sh' as root or the TWSUser will result in the following message:

%stopappserver; wait
AWSBHU624W Either the application server or appservman, or both, on workstation "YOURMDM" is already stopped.

For TWS v8.4 and above, use the -direct flag with the stopWas.sh command as follows:

stopWas.sh -direct -user <tws_username> -password <tws_user_password>

Another approach is to stop WebSphere first so that the appservman process is available. If WebSphere is stopped before appservman is stopped, then do not use the -direct flag because the result will be appservman detecting a WAS failure and an auto restart of WebSphere would be initiated.

Also, see the attached text file below for information about using the conman "stopappserver" and "startappserver" commands to stop and start eWAS.

3. Stop the DB2 database using the db2stop command.

- as the DB2 user:

db2stop

or, if a message is received that the database manager was not stopped because databases are still active, use the "force" option:

db2stop force

These commands can be used in a script to stop TWS and related processes cleanly before a scheduled reboot.

[{"Product":{"code":"SSGSPN","label":"IBM Workload Scheduler"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5;8.5.1;8.6;9.1;9.2;9.3","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Product Synonym

Maestro;TWS;IWS;TWA

Document Information

Modified date:
17 June 2018

UID

swg21299909