I've been testing Oracle AQ for the first time. I have managed to create 2000 rows of test inserts into the queue I created.
Now, I'd like to clear those out. As I was teaching myself, I set the expiry time to be a month. I can't wait that long. And I don't think I should just delete them from the queue table.
What's the best way to do this?
Just do a delete on the queue table.Never mind, just did a check and that's not right:
So, you'll have to create a little PL/SQL routine to pull the items off.
Use the
dbms_aq
package. Check the example from the documentation: Dequeuing Messages. Scroll down a little bit and there's a complete example.You can use the
DBMS_aqadm.purge_queue_table
procedure.SOLUTION
The SQL looks something like this :