Question & Answer
Question
How do I generate a WebSphere MQ trace on HP NonStop Server systems in order to investigate a problem?
Cause
Traces can capture the root cause of many MQ problems. It is important to limit how long tracing is active in order to avoid affecting performance or generating excessively large trace files and filling up your disk. For other MQ traces and for WebSphere MQ client trace on HP Integrity NonStop Server refer to:
Make sure the Queue Manager subvolume (the $MQNSKVARPATH/trace directory on OSS) is on a volume with plenty of available space. Otherwise, you risk an outage if WebSphere MQ trace fills the volume which your queue managers are using. In addition, a partial trace may not contain the information IBM Support needs to solve the problem.
Answer
Generating Traces
- Start tracing with the strmqtrc command. The parameters passed to strmqtrc control which processes will generate trace files and what kinds of data they will trace. The strmqtrc command only starts trace for processes running on the same CPU as your OSS shell or TACL session, so be sure to use the run command to start trace on a specific CPU number. The examples below show TACL and OSS syntax:
Starting a default detail trace of queue manager QMA running on CPU 1
TACL> run /CPU 1/ strmqtrc -m QMA
  or
oss> run -cpu=1 strmqtrc -m QMA
Starting an API trace of queue manager QMB running on CPU 2
TACL> run /CPU 2/ strmqtrc -m QMB -t api
  or
oss> run -cpu=2 strmqtrc -m QMB -t api
Starting a high detail trace of everything on CPU 3
TACL> run /CPU 3/ strmqtrc -e -t all -t detail
  or
oss> run -cpu=3 strmqtrc -e -t all -t detail
- Reproduce the problem while tracing is active, making every attempt to keep the trace as short as possible.
- As soon as the problem has occurred, stop tracing immediately! If you wait to stop the trace, the data IBM Support needs may be lost or overwritten. For example:
Stopping all trace on CPU 3
TACL> run /CPU 3/ endmqtrc -a
  or
oss> run -cpu=3 endmqtrc -a
Stopping a trace of queue manager QMA on CPU 1
TACL> run /CPU 1/ endmqtrc -m QMA
  or
oss> run -cpu=1 endmqtrc -m QMA
- The trace files generated by WebSphere MQ are binary, and must be formatted before they can be read. The binary trace files are named like AMQ*.TRC. In TACL each file in the WebSphere MQ trace directory must be formatted individually, while OSS supports formatting all the files at once:
Formatting WebSphere MQ trace files
TACL> dspmqtrc -o "/path/to/var/mqm/trace/AMQxxxxx.0.FMT" "/path/to/var/mqm/trace/AMQxxxxx.0.TRC"
TACL> ...
  or
oss> cd "$MQNSKVARPATH/trace"
oss> dspmqtrc AMQ*.TRC
- Save a copy of the binary trace files as long as you are working with IBM support, but do not send both binary and formatted traces to IBM. Delete the binary trace files before sending your trace files to IBM.
Deleting WebSphere MQ binary trace files
oss> cd "$MQNSKVARPATH/trace"
oss> rm -f AMQ*.TRC
- IBM provides the Service Data Collection and Packagaing (sdcp) tool to simplify the task of collecting files from HP NonStop Server systems to send to IBM. If the traces are very large, you may need to use the "-w" option to choose an OSS directory with plenty of free space in which to package your files. If you do not have sdcp, you can tar and compress the files before sending them to IBM:
Using sdcp to collect WebSphere MQ traces and other data
oss> sdcp -p 12345,67R,890 -m QMA -w /var/bigdata
Packaging trace files manually
oss> cd "$MQNSKVARPATH/trace"
oss> tar -cvf PMR12356,67R,890-mqtrace.tar AMQ*.FMT
oss> compress PMR12356,67R,890-mqtrace.tar
- After sending the formatted traces, clean up the trace directory to reclaim space and also to make sure you are ready to generate new traces in future, if necessary. For example:
Cleaning up the trace directory
oss> cd "$MQNSKVARPATH/trace"
oss> rm -f AMQ*.FMT
Starting a default detail trace of queue manager QMA running on CPU 1
TACL> run /CPU 1/ strmqtrc -m QMA
  or
oss> run -cpu=1 strmqtrc -m QMA
Starting an API trace of queue manager QMB running on CPU 2
TACL> run /CPU 2/ strmqtrc -m QMB -t api
  or
oss> run -cpu=2 strmqtrc -m QMB -t api
Starting a high detail trace of everything on CPU 3
TACL> run /CPU 3/ strmqtrc -e -t all -t detail
  or
oss> run -cpu=3 strmqtrc -e -t all -t detail
Stopping all trace on CPU 3
TACL> run /CPU 3/ endmqtrc -a
  or
oss> run -cpu=3 endmqtrc -a
Stopping a trace of queue manager QMA on CPU 1
TACL> run /CPU 1/ endmqtrc -m QMA
  or
oss> run -cpu=1 endmqtrc -m QMA
Formatting WebSphere MQ trace files
TACL> dspmqtrc -o "/path/to/var/mqm/trace/AMQxxxxx.0.FMT" "/path/to/var/mqm/trace/AMQxxxxx.0.TRC"
TACL> ...
  or
oss> cd "$MQNSKVARPATH/trace"
oss> dspmqtrc AMQ*.TRC
Deleting WebSphere MQ binary trace files
oss> cd "$MQNSKVARPATH/trace"
oss> rm -f AMQ*.TRC
Using sdcp to collect WebSphere MQ traces and other data
oss> sdcp -p 12345,67R,890 -m QMA -w /var/bigdata
Packaging trace files manually
oss> cd "$MQNSKVARPATH/trace"
oss> tar -cvf PMR12356,67R,890-mqtrace.tar AMQ*.FMT
oss> compress PMR12356,67R,890-mqtrace.tar
Cleaning up the trace directory
oss> cd "$MQNSKVARPATH/trace"
oss> rm -f AMQ*.FMT
Additional Information
- WebSphere MQ for HP NonStop Server service data collection and packaging tool (sdcp)
- SC34-6625-00: WebSphere MQ V5.3 for HP NonStop Server System Administration Guide (5.35MiB)
Product Synonym
WebSphere MQ WMQ
Was this topic helpful?
Document Information
Modified date:
22 June 2018
UID
swg21667375