Managing page sets

Use this topic to understand how to manage the page sets associated with a queue manager.

This topic describes how to add, copy, and generally manage the page sets associated with a queue manager. It contains these sections:

See Page sets for a description of page sets, storage classes, buffers, and buffer pools, and some of the performance considerations that apply.


How to change the high-level qualifier (HLQ) for the page sets

This task gives information on how to change the HLQ for the page sets. To perform this task, do the following:
  1. Define the new HLQ page sets.
  2. If the size allocation is the same as the old page sets, copy the existing page set using REPRO to the empty new HLQ page sets. If you are increasing the size of the page sets, use the FORMAT function of CSQUTIL to format the destination page set. For more information, see Formatting page sets (FORMAT).
  3. Use the COPYPAGE function of CSQUTIL to copy all the messages from the source page set to the destination page set. For more information, see Expanding a page set (COPYPAGE).
  4. Change the CSQP00xx DD statement in the queue manager procedure to point to the new HLQ page sets.
Restart the queue manager and verify the changes to the page sets.


How to add a page set to a queue manager

This description assumes that we have a queue manager that is already running. You might need to add a page set if, for example, your queue manager has to cope with new applications using new queues.

To add a new page set, use the following procedure:
  1. Define and format the new page set. We can use the sample JCL in thlqual.SCSQPROC(CSQ4PAGE) as a basis. For more information, see Formatting page sets (FORMAT).

    Take care not to format any page sets that are in use, unless this is what you intend. If so, use the FORCE option of the FORMAT utility function.

  2. Use the DEFINE PSID command with the DSN option to associate the page set with a buffer pool.
  3. Add the appropriate storage class definitions for your page set by issuing DEFINE STGCLASS commands.
  4. Optionally, to document how your queue manager is configured:
    1. Add the new page set to the started task procedure for your queue manager.
    2. Add a definition for the new page set to your CSQINP1 initialization data set.
    3. Add a definition for the new storage class to your CSQ4INYR initialization data set member.
For details of the DEFINE PSID and DEFINE STGCLASS commands, see DEFINE PSID and DEFINE STGCLASS.


What to do when one of your page sets becomes full

We can find out about the utilization of page sets by using the IBM MQ command DISPLAY USAGE. For example, the command:
DISPLAY USAGE PSID(03)

displays the current state of the page set 03. This tells you how many free pages this page set has.

If we have defined secondary extents for your page sets, they are dynamically expanded each time they fill up. Eventually, all secondary extents are used, or no further disk space is available. If this happens, an application receives the return code MQRC_STORAGE_MEDIUM_FULL.

If an application receives a return code of MQRC_STORAGE_MEDIUM_FULL from an MQI call, this is a clear indication that there is not enough space remaining on the page set. If the problem persists or is likely to recur, you must do something to solve it.

We can approach this problem in a number of ways:


How to balance loads on page sets

Load balancing on page sets means moving the messages associated with one or more queues from one page set to another, less used, page set. Use this technique if it is not practical to expand the page set.

