Wednesday, February 17, 2010

Logging in MQ

=> MQ log are also known as transaction logs.

=> MQ logs consists of two parts
- Data log file (named S0000000.LOG - S9999999.LOG)
- Control log file (named amqhlctl.lfh)

=>Transaction logs are created when you create the Queue Manager. When you choose the default locations, the logs will goes to
- /var/mqm/logs/Queue_Manager in unix
-c:/program files/IBM/log/Queue_Manager in windows
=> These MQ logs/ Transaction logs holds the following information
- Transaction activity known as Unit Of Work
- Persistant messages
- Internan data about queue manager objects
- Persistant channel status

=> Type of logging
MQ provides 2 type of logging options 1. Circular (default) 2. Linear

Circular Logging
- Good performance
- Esay administration
Linear logging
- Media Recovery
- Ability to archive/backup

=> Configuring Logging
Logging configuration will have direct effect on the performance of MQ. Some of the configuration parameters of logging can be changed after creating Queue Manager but some can not be changed.

Primary Logs are the initial and minimum logs.
Secondary logs can be created when the primary logs become full.

Default minimum Max (unix) Max (Win)
Primary 3 2 510 254
Secondary 2 1 509 253

=> Maximum of primary/secondary logs have a constraint of 511 on unix and 255 on windows platforms. These are the active logs

=> Log file size is a multiple of 4KB log file page size. This can not be changed after creating the Queue Manager.

=> Log file size details table
pages filesize Max
Default Win 256 1MB 256MB
Default unix 1024 4MB 2GB
Minimum Win 32 128KB 32MB
Minimum Win 64 256KB 128MB
Maximum 65535 256MB 64GB(win)/128GB(unix)

=> Log buffer size specifies number of 4KB pages MQ uses to beffer log file writes.
- Default is 128 which is specified by 0 in MQ configuration file
- Minimum is 18 and maximum is 4096

=> Log write integrity is the algorithm used to ensure the integrity of the logs.
- Default algorithm is triple write.
- This can be changed from QM configuration file

=> Logging Configuration files
- mqs.ini is the config file for MQ level settings
- qm.ini is the config file for effective/QM lelvel settings

Examples:

-mqs.init
Log Defaults:
LogPrimaryFiles=3
LogSecondaryFiles=2
LogFilePages=1024
LogType=CIRCULAR
LogBufferPages=0
LogDefaultPath=/var/mqm/logs

-qm.ini
LogPrimaryFiles=3
LogSecondaryFiles=2
LogFilePages=1024
LogType=CIRCULAR
LogBufferPages=0
LogDefaultPath=/var/mqm/logs
LogWriteIntegrity=TrippleWrite

=> Log Management
- Circular logging do not need manual log management
- Linear logging needs manual backup/cleaning

=> Some logging related MQ codes
- AMQ7467 Old log file required for queue manager start
- AMQ7468 old log file required for Queue Manager media recovery

- AMQ5037 Queue manager task ‘LOG-FORMAT’ started
- AMQ5037 Queue Manager task ‘LOGGEREU’ stared
- AMQ5037 Queue Manager task ‘LOGGER-IO’ started

=> Media Recording and Recovery
- Recording media images
rcdmqimg command will record the image of the queue manager specified.
- Recovery
is required when a powerloss/reboot/QM failure occurs
When the recovery is performed
- Queues are restored to their comitted state at the time of failure
- Persistant data is not lost
- non-persistant messages will be discarded

=> Log Recovery scenarios
- Disk Failures
In case of circular logging, restore QM and logs from backup
Rebuild QM using support pac MS03
In case of linear logging, restored damaged objects using rcrmqobj

=> Log recovery summary
- In case of circular logging, no recovery is available
- In case of linear logging, use rcrmqobj to recover/recreate the objects fron media image

No comments:

Post a Comment