6 Configuring Queues and Propagations
The following topics describe configuring queues and propagations:
Each task described in this chapter should be completed by an Oracle Streams administrator that has been granted the appropriate privileges, unless specified otherwise.
See Also:
-
Oracle Streams Concepts and Administration for more information about queues and propagations
-
"Configuring an Oracle Streams Administrator on All Databases"
6.1 Creating an ANYDATA Queue
A queue stores messages in an Oracle Streams environment. Messages can be enqueued, propagated from one queue to another, and dequeued. An ANYDATA queue stores messages whose payloads are of ANYDATA type. Therefore, an ANYDATA queue can store a message with a payload of nearly any type, if the payload is wrapped in an ANYDATA wrapper. Each Oracle Streams capture process, synchronous capture, apply process, and messaging client is associated with one ANYDATA queue, and each Oracle Streams propagation is associated with one ANYDATA source queue and one ANYDATA destination queue.
The easiest way to create an ANYDATA queue is to use the SET_UP_QUEUE procedure in the DBMS_STREAMS_ADM package. This procedure enables you to specify the following settings for the ANYDATA queue it creates:
-
The queue table for the queue
-
A storage clause for the queue table
-
The queue name
-
A queue user that will be configured as a secure queue user of the queue and granted
ENQUEUEandDEQUEUEprivileges on the queue -
A comment for the queue
If the specified queue table does not exist, then it is created. If the specified queue table exists, then the existing queue table is used for the new queue. If you do not specify any queue table when you create the queue, then, by default, streams_queue_table is specified.
For example, complete the following steps to create an ANYDATA queue with the SET_UP_QUEUE procedure:
When the SET_UP_QUEUE procedure creates a queue table, the following DBMS_AQADM.CREATE_QUEUE_TABLE parameter settings are specified:
-
If the database is Oracle Database 10g Release 2 or later, then the
sort_listsetting iscommit_time. If the database is a release before Oracle Database 10g Release 2, then thesort_listsetting isenq_time. -
The
multiple_consumerssetting isTRUE. -
The
message_groupingsetting istransactional. -
The
securesetting isTRUE.
The other parameters in the CREATE_QUEUE_TABLE procedure are set to their default values.
You can use the CREATE_QUEUE_TABLE procedure in the DBMS_AQADM package to create a queue table of ANYDATA type with different properties than the default properties specified by the SET_UP_QUEUE procedure in the DBMS_STREAMS_ADM package. After you create the queue table with the CREATE_QUEUE_TABLE procedure, you can create a queue that uses the queue table. To do so, specify the queue table in the queue_table parameter of the SET_UP_QUEUE procedure.
Similarly, you can use the CREATE_QUEUE procedure in the DBMS_AQADM package to create a queue instead of SET_UP_QUEUE. Use CREATE_QUEUE if you require custom settings for the queue. For example, use CREATE_QUEUE to specify a custom retry delay or retention time. If you use CREATE_QUEUE, then you must start the queue manually.
Note:
-
You can configure an entire Oracle Streams environment, including queues, using procedures in the
DBMS_STREAMS_ADMpackage or Oracle Enterprise Manager Cloud Control. See Simple Oracle Streams Replication Configuration. -
A message cannot be enqueued unless a subscriber who can dequeue the message is configured.
See Also:
-
Oracle Database PL/SQL Packages and Types Reference for more information about the
SET_UP_QUEUE,CREATE_QUEUE_TABLE, andCREATE_QUEUEprocedures
6.2 Creating Oracle Streams Propagations Between ANYDATA Queues
A propagation sends messages from an Oracle Streams source queue to an Oracle Streams destination queue. In addition, you can use the features of Oracle Database Advanced Queuing (AQ) to manage Oracle Streams propagations.
You can use any of the following procedures to create a propagation between two ANYDATA queues:
Each of these procedures in the DBMS_STREAMS_ADM package creates a propagation with the specified name if it does not already exist, creates either a positive rule set or negative rule set for the propagation if the propagation does not have such a rule set, and can add table rules, schema rules, or global rules to the rule set.
The CREATE_PROPAGATION procedure creates a propagation, but does not create a rule set or rules for the propagation. However, the CREATE_PROPAGATION procedure enables you to specify an existing rule set to associate with the propagation, either as a positive or a negative rule set. All propagations are started automatically upon creation.
This section contains the following topics:
Note:
You can configure an entire Oracle Streams environment, including propagations, using procedures in the DBMS_STREAMS_ADM package or Oracle Enterprise Manager Cloud Control. See Simple Oracle Streams Replication Configuration.
See Also:
-
Oracle Database Advanced Queuing User's Guide for more information about configuring propagations with the features of Oracle Streams AQ and instructions about configuring propagations between typed queues
6.2.1 Preparing to Create a Propagation
The following tasks must be completed before you create a propagation:
-
Complete the following tasks in "Tasks to Complete Before Configuring Oracle Streams Replication":
-
"Configuring an Oracle Streams Administrator on All Databases"
-
"Configuring Network Connectivity and Database Links" if the propagation will send messages between databases
-
"Setting Initialization Parameters Relevant to Oracle Streams"
-
-
Create a source queue and a destination queue for the propagation, if they do not exist. Both queues must be
ANYDATAqueues. The examples in this chapter assume that the source queue isstrmadmin.strm_a_queueand that the destination queue isstrmadmin.strm_b_queue. See "Creating an ANYDATA Queue" for instructions.
6.2.2 Creating a Propagation Using DBMS_STREAMS_ADM
Complete the following steps to create a propagation using the ADD_TABLE_PROPAGATION_RULES procedure in the DBMS_STREAMS_ADM package:
Note:
To use queue-to-queue propagation, the compatibility level must be 10.2.0 or higher for each database that contains a queue involved in the propagation.
See Also:
-
Oracle Streams Concepts and Administration for more information about queues, propagations, and rules
6.2.3 Creating a Propagation Using DBMS_PROPAGATION_ADM
Complete the following steps to create a propagation using the CREATE_PROPAGATION procedure in the DBMS_PROPAGATION_ADM package:
Note:
To use queue-to-queue propagation, the compatibility level must be 10.2.0 or higher for each database that contains a queue involved in the propagation.