Moving a non-shared queue - Middleware News
To move queues and their messages from one page set 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 page set, follow this procedure for each of these queues:
Ensure that the queue you want to move is not in use by any applications (that is, IPPROCS and OPPROCS values from the DISPLAY QSTATUS command are zero) and that it has no uncommitted messages (the UNCOM value from the DISPLAY QSTATUS command is NO).
Note: The only way to ensure that this state continues is to change your security settings temporarily. If you cannot do this, later stages in this procedure might fail if applications start to use the queue despite precautionary steps such as setting PUT(DISABLED). However, messages can never be lost by this procedure.
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).
Define a temporary queue with the same attributes as the queue that is being moved, using the command:
DEFINE QL(TEMP_QUEUE) LIKE(QUEUE_TO_MOVE) PUT(ENABLED) GET(ENABLED)
Note: If this temporary queue already exists from a previous run, delete it before doing the define.
Move the messages to the temporary queue using the following command:
MOVE QLOCAL(QUEUE_TO_MOVE) TOQLOCAL(TEMP_QUEUE)
Delete the queue you are moving, using the command:
DELETE QLOCAL(QUEUE_TO_MOVE)
Define a new storage class that maps to the required page set, for example:
DEFINE STGCLASS(NEW) PSID(nn)
Add the new storage class definition to the CSQINP2 data sets ready for the next queue manager restart.
Redefine the queue that you are moving, by changing the storage class attribute:
DEFINE QL(QUEUE_TO_MOVE) LIKE(TEMP_QUEUE) STGCLASS(NEW)
When the queue is redefined, it is based on the temporary queue created in step 3.
Move the messages back to the new queue, using the command:
MOVE QLOCAL(TEMP) TOQLOCAL(QUEUE_TO_MOVE)
The queue created in step 3 is no longer required. Use the following command to delete it:
DELETE QL(TEMP_QUEUE)
If the queue being moved was defined in the CSQINP2 data sets, change the STGCLASS 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 1 shows an extract from a load balancing job.
Figure 1. Extract from a load balancing job for a page set
//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 STGCLASS(NEW) PSID(2)
DEFINE QL(QUEUE_TO_MOVE) LIKE(TEMP_QUEUE) STGCLASS(NEW)
MOVE QLOCAL(TEMP_QUEUE) TOQLOCAL(QUEUE_TO_MOVE)
DELETE QL(TEMP_QUEUE)
To move queues and their messages from one page set 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 page set, follow this procedure for each of these queues:
Ensure that the queue you want to move is not in use by any applications (that is, IPPROCS and OPPROCS values from the DISPLAY QSTATUS command are zero) and that it has no uncommitted messages (the UNCOM value from the DISPLAY QSTATUS command is NO).
Note: The only way to ensure that this state continues is to change your security settings temporarily. If you cannot do this, later stages in this procedure might fail if applications start to use the queue despite precautionary steps such as setting PUT(DISABLED). However, messages can never be lost by this procedure.
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).
Define a temporary queue with the same attributes as the queue that is being moved, using the command:
DEFINE QL(TEMP_QUEUE) LIKE(QUEUE_TO_MOVE) PUT(ENABLED) GET(ENABLED)
Note: If this temporary queue already exists from a previous run, delete it before doing the define.
Move the messages to the temporary queue using the following command:
MOVE QLOCAL(QUEUE_TO_MOVE) TOQLOCAL(TEMP_QUEUE)
Delete the queue you are moving, using the command:
DELETE QLOCAL(QUEUE_TO_MOVE)
Define a new storage class that maps to the required page set, for example:
DEFINE STGCLASS(NEW) PSID(nn)
Add the new storage class definition to the CSQINP2 data sets ready for the next queue manager restart.
Redefine the queue that you are moving, by changing the storage class attribute:
DEFINE QL(QUEUE_TO_MOVE) LIKE(TEMP_QUEUE) STGCLASS(NEW)
When the queue is redefined, it is based on the temporary queue created in step 3.
Move the messages back to the new queue, using the command:
MOVE QLOCAL(TEMP) TOQLOCAL(QUEUE_TO_MOVE)
The queue created in step 3 is no longer required. Use the following command to delete it:
DELETE QL(TEMP_QUEUE)
If the queue being moved was defined in the CSQINP2 data sets, change the STGCLASS 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 1 shows an extract from a load balancing job.
Figure 1. Extract from a load balancing job for a page set
//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 STGCLASS(NEW) PSID(2)
DEFINE QL(QUEUE_TO_MOVE) LIKE(TEMP_QUEUE) STGCLASS(NEW)
MOVE QLOCAL(TEMP_QUEUE) TOQLOCAL(QUEUE_TO_MOVE)
DELETE QL(TEMP_QUEUE)
Comments
Post a Comment