What are logs
and what are they used for ?
What are transaction logs?
è
Provide the write ahead logging for
WebSphere® MQ
è
Transaction logs consist of two
components
è
Three or more files of log data
• S0000000.LOG – S9999999.LOG
Log control file
• amqhlctl.lfh
Default location of logs
UNIX: /var/mqm/log/<qmname>
Windows: C:\Program Files\IBM\WebSphere MQ\log\<qm name
MQ transaction logs contain
a)
Transaction activity(Units of Work)
and persistent messages
b)
Internal data about queue manager
objects
c) Persistent channel status
Logging parameters
·
There are several WMQ parameters
which control operation of logging
·
Logging parameters can have a
significant effect on performance characteristics
·
Some logging parameters can only be
set at queue manager creation
·
Parameters changeable after
creation require a queuemanager restart
Log type
·
Linear or circular logging must be
selected at queue manager creation time –lc option for circular
logging (default) and –ll option for linear logging
Primary log files
·
Specifies the initial, minimum
number of log files
·
Primary log files specified by the
–lp parameter of the crtmqm command
1. Default 3 ; Minimum 2 ; Maximum 510 Unix; Maximum 254 Windows
·
Can be altered after queue manager
creation
Secondary log files
·
Specifies the additional log files
which can be created should primary logs become full
·
Secondary log files specified by
the –ls parameter of the crtmqm command
1. Default 2 ; Minimum 1 ; Maximum 509 Unix ; Maximum 253 Windows
·
Can be altered after queue manager
creation
Log file size
·
Size of log file is specified as a
number of 4KB pages
·
Log file size may not be altered
after queue manager creation
·
Log file size specified by the –lf
parameter of the crtmqm command
Default logging configuration
UNIX : /var/mqm/mqs.ini
When and how are transaction logs created?
Transaction logs are created at the same time as the queue manager
crtmqm contains flags that dictate which logging configuration to
create
Flags:
• -lc , -ll , -ld , -lf , -lp , -ls .
Side-by-side comparisons
The following slides compare circular and linear logging in
action, illustrating:
1. Primary and secondary log files
2. Active log files – those required for restart recovery
3. Inactive log files – log files no longer needed for restart
recovery
Log files after initial start of queue manager:
Working within primary logs:
Expanding to secondary logs:
Linear Logging inactive files
What about log file 0 and 1 in the example?
Although not required for restart they may be required for
recovery
AMQ7467: The oldest log file required to start queue manager
MYQMGR is S0000002.LOG.
AMQ7468: The oldest log file required to perform media recovery of
queue manager MYQMGR is S0000000.LOG.
Log Management linear logging
1)
Physical file management
Space management : Moving/removing
unnecessary files
2) Recording object images : Using rcdmqimg command
Log Management Circular: No log management required by the user
Log Recovery Scenarios
1)
Power loss/Reboot/Queue Manager
Failure : Restart Queue manager
2)
Queues are restored to their
committed state at the time of the failure
3)
Persistent data is NOT lost
• Non-persistent messages will be discarded
Disk Failures :
Circular logging
• Restore queue manager and log files from latest back up
[or] Rebuild queue manager using
SupportPac MS03
Linear logging
• Recover damaged objects with rcrmqobj [ or ] Restore queue manager from latest back up
Recovery of damaged objects :
Circular: No object recovery is available
Linear: Media recovery function
rcdmqimg to record media image and rcrmqobj to
recover/recreate object from media image.
Comments