Shutting down all queue managers for IBM MQ for IBM i

Use this information to understand the three types of shutdown.

The procedures are almost the same as for a single queue manager, but using *ALL instead of the queue manager name where possible, and otherwise using a command repeatedly using each queue manager name in turn. Throughout the procedures, we use a sample queue manager name of QMgr1 and a sample subsystem name of SUBX. Replace these with your own.


Planned shutdown

  1. One hour before shutdown, execute:
    RCDMQMIMG OBJ(*ALL) OBJTYPE(*ALL) MQMNAME(QMgr1) DSPJRNDTA(*YES)
    
    Repeat this for every queue manager that we want to shut down.
  2. To shut down the queue manager, execute:
    ENDMQM MQMNAME(QMgr1) OPTION(*CNTRLD)
    
    Repeat this for every queue manager that we want to shut down; separate commands can run in parallel.

    If any queue manager does not end within a reasonable time (for example 10 minutes), proceed to step 3.

  3. To shut down all queue managers immediately, execute the following:
    ENDMQM MQMNAME(*ALL) OPTION(*IMMED)
    ENDCCTJOB(*YES) TIMEOUT(15)
    


Unplanned shutdown

  1. To shut down a queue manager, execute:
    ENDMQM MQMNAME(QMgr1) OPTION(*IMMED)
    
    Repeat this for every queue manager that we want to shut down; separate commands can run in parallel.

    If queue managers do not end, the channel or applications are probably busy.

  2. For to shut down the queue managers immediately, execute the following:
    ENDMQM MQMNAME(*ALL) OPTION(*IMMED)
    ENDCCTJOB(*YES) TIMEOUT(15)
    


Shut down under abnormal conditions

  1. To shut down the queue managers, execute:
    ENDMQM MQMNAME(QMgr1) OPTION(*IMMED)
    
    Repeat this for every queue manager that we want to shut down; separate commands can run in parallel.
  2. End the subsystems ( SUBX in our examples), by executing:
    ENDSBS SUBX *IMMED
    
    Repeat this for every subsystem that we want to shut down; separate commands can run in parallel.

    If this command fails to complete, perform an IPL on the system.

    Warning: Do not use ENDJOBABN for jobs that fail to end as result of ENDJOB or ENDSBS, unless we are prepared to perform an IPL on the system immediately after.
  3. Start the subsystems by executing:
    STRSBS SUBX
    
    Repeat this for every subsystem that we want to start.
  4. Shut the queue managers down immediately, by executing:
    ENDMQM MQMNAME(*ALL) OPTION(*IMMED)
    ENDCCTJOB(*YES) TIMEOUT(15)
    
  5. Restart the queue managers by executing:
    STRMQM MQMNAME(QMgr1)
    
    Repeat this for every queue manager that we want to start.

    If any queue manager restart takes more than a few seconds IBM MQ will show status messages intermittently detailing the startup progress.

    If you still have problems restarting any queue manager, contact IBM support. Any further action you might take could damage the queue managers, leaving MQSeries or IBM MQ unable to recover.

Parent topic: Quiescing IBM MQ for IBM i