7 Configuring Implicit Apply
In a replication environment, Oracle Streams apply process dequeues logical change records (LCRs) from a specific queue and either applies each one directly or passes it as a parameter to a user-defined procedure called an apply handler.
The following topics describe configuring implicit apply:
Each task described in this chapter should be completed by an Oracle Streams administrator that has been granted the appropriate privileges, unless specified otherwise.
7.1 Overview of Apply Process Creation
You can use any of the following procedures to configure an apply process:
Each of the procedures in the DBMS_STREAMS_ADM
package creates an apply process with the specified name if it does not already exist, creates either a positive rule set or negative rule set for the apply process if the apply process does not have such a rule set, and can add table rules, schema rules, global rules, or a message rule to the rule set.
The CREATE_APPLY
procedure in the DBMS_APPLY_ADM
package creates an apply process, but does not create a rule set or rules for the apply process. However, the CREATE_APPLY
procedure enables you to specify an existing rule set to associate with the apply process, either as a positive or a negative rule set, and several other options, such as apply handlers, an apply user, an apply tag, and whether to dequeue messages from a buffered queue or a persistent queue.
A single apply process must either dequeue messages from a buffered queue or a persistent queue. Logical change records that were captured by a capture process are called captured LCRs, and they are always in buffered queues. Therefore, if a single apply process applies LCRs that were captured by a capture process, then it cannot apply persistent LCRs or persistent user messages.
Alternatively, LCRs that were captured by a synchronous capture are persistent LCRs, and they are always in persistent queues. Therefore, if a single apply process applies LCRs that were captured by a synchronous capture, then it cannot apply LCRs captured by a capture process. However, a single apply process can apply both persistent LCRs and persistent user messages because both types of messages are staged in a persistent queue.
The examples in this chapter create apply processes that apply captured LCRs, persistent LCRs, and persistent user messages. Before you create an apply process, create an ANYDATA
queue to associate with the apply process, if one does not exist.
Note:
-
You can configure an entire Oracle Streams environment, including apply processes, using procedures in the
DBMS_STREAMS_ADM
package or Oracle Enterprise Manager Cloud Control. See Simple Oracle Streams Replication Configuration. -
Depending on the configuration of the apply process you create, supplemental logging might be required at the source database on columns in the tables for which an apply process applies changes. See "Specifying Supplemental Logging".
-
Oracle Streams Concepts and Administration for more information about the captured LCRs and persistent LCRs
7.2 Preparing to Create an Apply Process
The following tasks must be completed before you create an apply:
-
Complete the following tasks in "Tasks to Complete Before Configuring Oracle Streams Replication".
-
Create an
ANYDATA
queue to associate with the apply process, if one does not exist. See "Creating an ANYDATA Queue" for instructions. The examples in this chapter assume that the queue used by the apply process isstrmadmin.streams_queue
. Create the queue on the same database that will run the apply process.
7.3 Creating an Apply Process for Captured LCRs Using DBMS_STREAMS_ADM
The following example runs the ADD_SCHEMA_RULES
procedure in the DBMS_STREAMS_ADM
package to create an apply process that applies captured logical change records (LCRs). This apply process can apply LCRs that were captured by a capture process.
Complete the following steps:
7.4 Creating an Apply Process Using DBMS_APPLY_ADM
This section contains the following examples that create an apply process using the DBMS_APPLY_ADM
package:
-
Creating an Apply Process for Captured LCRs with DBMS_APPLY_ADM
-
Creating an Apply Process for Persistent LCRs with DBMS_APPLY_ADM
See Also:
-
"Change Apply in an Oracle to Non-Oracle Environment" for information about configuring an apply process to apply messages to a non-Oracle database using the
apply_database_link
parameter
7.4.1 Creating an Apply Process for Captured LCRs with DBMS_APPLY_ADM
The following example runs the CREATE_APPLY
procedure in the DBMS_APPLY_ADM
package to create an apply process that applies captured logical change records (LCRs). This apply process can apply LCRs that were captured by a capture process.
Complete the following steps:
After creating the apply process, run the ADD_TABLE_RULES
or ADD_SUBSET_RULES
procedure to add rules to the apply process rule set. These rules direct the apply process to apply LCRs for the specified tables.
See Also:
Oracle Streams Concepts and Administration for more information about rules
7.4.2 Creating an Apply Process for Persistent LCRs with DBMS_APPLY_ADM
The following example runs the CREATE_APPLY
procedure in the DBMS_APPLY_ADM
package to create an apply process that applies persistent logical change records (LCRs). This apply process can apply LCRs that were captured by a synchronous capture or constructed by an application.
Complete the following steps:
After creating the apply process, run the ADD_TABLE_RULES
or ADD_SUBSET_RULES
procedure to add rules to the apply process rule set. These rules direct the apply process to apply LCRs for the specified tables.
See Also:
Oracle Streams Concepts and Administration for more information about rules