How to take queuemanager backup and restored in li

2019-07-08 19:47发布

问题:

Hello I have queue manager with name QM_1. Here I have taken backup of QM_1 like following. after that I created queue manager(QM_1) with same name in other system and I need to restore the save qmgr properties. Pls provide how to restore the queuemanager properties?

saveqmgr -m QM_1 -f 

回答1:

Some of the options are are on the SupportPac MS03 landing page. (MS03 is the SupportPac that contains the saveqmgr program.) Detailed instructions are in the download documentation. The following instructions are copied from the SupportPac MS03 page:


You can run the following saveqmgr command (see below) to create 2 output files. Both output files are text and they can be edited.

  • one with the object definitions (using option -f) - the file name in this example is: qmgr_data.mqsc
  • the other with the authority records (using option -z which generates entries for setmqaut)
  • the file name in this example is: qmgr_auth.bat (in Windows) or qmgr_auth.sh (in UNIX)

The following command saves both the objects and the authority records:

UNIX:

saveqmgr -m QMGR -f /tmp/mq/qmgr_data.mqsc -z /tmp/mq/qmgr_auth.sh

Windows:

saveqmgr.exe -m QMGR -f C:\temp\mq\qmgr_data.mqsc -z C:\temp\mq\qmgr_auth.bat

The file qmgr_data.mqsc can be run as follows when trying to restore the contents into a new queue manager:

runmqsc TEST < qmgr_data.mqsc

The file qmgr_auth.bat (in Windows) or qmgr_auth.sh (in UNIX) has stand-alone entries that invoke the setmqaut command with the proper parameter for each authority record. This batch/script file will need to be executed in order to restore the authority records.

UNIX:

chmod u+x qmgr_auth.sh
./qmgr_auth.sh

Windows:

qmgr_auth.bat

To find this and all the other SupportPacs, go to the SupportPac landing page here.

Update 6 November 2014:
Although OP asked how to restore from a saveqmgr backup, it is worth noting that IBM has provided the dmpmqcfg command beginning with version 7.1. You can back up the QMgr in MQSC format using this syntax:

dmpmqcfg -m [QUEUE_MANAGER] > BACKUP_FILE.mqsc

This captures the object deinifions and the authorizations in a single file. The authorizations are captured as SET AUTHREC entries rather than as setmqaut commands by default.

Please note that the initial versions of dmpmqcfg did not capture all of the authorization settings that you might have defined. It is necessary for all versions to apply the latest Fix Pack to get a reliable backup using dmpmqcfg. This behavior may regress in later Fix Packs so it is advisable to reconcile your backup against your auths creation script when switching to this command and after applying a Fix Pack.

Restore a QMGgr from the dmpmqcfg file the same as you would from the saveqmgr file:

runmqsc [QMNAME] < output_of_dmpmqcfg_or_saveqmgr.mqsc > logfile.txt 2>&1

This runs the MQSC file definitions into the QMgr (including SET AUTHREC commands) and saves the output of STDOUT and STDERR to a log file.



标签: ibm-mq