My websphere MQ install directory on windows machine is C:\IBMWMQ\WebSphereMQ\
1. Started MQ explorer through command prompt using "runmqcfg"
2. Created a Queue manager QM.ROH -> crtmqm -q -d QM.ROH.Q.TRANQ -u QM.ROH.Q.DLQ QM.ROH with logging option "LINEAR LOGGING"
3. Created a local queue under the QM.ROH -> QM.RECD.REC
Set the message persistence on the queue so that messages are not lost at the restart of the queue manager.
4. Started putting the messages in QM.Q.RECD.REC -> amqsput QM.Q.RECD.REC QM.ROH
5. Deleted the "Q" file under C:\IBMWMQ\WebSphereMQ\data\Qmgrs\QM!ROH\queues\QM!ROH!QM!Q!RECD!REC\Q to verify the record and recreate commands provided in MQ V6
6. Stopped and restarted the Queue Manager QM.ROH using
endmqm QM.ROH
strmqm QM.ROH
C:\IBMWMQ\WebSphereMQ\bin>strmqm QM.ROH
WebSphere MQ queue manager 'QM.ROH' starting.
11 log records accessed on queue manager 'QM.ROH' during the log replay phase.
Log replay for queue manager 'QM.ROH' complete.
Transaction manager state recovered for queue manager 'QM.ROH'.
WebSphere MQ queue manager 'QM.ROH' started.
7. After having deleted the Q file for queue QM.ROH.Q.LOCALQ, when we try to view the messages in the queue QM.Q.RECD.REC,
- MQ explorer throws the error message "Object damaged. AMQ4038"
- When we do it through command line, the following error is displayed. C:\IBMWMQ\WebSphereMQ\bin>amqsbcg QM.Q.RECD.REC
AMQSBCG0 - starts here ********************** MQOPEN - 'QM.Q.RECD.REC' MQOPEN failed with CompCode:2, Reason:2101 MQDISC
8. To display the reason code in understandable format, use "mqrc" command
C:\IBMWMQ\WebSphereMQ\bin>mqrc 2101 2101 0x00000835 MQRC_OBJECT_DAMAGED
You can see that the queue manager error log(AMQERR01.log) contains the following information.
-------------------------------------------------------------------------------
4/12/2010 10:54:55 - Process(2272.1) User(skamani) Program(amqzxma0.exe)
AMQ7472: Object QM.Q.RECD.REC, type queue damaged.
EXPLANATION:
Object QM.Q.RECD.REC, type queue has been marked as damaged. This indicates
that the queue manager was either unable to access the object in the file
system, or that some kind of inconsistency with the data in the object was
detected.
ACTION:
If a damaged object is detected, the action performed depends on whether the
queue manager supports media recovery and when the damage was detected. If the
queue manager does not support media recovery, you must delete the object as no
recovery is possible. If the queue manager does support media recovery and the
damage is detected during the processing performed when the queue manager is
being started, the queue manager will automatically initiate media recovery of
the object. If the queue manager supports media recovery and the damage is
detected once the queue manager has started, it may be recovered from a media
image using the rcrmqobj command or it may be deleted.
----- amqaocua.c : 549 --------------------------------------------------------
9. Inorder to retrieve or create the object from the logs, we should first be recording the image through the "rcdmqimg" command and then use the "rcrmqobj" command to recreate the object as follows8. To display the reason code in understandable format, use "mqrc" command
C:\IBMWMQ\WebSphereMQ\bin>mqrc 2101 2101 0x00000835 MQRC_OBJECT_DAMAGED
You can see that the queue manager error log(AMQERR01.log) contains the following information.
-------------------------------------------------------------------------------
4/12/2010 10:54:55 - Process(2272.1) User(skamani) Program(amqzxma0.exe)
AMQ7472: Object QM.Q.RECD.REC, type queue damaged.
EXPLANATION:
Object QM.Q.RECD.REC, type queue has been marked as damaged. This indicates
that the queue manager was either unable to access the object in the file
system, or that some kind of inconsistency with the data in the object was
detected.
ACTION:
If a damaged object is detected, the action performed depends on whether the
queue manager supports media recovery and when the damage was detected. If the
queue manager does not support media recovery, you must delete the object as no
recovery is possible. If the queue manager does support media recovery and the
damage is detected during the processing performed when the queue manager is
being started, the queue manager will automatically initiate media recovery of
the object. If the queue manager supports media recovery and the damage is
detected once the queue manager has started, it may be recovered from a media
image using the rcrmqobj command or it may be deleted.
----- amqaocua.c : 549 --------------------------------------------------------
9a) rcdmqimg -> Record an object in the log
record image for Queue manager-> rcdmqimg -m QM.ROH -l -t qmgr *
record image for Queue under the queue manager QM.ROH
C:\IBMWMQ\WebSphereMQ\bin>rcdmqimg -m QM.ROH -z -l -t queue QM.Q.RECD.REC
When you execute this command, you can find the following entry in the respective Queue Manager error log at C:\IBMWMQ\WebSphereMQ\data\Qmgrs\QM!ROH\errors\AMQERR01.log
-------------------------------------------------------------------------------
4/12/2010 10:54:54 - Process(2272.1) User(skamani) Program(amqzxma0.exe)
AMQ7467: The oldest log file required to start queue manager QM.ROH is
S0000001.LOG.
EXPLANATION:
The log file S0000001.LOG contains the oldest log record required to restart
the queue manager. Log records older than this may be required for media
recovery.
ACTION:
You can move log files older than S0000001.LOG to an archive medium to release
space in the log directory. If you move any of the log files required to
recreate objects from their media images, you will have to restore them to
recreate the objects. An older log file is one with a numerically smaller log
number (but allowing for log number wrapping at 9999999).
-------------------------------------------------------------------------------
Media image for object QM.ROH, type qmgr recorded.
AMQ7467: The oldest log file required to start queue manager QM.ROH is S0000000.
LOG.
AMQ7468: The oldest log file required to perform media recovery of queue manager
QM.ROH is S0000000.LOG.
Record image for Queue -> rcdmqimg -m QM.ROH -l -t queue QM.ROH.Q.LOCALQ
Note: Object will be recorded to the log file and no file would be generated.
9b) rcrmqobj -> recreate an object or group of objects from their images
Recreate local queue QM.Q.RECD.REC under the qmgr QM.ROH
C:\IBMWMQ\WebSphereMQ\bin>rcrmqobj -m QM.ROH -z -t queue QM.Q.RECD.REC
Object QM.Q.RECD.REC, type queue recreated.
The Q file for the Local queue QM.Q.RECD.REC was recreated and could browse through the messages in the queue through MQ Explorer or through the amqsbcg command.
other examples:
Recreate local queues under the default queue manager
rcrmqobj -t ql *
No comments:
Post a Comment