IBM MQ轶事-误删scratch和active日志怎么办?

  1,误删scratch下面的文件后,会造成通道不通。START CHL(XXXX)无效。绝望中你只能重新做下QM了,无奈,但是QM当中无数的对象,你能记得住吗?不行,使用ms03这个小软件,是IBM MQ小组的东东。下载地址:http://www-01.ibm.com/support/docview.wss?uid=swg24000673

   ms03这个小东东,很容易使用,more read.me.如下是我的操作步骤:

   a),解压:uncompress ms03_unix.tar.Z

                      tar -xvf ms03.tar

         b),修改权限:进入到ms03目录,执行:chmod u+x saveqmgr.linux

   c),备份队列:./saveqmgr.linux -m QM_860000 -f test.txt

    其实saveqmgr.linux --help会得到更多的帮助,其中一个参数为:

    --remoteQmgr | -r rqmgr : is the name of the remote qmgr (XMITQ name)

    表示可以备份远程的队列管理器的名称,不过要在XMITQ里取得到。

    --resetChannels | -R [flags] : create RESET CHANNEL commands

    flags can be any combination of the follow to create RESET for that channel type:

    s (SENDER) v (SERVER) r (RECEIVER) q (REQUESTER) c (CLUSSDR) d (CLUSRCVR)

    the default is to create RESET commands for all the above channel types

    可以重置通道,等等

   d)恢复:先创建一个队列:crtmqm -q QM_860000

                                             strmqm QM_860000

               runmqsc QM_860000 < test.txt

   okay,到此已经完全克隆了一份队列管理器,你可以放心使用了。通道可以runing。

  教训,导致这个问题的原因是:

  Cause

Message AMQ9586 documented MQ as trying to create object '%CHLBATCH.08' for the queue manager, but this object already existed.

  按照查找到资料解决方法是:

 for those interested, we fixed the problem by stopping the queue manager and deleting the file in the scratch directory. When we restarted the queue manager, it worked fine. 

  按照文中要求,我让delete the file in the scratch directory,也就是删除scratch下面其中有问题的一个文件,%CHLBATCH.08,结果一不小心把目录下所有文件都删除了,悲哉,只能如上做了。

  这样解决方法还有很多,

If you are using linear logging:

1. Stop the Queue Manager 

2. Restart the Queue Manager. 

3. Issue the command : rcrmqobj -t syncfile -m <Qmgrname> 

(this should rebuild the scratchpad). 

4. Delete and Recreate the Channel and its associated Xmitq.

 前提是重做文件 rcrmqobj之前,你得有先有这些 scratchpad,最保守的做法是,先备份哪个文件,然后做个重命名,然后再启动。

 哈哈,又学了一招。

 2,误删active下面的文件后,会造成在strmqm QM_860000时出错:

    MQ Log not available.

    如下是解决方法,完全恢复队列管理器

  a)cd /var/mqm/qmgrs

      b)mv QM_860000 QM_860000.OLD

      c)dltmqm QM_860000 

        删除队列管理器,操作的结果后会发现日志,错误日志和scratch下面的东东都木有了。

      d)手工删除可能存在的目录

   cd  /var/mqm/log 

          rm -rf QM_860000

       e)检查文件/var/mqm/mqs.ini

          如果有相关的QueueManager QM_860000的东东,删除其对象及其属性,共四行

       f) crtmqm -q QM_860000

       g)cd /var/mqm/qmgrs

          cp QM_860000/amqalchk.fil QM_860000.OLD

          rm QM_860000

          mv QM_860000.OLD QM_860000

          strmqm QM_860000

          runmqlsr -m QM_860000 -t TCP -p 1415 &

          strmqmcsv QM_860000

          runmqsc QM_860000

         看看吧,跟新的一样,哈哈。

猜你喜欢

转载自heweiya.iteye.com/blog/1285460