09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Deploying AQ with XA<br />

Deploying AQ with XA<br />

Note: You may need to set up the following data structures for<br />

certain examples to work:<br />

CONNECT system/manager;<br />

DROP USER aqadm CASCADE;<br />

GRANT CONNECT, RESOURCE TO aqadm;<br />

CREATE USER aqadm IDENTIFIED BY aqadm;<br />

GRANT EXECUTE ON DBMS_AQADM TO aqadm;<br />

GRANT Aq_administrator_role TO aqadm;<br />

DROP USER aq CASCADE;<br />

CREATE USER aq IDENTIFIED BY aq;<br />

GRANT CONNECT, RESOURCE TO aq;<br />

GRANT EXECUTE ON dbms_aq TO aq;<br />

EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE(<br />

queue_table => 'aq.qtable',<br />

queue_payload_type => 'RAW');<br />

/*<br />

* The program uses the XA interface to enqueue 100 messages and then<br />

* dequeue them.<br />

* Login: aq/aq<br />

* Requires: AQ_USER_ROLE to be granted to aq<br />

* a RAW queue called "aqsqueue" to be created in aqs schema<br />

* (above steps can be performed by running aqaq.sql)<br />

* Message Format: Msgno: [0-1000] HELLO, WORLD!<br />

* Author: schandra@us.oracle.com<br />

*/<br />

#ifndef OCI_ORACLE<br />

#include <br />

#endif<br />

#include <br />

EXECUTE DBMS_AQADM.CREATE_QUEUE(<br />

queue_name => 'aq.aqsqueue',<br />

queue_table => 'aq.qtable');<br />

EXECUTE DBMS_AQADM.START_QUEUE(queue_name =><br />

'aq.aqsqueue');<br />

A-68 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

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

Saved successfully!

Ooh no, something went wrong!