moving a shared queue, queues, shared queue, moving queues, moving a queue, queue-sharing groups, shared queues, moving a queue to another, CF structure, moving a queue to another structure, Coupling Facility (CF), DEFINE QLOCAL, WebSphere MQ commands, MOVE QLOCAL, DELETE QLOCAL, sample job for a CF structure, moving non-shared to shared, moving to non-shared" /> Moving shared queues

 

Moving shared queues

This section describes how to perform load balancing by moving a shared queue from one Coupling Facility structure to another. It also describes how to move a non-shared queue to a shared queue, and how to move a shared queue to a non-shared queue.

When you move a queue, we need to define a temporary queue as part of the procedure. This is because every queue must have a unique name, so you cannot have two queues of the same name, even if the queues have different queue dispositions. WebSphere MQ tolerates having two queues with the same name (as in step 2), but we cannot use the queues.

 

Moving a queue from one Coupling Facility structure to another

To move queues and their messages from one CF structure to another, use the MQSC MOVE QLOCAL command (described in WebSphere MQ Script (MQSC) Command Reference). When you have identified the queue or queues that you want to move to a new CF structure, use the following procedure to move each queue:

  1. Ensure that the queue you want to move is not in use by any applications, that is, the queue attributes IPPROCS and OPPROCS are zero on all queue managers in the queue-sharing group.

  2. Prevent applications from putting messages on the queue being moved by altering the queue definition to disable MQPUTs. Change the queue definition to PUT(DISABLED).

  3. Define a temporary queue with the same attributes as the queue that is being moved using the following command:

    DEFINE QL(TEMP_QUEUE) LIKE(QUEUE_TO_MOVE) PUT(ENABLED) GET(ENABLED) QSGDISP(QMGR)
    Note:
    If this temporary queue already exists from a previous run, delete it before doing the define.

  4. Move the messages to the temporary queue using the following command:

    MOVE QLOCAL(QUEUE_TO_MOVE) TOQLOCAL(TEMP_QUEUE) 

  5. Delete the queue you are moving, using the command:

    DELETE QLOCAL(QUEUE_TO_MOVE)

  6. Redefine the queue that is being moved, changing the CFSTRUCT attribute, using the following command:

    DEFINE QL(QUEUE_TO_MOVE) LIKE(TEMP_QUEUE) CFSTRUCT(NEW) QSGDISP(SHARED)

    When the queue is redefined, it is based on the temporary queue created in step 3.

  7. Move the messages back to the new queue using the command:

    MOVE QLOCAL(TEMP) TOQLOCAL(QUEUE_TO_MOVE) 

  8. The queue created in step 3 is no longer required. Use the following command to delete it:

    DELETE QL(TEMP_QUEUE)

  9. If the queue being moved was defined in the CSQINP2 data sets, change the CFSTRUCT attribute of the appropriate DEFINE QLOCAL command in the CSQINP2 data sets. Add the REPLACE keyword so that the existing queue definition is replaced.

Figure 42 shows a sample job for moving a queue from one CF structure to another.

Figure 42. Sample job for moving a queue from one CF structure to another

//UTILITY  EXEC  PGM=CSQUTIL,PARM=('CSQ1')
//STEPLIB  DD    DSN=thlqual.SCSQANLE,DISP=SHR
//         DD    DSN=thlqual.SCSQAUTH,DISP=SHR
//SYSPRINT DD    SYSOUT=*
//SYSIN    DD    *
COMMAND DDNAME(MOVEQ)
/*
//MOVEQ  DD    *
ALTER QL(QUEUE_TO_MOVE) PUT(DISABLED)
DELETE QL(TEMP_QUEUE) PURGE
DEFINE QL(TEMP_QUEUE) LIKE(QUEUE_TO_MOVE) PUT(ENABLED) GET(ENABLED) QSGDISP(QMGR)
MOVE QLOCAL(QUEUE_TO_MOVE) TOQLOCAL(TEMP_QUEUE)
DELETE QL(QUEUE_TO_MOVE)
DEFINE QL(QUEUE_TO_MOVE) LIKE(TEMP_QUEUE) CFSTRUCT(NEW) QSGDISP(SHARED)
MOVE QLOCAL(TEMP_QUEUE) TOQLOCAL(QUEUE_TO_MOVE)
DELETE QL(TEMP_QUEUE)
/*

 

Moving a non-shared queue to a shared queue

The procedure for moving a non-shared queue to a shared queue is very similar to the procedure for moving a queue from one CF structure to another (see Moving a queue from one Coupling Facility structure to another). Figure 43 gives a sample job to do this.

Note:
Remember that messages on shared queues are subject to certain restrictions on the maximum message size, message persistence, and queue index type, so you might not be able to move some non-shared queues to a shared queue.
Figure 43. Sample job for moving a non-shared queue to a shared queue

//UTILITY  EXEC  PGM=CSQUTIL,PARM=('CSQ1')
//STEPLIB  DD    DSN=thlqual.SCSQANLE,DISP=SHR
//         DD    DSN=thlqual.SCSQAUTH,DISP=SHR
//SYSPRINT DD    SYSOUT=*
//SYSIN    DD    *
COMMAND DDNAME(MOVEQ)
/*
//MOVEQ  DD    *
ALTER QL(QUEUE_TO_MOVE) PUT(DISABLED)
DELETE QL(TEMP_QUEUE) PURGE
DEFINE QL(TEMP_QUEUE) LIKE(QUEUE_TO_MOVE) PUT(ENABLED) GET(ENABLED)
MOVE QLOCAL(QUEUE_TO_MOVE) TOQLOCAL(TEMP_QUEUE)
DELETE QL(QUEUE_TO_MOVE)
DEFINE QL(QUEUE_TO_MOVE) LIKE(TEMP_QUEUE) CFSTRUCT(NEW) QSGDISP(SHARED)
MOVE QLOCAL(TEMP_QUEUE) TOQLOCAL(QUEUE_TO_MOVE)
DELETE QL(TEMP_QUEUE)
/*

 

Moving a shared queue to a non-shared queue

The procedure for moving a shared queue to a non-shared queue is very similar to the procedure for moving a queue from one CF structure to another (see Moving a queue from one Coupling Facility structure to another). Figure 44 gives a sample job to do this.

Figure 44. Sample job for moving a shared queue to a non-shared queue

//UTILITY  EXEC  PGM=CSQUTIL,PARM=('CSQ1')
//STEPLIB  DD    DSN=thlqual.SCSQANLE,DISP=SHR
//         DD    DSN=thlqual.SCSQAUTH,DISP=SHR
//SYSPRINT DD    SYSOUT=*
//SYSIN    DD    *
COMMAND DDNAME(MOVEQ)
/*
//MOVEQ  DD    *
ALTER QL(QUEUE_TO_MOVE) PUT(DISABLED)
DELETE QL(TEMP_QUEUE) PURGE
DEFINE QL(TEMP_QUEUE) LIKE(QUEUE_TO_MOVE) PUT(ENABLED) GET(ENABLED) QSGDISP(QMGR)
MOVE QLOCAL(QUEUE_TO_MOVE) TOQLOCAL(TEMP_QUEUE)
DELETE QL(QUEUE_TO_MOVE)
DEFINE QL(QUEUE_TO_MOVE) LIKE(TEMP_QUEUE) STGCLASS(NEW) QSGDISP(QMGR)
MOVE QLOCAL(TEMP_QUEUE) TOQLOCAL(QUEUE_TO_MOVE)
DELETE QL(TEMP_QUEUE)
/*