如何在Linux中进行queuemanager备份和还原 [英] How to take queuemanager backup and restored in linux
问题描述
您好,我有名称为QM_1的队列管理器.在这里,我已经备份了QM_1,如下所示. 之后,我在其他系统中创建了具有相同名称的队列管理器(QM_1),并且需要恢复save qmgr属性.请提供如何还原queuemanager属性?
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
推荐答案
某些选项位于 SupportPac MS03 登陆页面. (MS03是包含saveqmgr
程序的SupportPac.)详细说明在下载文档中.以下说明是从SupportPac MS03页面复制的:
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:
您可以运行以下saveqmgr
命令(请参见下文)以创建2个输出文件.两个输出文件都是文本,可以对其进行编辑.
You can run the following saveqmgr
command (see below) to create 2 output files. Both output files are text and they can be edited.
- 一个带有对象定义的对象(使用选项-f)-本示例中的文件名是:qmgr_data.mqsc
- 具有权限记录的另一个(使用选项-z为setmqaut生成条目)
- 此示例中的文件名是:qmgr_auth.bat(在Windows中)或qmgr_auth.sh(在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
当尝试将内容恢复到新的队列管理器中时,可以按以下方式运行文件qmgr_data.mqsc
:
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
文件qmgr_auth.bat(在Windows中)或qmgr_auth.sh(在UNIX中)具有独立的条目,这些条目使用每个授权记录的正确参数调用setmqaut命令.该批处理/脚本文件将需要执行以恢复授权记录.
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
要查找此版本以及所有其他SupportPacs,请转到SupportPac登陆页面此处.
2014年11月6日更新:
尽管OP询问了如何从saveqmgr
备份中还原,但值得注意的是IBM提供了从7.1版开始的dmpmqcfg
命令.您可以使用以下语法以MQSC
格式备份QMgr:
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
这会在单个文件中捕获对象定义和.默认情况下,授权被捕获为SET AUTHREC
条目,而不是setmqaut
命令.
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.
请注意,dmpmqcfg
的初始版本未捕获您可能已定义的所有授权设置.所有版本都必须应用最新的修订包才能使用dmpmqcfg
获得可靠的备份.此行为在以后的修订包中可能会消失,因此建议在切换到此命令并应用修订包后,将备份与auths创建脚本进行协调.
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.
从dmpmqcfg
文件还原QMGgr,与从saveqmgr
文件还原QMGgr一样:
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
这会将MQSC
文件定义运行到QMgr中(包括SET AUTHREC
命令),并将STDOUT
和STDERR
的输出保存到日志文件中.
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.
这篇关于如何在Linux中进行queuemanager备份和还原的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!