We often give the advice that MQ CF structures should be backed up regularly, by which we mean at least every hour. A recent customer problem that I dealt with showed why this is good advice.
MQ application CF structures are used to hold shared queues. As is the case with private queues, queue managers write information to their logs whenever they put or get a persistent message to a shared queue.
A backup of a CF structure can be taken by issuing the BACKUP CFSTRUCT command on one queue manager in the QSG. This writes the current contents of the structure to the log of the queue manager performing the backup.
In some situations, the contents of a CF structure can be lost. This could be due to a problem such as loss of power to the CF, or it could be that the QSG is being started at different site, such as in a DR situation.
In this case the persistent messages on the structure can be recovered by issuing the RECOVER CFSTRUCT command on any queue manager in the QSG (this can also be done automatically by MQ if RECAUTO(YES) has been set on the CFSTRUCT definition). To recover the structure the queue manager must read the logs of all the queue managers in the QSG that used the structure, going back to the last time a backup of the structure was taken. This can take a few minutes on a system with a high volume of persistent messaging, even if the CF structure was backed up recently. Queues on the structure wonâ€™t be available until the recovery has completed.
What if thereâ€™s no backup?
If the CF structure hasnâ€™t been backed up for a long time, or even never backed up, the queue manager will need to go very far back in the logs of all the queue managers in the QSG to recover the structure. If youâ€™re lucky, this will take a long time, and will almost certainly mean reading archive logs, which could be on tape. The queue manager will issue message CSQE133I periodically to show the progress of the recovery.
If youâ€™re unlucky, the archive logs needed to recover the structure will have been deleted, and there will be no way to recover the persistent messages on the structure. In this case, the only option is likely to be to issue the RECOVER CFSTRUCT TYPE(PURGE) command. This will make the structure available once again for applications to use, but all messages on the structure will have been lost.
In short, make sure you back up your CF structures regularly!
The queue manager periodically checks whether a backup has been taken of CF structures recently and issues messages CSQ040I or CSQE041E if this is not the case, so it might be worth monitoring for these messages.