MQ Objects
MQ Installations
MQ Distribution Setup
MQ Triggering
MQ Failure Messages
MQ Client-Server
MQI Calls
MQ Logs
MQ Clusters
MQ Object Properties
Websphere MQ Interview Questions



Transaction Logs in WebSphere MQ

What are transaction logs? What are the types of logging mechanism we have in Websphere MQ?

Transaction logs are files where Queue Manager writes it's transaction information. These log files are not human readable. 

  WMQ has two types of logging mechanisms based on the way of log information written in the log file.

  • Circular logging
  • Linear logging


In both the above logging mechanism MQ writes information into 2 log types,

  • Primary logs
  • Secondary  logs


One may use circular logging mechanism or linear logging mechanism based on application team requirements.


What is circular logging?



  • In circular logging, log files are overwritten or reused in the circular fashion. No new files are created except for the mentioned secondary log files.
  • Circular logging provides restart recovery only. Means, whenever queue manager is restarted, log files from recovery checkpoint are re-played.
  • Circular Logging is the default logging mechanism for Queue manager in Websphere MQ.


What is linear logging?



  • In linear logging mechanism, new log files are created in the linear fashion to accommodate queue manager transaction information. 

  • As new logs files are created, linear logging always needs access monitoring for disk space management compared to circular logging. 

  • Linear logging offers both restart recovery and media recovery options.


What are the types of logs we have in WMQ?

We have 2 types of logs in MQ,  and these are available in both circular & Linear logging mechanisms.

  • Primary logs
  • Secondary logs


What are primary logs? What is the default primary log files count?

Primary logs are created by default when a new queue manager is created.

Queue manager always writes information in primary logs first, once these log files are completely occupied for restart recovery then information is written to secondary log files. 

By default 3 primary log files are available. 


What are secondary logs? what is the default number of secondary log files?

If all the active primary log files are required for queue manager's restart recovery then secondary log files will be coming into the picture. 

By default 2 secondary log files are associated with queue manager but they are not created until and unless required.


What is Min and Max number primary & secondary log files supported in MQ?

On windows, family servers, 

minimum number of log primary files are:2  and secondary log files are : 1

maximum number of log primary files are:254  and secondary log files are: 253


On Linux/UNIX flavor servers, 

minimum number of log primary files are: and secondary log files are : 1

maximum number of log primary files are:509   and secondary log files are : 510


What is checkpoint? Where on the server it is located?

A checkpoint determines the set of log files needed to perform queue manager's restart recovery.

Refer to the diagrams shown for circular & linear logging.


Checkpoints are used to make recovery more efficient, and to control the reuse of primary and secondary log files.

the name of the checkpoint file is: amqalchk.fil

the path of the checkpoint file on windows machines : "Installation directory"\IBM\WebSphere MQ\Qmgrs\QMGRName

the path of the checkpoint file on Linux machines: /var/mqm/qmgrs/QMGRName


What is MQ header log control file? what is the use of it?

The log control file contains the information needed to control the use of log files, such as their size and location, the name of the next available file, and so on.


The name of the header log control file is: amqhlctl.lfh 

The path of the header log control file on windows based machines : "Installation directory"\IBM\WebSphere MQ\log\QMGRNAME

The path of the header log control file on Linux/UNIX based machines :/var/mqm/log/QMGRNAME


How do we come to know that transaction log files are damaged or not?

  • We can figure out the log files damaged information in MQ error logs or FDC files are generated. 

  • Whenever we try to restart the queue manager it prompts to you required logs are missing.


Assume a queue manager suddenly down, If transaction logs are damaged can we start the queue manager?

No, we can not start the Queue manager. 

We either need to restore old backed up log files information. Or else, need to do cold restart. 


What is the cold restart? or How to do a cold restart of a queue manager?

Cold restart is used when a queue manager transactional log files are damaged. Its process is explained below, 

Assume we had a queue manager DQM102, whose transaction log files are damaged.


  • Referring to DQM102 queue manager's qm.ini we will create a dummy queue manager (name could be any). Such as, type of logging mechanism & number of primary - secondary log files and sizes etc
  • Once the new queue manager is created, copy the below files from new queue manager to old queue manager(DQM102) location.

Queue manager check point file ( amqalchk.fil)

Queue manager header log file ( amqhlctl.lfh)

Queue manager transaction logs ( /var/mqm/log/qmgrName/active)

  • Now if we re-start the DQM102 queue manager, it will be coming into running state. 

How do we read transaction logs?

As a human being, we can not read the transnational logs. Those are encrypted or non-human readable format.

We can use "dmpmqlog" command to understand transaction log files information. 


What is log files size? how can we increase the log files size?



From MQ V7 onwards, default log file size is 16MB. let's understand this in detail,

A transaction log file ---> is the collection of log file pages. Each log file page size is 4kB which fixed. 


Now for 16MB log file ----> 4KB * 4096 no of log file pages

-----> 16384 KB

-----> 16MB


Can we change the number of primary and secondary log files after queue manager creation?

Yes, we can change the log primary and secondary files after queue manager creation. We have to edit "qm.ini" file and restart the queue manager.



Any changes made to qm.ini file, it is suggested to restart or bounce the queue manager.

Sometimes, the result is not immediately reflective but queue manager will extend new log files when needed. 


Can we change a queue manager from circular logging to linear logging?

No, we can not change the circular logging to linear logging from qm.ini file. 

To do it, 

  • We need to take the backup of queue manager objects and permission etc.

  • Then, delete the existing queue manager and create a new queue manager with linear logging.

  • Restore the MQ objects and permission information in new linear logging queue manager.


What will happen if mqs.ini is deleted?

If mqs.ini file is deleted and if we try to issue dspmq command, it will not show any results. But Queue managers will be running fine.


What will happen if qm.ini file is deleted?

We can not work with Queue manager.


Topics Summary