Author |
Message
|
kshah |
Posted: Tue Feb 20, 2007 7:55 am Post subject: How to clear all Queues in a Queue Manager at Once? |
|
|
Novice
Joined: 13 Jun 2005 Posts: 23
|
Is it possible to clear al the queues of partiular queue manager on WINDOWS machine?
If no...is there a workaround to this problem.
Also i wud like to delete all the queue in QM in one command.
is it possible?
also on runmqsc i m trying command like
display qlocal(*) where(q_name EQ BRK_*)
when i run above command iit gives a syntax error..
My requirement is to get a list of al local queues begining wit 'BRK_'
Thanks in advacne
Kshah |
|
Back to top |
|
 |
Vitor |
Posted: Tue Feb 20, 2007 8:01 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
There's the CLEAR QLOCAL command. AFAIK it won't take a wildcard for safety reasons (I stand to be corrected here) but you could write a little script that reads all the queue names and runs a CLEAR QLOCAL for each of them. Or do the same with PCF commands.
I think your filter condition needs to be in quotes. I stand to be corrected on that as well.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Feb 20, 2007 8:02 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You can delete all the queues on a qmgr with "dltmqm".
You can only clear a single queue at a time, and only if nobody has it open. Otherwise, you can only remove each individual message on one queue at a time.
You also appear to be confusing "EQ" with "LIKE", and misunderstanding what the "*" in "ql(*)" means. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
exerk |
Posted: Tue Feb 20, 2007 8:10 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Quote: |
Is it possible to clear al the queues of partiular queue manager on WINDOWS machine? |
Not a good idea unless you mean application queues only and NOT System Queues, this includes deleting all queues. It can be done by piping in a list of commands via runmqsc.
Quote: |
also on runmqsc i m trying command like
display qlocal(*) where(q_name EQ BRK_*) |
Try
Hope this helps  _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
143313188 |
Posted: Tue Feb 20, 2007 9:10 pm Post subject: possible to clear all queues of QMGR |
|
|
Novice
Joined: 15 Feb 2007 Posts: 22 Location: india
|
by using script you can clear the all queues of QMGR. _________________ hi to all. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Wed Feb 21, 2007 5:46 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
OK...I'll bite.
Why would you want to do this? I assume that this is a test queue manager? As previously mentioned this is not good practice....especially if you don't exclude the SYSTEM. queues from the mix.
If messages are non-persistent you could just restart the queue manager and that may clear lots of messages.
I would also recommend that if you do decide to go ahead and do this that you lock the script away from inadvertant use later on....nothing is more certain to get the oft heard cry of 'MQ lost my messages' than someone running your script to 'see what it did'.  |
|
Back to top |
|
 |
|