09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Support for Statistics Views<br />

}<br />

Internet Access<br />

catch (AQException ex)<br />

{<br />

System.out.println("AQ Exception: " + ex);<br />

}<br />

General Features of <strong>Advanced</strong> <strong>Queuing</strong><br />

Each instance keeps its own AQ statistics information in its own SGA, and does not<br />

have knowledge of the statistics gathered by other instances. When a GV$AQ view<br />

is queried by an instance, all other instances funnel their AQ statistics information<br />

to the instance issuing the query.<br />

Scenario<br />

The gv$ view can be queried at any time to see the number of messages in waiting,<br />

ready or expired state. The view also displays the average number of seconds<br />

messages have been waiting to be processed. The order processing application can<br />

use this to dynamically tune the number of order processing processes (see<br />

"Selecting the Number of Messages in Different States for the Whole Database" on<br />

page 10-33 in Chapter 10, "Administrative Interface: Views").<br />

PL/SQL (DBMS_AQADM Package): Example Code<br />

CONNECT oe/oe<br />

/* Count the number as messages and the average time for which the messages have<br />

been waiting: */<br />

SELECT READY, AVERAGE_WAIT FROM gv$aq Stats, user_queues Qs<br />

WHERE Stats.qid = Qs.qid and Qs.Name = 'OE_neworders_que';<br />

Visual Basic (OO4O): Example Code<br />

Use the dbexecutesql interface from the database for this functionality.<br />

Java (JDBC): Example Code<br />

No example is provided with this release.<br />

See Chapter 17, "Internet Access to <strong>Advanced</strong> <strong>Queuing</strong>" for information on Internet<br />

access to <strong>Advanced</strong> <strong>Queuing</strong> features.<br />

A Sample Application Using AQ 8-35

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!