To identify which queues are using a page set, use the appropriate IBM MQ commands. For example, to find out which queues are mapped to page set 02, first, find out which storage classes map to page set 02, by using the command:
DISPLAY STGCLASS(*) PSID(02)
Then use the following command to find out which queues use which storage class:
DISPLAY QUEUE(*) TYPE(QLOCAL) STGCLASS

    Moving a non-shared queue
    To move queues and their messages from one page set to another, use the MQSC MOVE QLOCAL command (described in MOVE QLOCAL ). When we have identified the queue or queues to move to a new page set, follow this procedure for each of these queues:
    1. 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 we 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.
    2. Prevent applications from putting messages on the queue being moved by altering the queue definition to disable MQPUT s. 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 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.
    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. 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.

    7. 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.

    8. Move the messages back to the new queue, using the command:
      MOVE QLOCAL(TEMP) TOQLOCAL(QUEUE_TO_MOVE)
      
    9. The queue created in step 3 is no longer required. Use the following command to delete it:
      DELETE QL(TEMP_QUEUE)
      
    10. 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)
    /*
    


How to increase the size of a page set

We can initially allocate a page set larger than 4 GB, See Defining a page set to be larger than 4 GB

A page set can be defined to be automatically expanded as it becomes full by specifying EXPAND(SYSTEM) or EXPAND(USER). If your page set was defined with EXPAND(NONE), we can expand it in either of two ways:

    Defining a page set to be larger than 4 GB
    IBM MQ can use a page set up to 64 GB in size, provided the data set is defined with 'extended addressability' to VSAM. Extended addressability is an attribute which is conferred by an SMS data class. In the example shown in the following sample JCL, the management class 'EXTENDED' is defined to SMS with 'Extended addressability'. If your existing page set is not currently defined as having extended addressability, use the following method to migrate to an extended addressability format data set.
    1. Stop the queue manager.
    2. Use Access Method Services to rename the existing page set.
    3. Define a destination page set, the same size as the existing page set, but with DATACLAS(EXTENDED). Note: Extended-format data sets must be SMS managed. These are the mechanisms for requesting extended format for VSAM data sets:

      • Use a data class that has a DSNTYPE value of EXT and the subparameter R or P to indicate required or preferred.
      • Coding DSNTYPE=EXTREQ (extended format is required) or DSNTYPE=EXTPREF (extended format is preferred) on the DD statement.
      • Coding the LIKE= parameter on the DD statement to refer to an existing extended format data set.
      For more information, see Restrictions on Defining Extended-Format Data Sets.
    4. Use the COPYPAGE function of CSQUTIL to copy all the messages from the source page set to the destination page set. See Expanding a page set (COPYPAGE) for more details.
    5. Restart the queue manager.
    6. Alter the page set to use system expansion, to allow it to continue growing beyond its current allocation.
    The following JCL shows example Access Method Services commands:
    //S1    EXEC PGM=IDCAMS
    //SYSPRINT DD  SYSOUT=*
    //SYSIN   DD  *
    ALTER 'VICY.CSQ1.PAGE01' -
    NEWNAME('VICY.CSQ1.PAGE01.OLD')
    ALTER 'VICY.CSQ1.PAGE01.DATA' -
    NEWNAME('VICY.CSQ1.PAGE01.DATA.OLD')
    DEFINE CLUSTER (NAME('VICY.CSQ1.PAGE01') -
    MODEL('VICY.CSQ1.PAGE01.OLD') -
    DATACLAS(EXTENDED))
    /*
    

    Altering a page set to allow automatic expansion

    Use the ALTER PSID command with the EXPAND(USER) or EXPAND(SYSTEM) options. See ALTER PSID and Expanding a page set (COPYPAGE) for general information on expanding page sets.

    Moving messages to a new, larger page set

    This technique involves stopping and restarting the queue manager. This deletes any nonpersistent messages that are not on shared queues at restart time. If we have nonpersistent messages that you do not want to be deleted, use load balancing instead. For more details, see How to balance loads on page sets. In this description, the page set to expand is referred to as the source page set; the new, larger page set is referred to as the destination page set.

    Follow these steps:
    1. Stop the queue manager.
    2. Define the destination page set, ensuring that it is larger than the source page set, with a larger secondary extent value.
    3. Use the FORMAT function of CSQUTIL to format the destination page set. See Formatting page sets (FORMAT) for more details.
    4. Use the COPYPAGE function of CSQUTIL to copy all the messages from the source page set to the destination page set. See Expanding a page set (COPYPAGE) for more details.
    5. Restart the queue manager using the destination page set by doing one of the following:

      • Change the queue manager started task procedure to reference the destination page set.
      • Use Access Method Services to delete the source page set and then rename the destination page set, giving it the same name as that of the source page set.
    Attention:

    Before you delete any IBM MQ page set, be sure that we have made the required backup copies.


How to reduce a page set

Prevent all users, other than the IBM MQ administrator, from using the queue manager. For example; by changing the access security settings.

If we have a large page set that is mostly empty (as shown by the DISPLAY USAGE command), you might want to reduce its size. The procedure to do this involves using the COPY, FORMAT, and LOAD functions of CSQUTIL (see IBM MQ utility program ). This procedure does not work for page set zero (0), as it is not practical to reduce the size of this page set; the only way to do so is by reinitializing your queue manager (see Reinitializing a queue manager ). The prerequisite of this procedure is to try and remove all users from the system so that all UOWs are complete and the page sets are consistent.

  1. Use the STOP QMGR command with the QUIESCE or FORCE attribute to stop the queue manager.
  2. Run the SCOPY function of CSQUTIL with the PSID option, to copy all message data from the large page set and save them in a sequential data set.
  3. Define a new smaller page set data set to replace the large page set.
  4. Run the FORMAT TYPE(NEW) function of CSQUTIL against the page set that you created in step 3.
  5. Restart the queue manager using the page set created in step 3.
  6. Run the LOAD function of CSQUTIL to load back all the messages saved during step 2.
  7. Allow all users access to the queue manager.
  8. Delete the old large page set.


How to reintroduce a page set

In certain scenarios it is useful to be able to bring an old page set online again to the queue manager. Unless specific action is taken, when the old page set is brought online the queue manager will recognize that the page set recovery RBA stored in the page set itself and in the checkpoint records is old, and will therefore automatically start media recovery of the page set to bring it up to date.

Such media recovery can only be performed at queue manager restart, and is likely to take a considerable length of time, especially if archive logs held on tape must be read. However, normally in this circumstance, the page set has been offline for the intervening period and so the log contains no information pertinent to the page set recovery.

The following three choices are available:

    Allow full media recovery to be performed.
    1. Stop the queue manager.
    2. Ensure definitions are available for the page set in both the started task procedure for the queue manager and in the CSQINP1 initialization data set.
    3. Restart the queue manager.

    Allow any messages on the page set to be destroyed.
    This choice is useful where a page set has been offline for a long time (some months, for example) and it has now been decided to reuse it for a different purpose.
    1. Format the page set using the FORMAT function of CSQUTIL with the TYPE(NEW) option.
    2. Add definitions for the page set to both the started task procedure for the queue manager and the CSQINP1 initialization data set.
    3. Restart the queue manager.
    Using the TYPE(NEW) option for formatting clears the current contents of the page set and tells the queue manager to ignore any historical information in the checkpoint about the page set.

    Bring the page set online avoiding the media recovery process.
    Use this technique only if you are sure that the page set has been offline since a clean shutdown of the queue manager. This choice is most appropriate where the page set has been offline for a short period, typically due to operational issues such as a backup running while the queue manager is being started.
    1. Format the page set using the FORMAT function of CSQUTIL with the TYPE(REPLACE) option.
    2. Either add the page set back into the queue manager dynamically using the DEFINE PSID command with the DSN option or allow it to be added at a queue manager restart.
    Using the TYPE(REPLACE) option for formatting checks that the page set was cleanly closed by the queue manager, and marks it so that media recovery will not be performed. No other changes are made to the contents of the page set.