Check for new replies
Thread Rating:
  • 91 Vote(s) - 2.91 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MEDIA RECOVERY IN MQ - with a demo
#1
In Websphere MQ, there are 2 types of logging which are

1. Circular logging
2. Linear logging

Circular logging supports only restart recovery. Linear logging supports restart recovery as well as Media recovery.

Media recovery re-creates objects from information recorded in a linear log files.This means if an object file is deleted, or becomes unusable or corrupted for some reason, media recovery will help in re-creating it and even recover the persistent messages in it..

Media image of the Queue manager objects are written to a log file at every checkpoint.

By default a checkpoint will be taken after
• Every 10,000 persistent MQGET and/or MQPUT operations,
Or
• Every 30 minutes, if at least 100 messages have been GET and/or PUT, whichever occurs first.

Additionally, a check point will also be taken when the ENDMQM or the RCDMQMIMG commands have been performed.

The below example demonstrates the use of media recovery.

Step 1: Create a queue manager by name QMA with linear logging.

Crtmqm –ll QMA

Step 2: Start the Queue manager

Strmqm QMA

Step 3: Invoke runmqsc and create a queue by name TEST

Runmqsc QMA
Define ql(TEST)


[Image: IWKCI1C.png]

Step 4: Use ‘RCDMQMIMG’ command to create a checkpoint and hence write the media image of ‘TEST’ queue object to the log files.

Note: We will have to restart the queue manager anyways for the corrupted queue to seen. So media image will be written to log files during stopping of the queue manager. Hence RCDMQIMG command is not required for this demo. However the below command gives an idea as to how Queue manager does a media image backup.


The below command takes media images of all the objects in queue manager.

Rcdmqimg –m QMA –t all *

[Image: oiQFv0I.png]
[Image: jmpNjr2.png]

Step 5: Corrupt the Queue object ‘TEST’.

I opened the Queue file (under C:\Program Files\IBM\WebSphere MQ\Qmgrs\QMA\queues\TEST in my case) in text editor and added some characters to corrupt it.

[Image: dJVApTt.png]

Step 6: Restart the queue manager and display the Queue ‘TEST’ to confirm that the queue is corrupted.

Endmqm QMA
Strmqm QMA
Runmqsc QMA
Dis ql(TEST)


[Image: DvvsJlo.png]

Step 7 : Perform media recovery of the queue object ‘TEST’ using ‘ RCRMQOBJ’ command

Rcrmqobj –m QMA –t q TEST

[Image: GAEfEGJ.png]

Step 7: Display the queue to confirm the queue is not corrupted now.

[Image: 02vwk5i.png]

Cheers,
Vinyas
Reply
#2
Hi Really very useful info and can u post for dead letter queue, client server architecture, and some real time scenarios thanks in advance
shoaib
Reply
#3
HI useful information

can you post SSL scenario?
Reply
#4
Very useful.... Please post on ssl senerio also.
Reply
#5
Hi everyone,

Can anyone tell me how to run MQ traces on Windows during Identification of a Problem?

Kindly reply if u know because it's a bit urgent.


Thanks & Regards,
Sreevani.
Reply

Check for new replies

Forum Jump:


Users browsing this thread: 1 Guest(s)