Posted by: ibmadmin | April 12, 2011

IBM MQ – Queue clear

The messages in the queues can be cleared using the following MQSC command.

CLEAR QLOCAL(TEST_Q)

After executing the above command, we may see the “AMQ8148: WebSphere MQ object in use” error messages if the queues are listened by some process.

The process which are bind with the queues can be identified with the below commands.

dis Qstatus(TEST_Q) ALL
QUEUE(TEST_Q) TYPE(QUEUE)
CURDEPTH(4) IPPROCS(2)
LGETDATE( ) LGETTIME( )
LPUTDATE( ) LPUTTIME( )
MEDIALOG( ) MONQ(OFF)
MSGAGE( ) OPPROCS(0)
QTIME( , ) UNCOM(NO)

From the above MQSC output, we can easily figure out there are 2 process are bind with this queue as the input mode IPPROCS(2). This prevent us to clear the messages from the TEST_Q.

To override the “AMQ8148: WebSphere MQ object in use” message, we can use /opt/mqm/samp/bin/amqsget command to get the message from the TEST_Q. This will clear the messages from the particular queue.

cd /opt/mqm/samp/bin/
./amqsget TEST_Q QM

./amqsget

Advertisements

Responses

  1. The best tool to use is QLOAD (support pac) so you can move the messages to a file in case you ever want to restore them. This tool is now in MQ v8 as dmpmqmsg. Or use support pac MA01 (now in GIT).

    Or use MQ explorer or MO71 to delete (by MQGET) the messages.

    • Hi Peter.. Thanks you for your input….

  2. […] IBM MQ – Queue clear – ibmadmin | Where Middleware World … – IBM MQ – Queue clear. … After executing the above command, we may see the “AMQ8148: WebSphere MQ object in use” error messages if the queues are listened by some process. The process which are bind with the queues can be identified with the below commands. […]

  3. Thanks a lot, it worked. 🙂 I was not sure if messages could be cleared without disconnecting the applications from the queue. 🙂

  4. Your message size is larger than the default defined in the program. Increase the buffer size and recompile the binary.

  5. i have a error 2080 in amqsget and when i run clear qlocal its shows AMQ8148: WebSphere MQ object in use
    let me know how to proceed


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: