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.

tkaqdoca.sql: Script to Create Users, Objects, Queue Tables, Queues & Subscribers<br />

dbms_aqadm.create_queue_table(<br />

queue_table => 'CBADM_orders_sqtab',<br />

comment => 'Customer Billing Single Consumer Orders queue table',<br />

queue_payload_type => 'BOLADM.order_typ',<br />

compatible => '8.1');<br />

dbms_aqadm.create_queue_table(<br />

queue_table => 'CBADM_orders_mqtab',<br />

comment => 'Customer Billing Multi Consumer Service queue table',<br />

multiple_consumers => TRUE,<br />

queue_payload_type => 'BOLADM.order_typ',<br />

compatible => '8.1');<br />

dbms_aqadm.create_queue (<br />

queue_name => 'CBADM_shippedorders_que',<br />

queue_table => 'CBADM_orders_sqtab');<br />

end;<br />

/<br />

Rem Grant dequeue privilege on the shopped orders queue to the Customer Billing<br />

Rem application. The CB application retrieves shipped orders (not billed yet)<br />

Rem from the shopped orders queue.<br />

execute dbms_aqadm.grant_queue_privilege('DEQUEUE', 'CBADM_shippedorders_que',<br />

'CB', FALSE);<br />

begin<br />

dbms_aqadm.create_queue (<br />

queue_name => 'CBADM_billedorders_que',<br />

queue_table => 'CBADM_orders_mqtab');<br />

end;<br />

/<br />

Rem Grant enqueue privilege on the billed orders queue to Customer Billing<br />

Rem application. The CB application is allowed to put billed orders into<br />

Rem this queue.<br />

execute dbms_aqadm.grant_queue_privilege('ENQUEUE', 'CBADM_billedorders_que',<br />

'CB', FALSE);<br />

Rem Customer support tracks the state of the customer request in the system<br />

Rem<br />

Rem At any point, customer request can be in one of the following states<br />

Rem A. BOOKED B. SHIPPED C. BACKED D. BILLED<br />

Rem Given the order number the customer support will return the state<br />

Scripts for Implementing BooksOnLine C-11

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

Saved successfully!

Ooh no, something went wrong!