RelationalDBDesign RelationalDBDesign 


Advanced Queuing   «Prev 

Setting up Using Advanced Queuing

  1. You will be entering commands in the SQL*Plus Worksheet. You enter commands in the upper (white) window, and the results of the command are displayed in the lower (gray) window. Your first step is to create an object type that will act as the payload of your message. You use the
    CREATE TYPE SQL
    
    command, with a name for the type Message_typ, the keywords AS OBJECT, followed by an attribute of the type and a data type for the attribute (order_msg VARCHAR2(100)). Once you have entered the correct command, click the Execute button in the left toolbar, which is the second button from the top.
  2. The results from the SQL statement indicate that you have successfully created the object type. Your next step is to create a queue table that uses the previously created message type. You will use the syntax of EXECUTE, which calls a PL/SQL procedure, the DBMS_AQADM.CREATE_QUEUE_TABLE procedure name, and two named parameters, the queue_table parameter, which should have the name 'queue1', and the queue_payload_type, which should use the name of the object type you created in the previous lesson. Once you have entered the correct command, click the Execute button in the left toolbar.
  3. The results from the SQL statement indicate that you have successfully set up the queue table. Your next step is to create a queue with the DBMS_AQADM.CREATE_QUEUE() procedure call. You will have two named parameters: queue_name and queue_table, which you created in the previous step. Once you have entered the correct command, click the Execute button in the left toolbar.
  4. The results from the SQL statement indicate that you have successfully set up the queue. Your final step is to start the queue. To accomplish this, you execute the START_QUEUE() procedure in the DBMS_AQADM package with one named parameter, the queue_name parameter, with the name of the previously created queue, 'queue1'. Once you have entered the correct command, click the Execute button in the left toolbar.
  5. You have successfully set up a queue. This is the end of the simulation. Click Exit.