15 Managing Oracle Streams Implicit Capture
Both capture processes and synchronous captures perform implicit capture. This chapter contains instructions for managing implicit capture.
The following topics describe managing Oracle Streams implicit capture:
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 Replication Administrator's Guide for information about creating an Oracle Streams administrator 
15.1 Managing a Capture Process
A capture process captures changes in a redo log, reformats each captured change into a logical change record (LCR), and enqueues the LCR into an ANYDATA queue.
                  
The following topics describe managing a capture process:
- 
                        Managing the Checkpoint Retention Time for a Capture Process 
- 
                        Adding an Archived Redo Log File to a Capture Process Explicitly 
See Also:
- 
                           Oracle Streams Replication Administrator's Guide for information about configuring a capture process 
- 
                           The Oracle Enterprise Manager Cloud Control online help for instructions on managing a capture process with Oracle Enterprise Manager Cloud Control 
15.1.1 Starting a Capture Process
You run the START_CAPTURE procedure in the DBMS_CAPTURE_ADM package to start an existing capture process. For example, the following procedure starts a capture process named strm01_capture:
                        
BEGIN DBMS_CAPTURE_ADM.START_CAPTURE( capture_name => 'strm01_capture'); END; /
Note:
If a new capture process will use a new LogMiner data dictionary, then, when you first start the new capture process, some time might be required to populate the new LogMiner data dictionary. A new LogMiner data dictionary is created if a non-NULL first SCN value was specified when the capture process was created.
                           
See Also:
The Oracle Enterprise Manager Cloud Control online help for instructions about starting a capture process with Oracle Enterprise Manager Cloud Control
15.1.2 Stopping a Capture Process
You run the STOP_CAPTURE procedure in the DBMS_CAPTURE_ADM package to stop an existing capture process. For example, the following procedure stops a capture process named strm01_capture:
                        
BEGIN DBMS_CAPTURE_ADM.STOP_CAPTURE( capture_name => 'strm01_capture'); END; /
See Also:
The Oracle Enterprise Manager Cloud Control online help for instructions about stopping a capture process with Oracle Enterprise Manager Cloud Control
15.1.3 Managing the Rule Set for a Capture Process
This section contains instructions for completing the following tasks:
15.1.3.1 Specifying a Rule Set for a Capture Process
You can specify one positive rule set and one negative rule set for a capture process. The capture process captures a change if it evaluates to TRUE for at least one rule in the positive rule set and evaluates to FALSE for all the rules in the negative rule set. The negative rule set is evaluated before the positive rule set.
                        
15.1.3.1.1 Specifying a Positive Rule Set for a Capture Process
You specify an existing rule set as the positive rule set for an existing capture process using the rule_set_name parameter in the ALTER_CAPTURE procedure. This procedure is in the DBMS_CAPTURE_ADM package. 
                              
For example, the following procedure sets the positive rule set for a capture process named strm01_capture to strm02_rule_set.
                              
BEGIN
  DBMS_CAPTURE_ADM.ALTER_CAPTURE(
    capture_name  => 'strm01_capture',
    rule_set_name => 'strmadmin.strm02_rule_set');
END;
/15.1.3.1.2 Specifying a Negative Rule Set for a Capture Process
You specify an existing rule set as the negative rule set for an existing capture process using the negative_rule_set_name parameter in the ALTER_CAPTURE procedure. This procedure is in the DBMS_CAPTURE_ADM package. 
                              
For example, the following procedure sets the negative rule set for a capture process named strm01_capture to strm03_rule_set.
                              
BEGIN
  DBMS_CAPTURE_ADM.ALTER_CAPTURE(
    capture_name           => 'strm01_capture',
    negative_rule_set_name => 'strmadmin.strm03_rule_set');
END;
/15.1.3.2 Adding Rules to a Rule Set for a Capture Process
To add rules to a rule set for an existing capture process, you can run one of the following procedures in the DBMS_STREAMS_ADM package and specify the existing capture process:
                        
Excluding the ADD_SUBSET_RULES procedure, these procedures can add rules to the positive rule set or negative rule set for a capture process. The ADD_SUBSET_RULES procedure can add rules only to the positive rule set for a capture process.
                        
See Also:
15.1.3.2.1 Adding Rules to the Positive Rule Set for a Capture Process
The following example runs the ADD_TABLE_RULES procedure in the DBMS_STREAMS_ADM package to add rules to the positive rule set of a capture process named strm01_capture:
                              
BEGIN
  DBMS_STREAMS_ADM.ADD_TABLE_RULES(
    table_name      =>  'hr.departments',
    streams_type    =>  'capture',
    streams_name    =>  'strm01_capture',
    queue_name      =>  'strmadmin.streams_queue',
    include_dml     =>  TRUE,
    include_ddl     =>  TRUE,
    inclusion_rule  =>  TRUE);
END;
/
Running this procedure performs the following actions:
- 
                                    Creates two rules. One rule evaluates to TRUEfor DML changes to thehr.departmentstable, and the other rule evaluates toTRUEfor DDL changes to thehr.departmentstable. The rule names are system generated.
- 
                                    Adds the two rules to the positive rule set associated with the capture process because the inclusion_ruleparameter is set toTRUE.
- 
                                    Prepares the hr.departmentstable for instantiation by running thePREPARE_TABLE_INSTANTIATIONprocedure in theDBMS_CAPTURE_ADMpackage.
- 
                                    Enables supplemental logging for any primary key, unique key, bitmap index, and foreign key columns in the hr.departmentstable. When thePREPARE_TABLE_INSTANTIATIONprocedure is run, the default value (keys) is specified for thesupplemental_loggingparameter.
If the capture process is performing downstream capture, then the table is prepared for instantiation and supplemental logging is enabled for key columns only if the downstream capture process uses a database link to the source database. If a downstream capture process does not use a database link to the source database, then the table must be prepared for instantiation manually and supplemental logging must be enabled manually.
15.1.3.2.2 Adding Rules to the Negative Rule Set for a Capture Process
The following example runs the ADD_TABLE_RULES procedure in the DBMS_STREAMS_ADM package to add rules to the negative rule set of a capture process named strm01_capture:
                              
BEGIN
  DBMS_STREAMS_ADM.ADD_TABLE_RULES(
    table_name      =>  'hr.job_history',
    streams_type    =>  'capture',
    streams_name    =>  'strm01_capture',
    queue_name      =>  'strmadmin.streams_queue',
    include_dml     =>  TRUE,
    include_ddl     =>  TRUE,
    inclusion_rule  =>  FALSE);
END;
/
Running this procedure performs the following actions:
- 
                                    Creates two rules. One rule evaluates to TRUEfor DML changes to thehr.job_historytable, and the other rule evaluates toTRUEfor DDL changes to thehr.job_historytable. The rule names are system generated.
- 
                                    Adds the two rules to the negative rule set associated with the capture process, because the inclusion_ruleparameter is set toFALSE.
15.1.3.3 Removing a Rule from a Rule Set for a Capture Process
You remove a rule from the rule set for a capture process if you no longer want the capture process to capture the changes specified in the rule. For example, assume that the departments3 rule specifies that DML changes to the hr.departments table be captured. If you no longer want a capture process to capture changes to the hr.departments table, then remove the departments3 rule from its rule set.
                           
You remove a rule from a rule set for an existing capture process by running the REMOVE_RULE procedure in the DBMS_STREAMS_ADM package. For example, the following procedure removes a rule named departments3 from the positive rule set of a capture process named strm01_capture.
                           
BEGIN
  DBMS_STREAMS_ADM.REMOVE_RULE(
    rule_name        => 'departments3',
    streams_type     => 'capture',
    streams_name     => 'strm01_capture',
    drop_unused_rule => TRUE,
    inclusion_rule   => TRUE);
END;
/
In this example, the drop_unused_rule parameter in the REMOVE_RULE procedure is set to TRUE, which is the default setting. Therefore, if the rule being removed is not in any other rule set, then it will be dropped from the database. If the drop_unused_rule parameter is set to FALSE, then the rule is removed from the rule set, but it is not dropped from the database.
                           
If the inclusion_rule parameter is set to FALSE, then the REMOVE_RULE procedure removes the rule from the negative rule set for the capture process, not the positive rule set.
                           
To remove all of the rules in a rule set for the capture process, specify NULL for the rule_name parameter when you run the REMOVE_RULE procedure.
                           
15.1.3.4 Removing a Rule Set for a Capture Process
You remove a rule set from an existing capture process using the ALTER_CAPTURE procedure in the DBMS_CAPTURE_ADM package. This procedure can remove the positive rule set, negative rule set, or both. Specify TRUE for the remove_rule_set parameter to remove the positive rule set for the capture process. Specify TRUE for the remove_negative_rule_set parameter to remove the negative rule set for the capture process.
                           
For example, the following procedure removes both the positive and negative rule set from a capture process named strm01_capture.
                           
BEGIN
  DBMS_CAPTURE_ADM.ALTER_CAPTURE(
    capture_name             => 'strm01_capture',
    remove_rule_set          => TRUE,
    remove_negative_rule_set => TRUE);
END;
/Note:
If a capture process does not have a positive or negative rule set, then the capture process captures all supported changes to all objects in the database, excluding database objects in the SYS, SYSTEM, and CTXSYS schemas.
                              
15.1.4 Setting a Capture Process Parameter
Set a capture process parameter using the SET_PARAMETER procedure in the DBMS_CAPTURE_ADM package. Capture process parameters control the way a capture process operates.
                        
For example, the following procedure sets the parallelism parameter for a capture process named strm01_capture to 4.
                        
BEGIN
  DBMS_CAPTURE_ADM.SET_PARAMETER(
    capture_name => 'strm01_capture',
    parameter    => 'parallelism',
    value        => '4');
END;
/Note:
- 
                                 Setting the parallelismparameter automatically stops and restarts a capture process.
- 
                                 The valueparameter is always entered as aVARCHAR2value, even if the parameter value is a number.
- 
                                 If the valueparameter is set toNULLor is not specified, then the parameter is set to its default value.
See Also:
- 
                                 The Oracle Enterprise Manager Cloud Control online help for instructions about setting capture process parameters with Oracle Enterprise Manager Cloud Control 
- 
                                 The DBMS_CAPTURE_ADM.SET_PARAMETERprocedure in the Oracle Database PL/SQL Packages and Types Reference for detailed information about the capture process parameters
15.1.5 Setting the Capture User for a Capture Process
The capture user is the user who captures all DML changes and DDL changes that satisfy the capture process rule sets. Set the capture user for a capture process using the capture_user parameter in the ALTER_CAPTURE procedure in the DBMS_CAPTURE_ADM package. 
                        
To change the capture user, the user who invokes the ALTER_CAPTURE procedure must be granted DBA role. Only the SYS user can set the capture_user to SYS.
                        
For example, the following procedure sets the capture user for a capture process named strm01_capture to hr.
                        
BEGIN
  DBMS_CAPTURE_ADM.ALTER_CAPTURE(
    capture_name => 'strm01_capture',
    capture_user => 'hr');
END;
/
Running this procedure grants the new capture user enqueue privilege on the queue used by the capture process and configures the user as a secure queue user of the queue. In addition, ensure that the capture user has the following privileges:
- 
                              EXECUTEprivilege on the rule sets used by the capture process
- 
                              EXECUTEprivilege on all custom rule-based transformation functions used in the rule set
These privileges can be granted to the capture user directly or through roles.
In addition, the capture user must be granted EXECUTE privilege on all packages, including Oracle-supplied packages, that are invoked in rule-based transformations run by the capture process. These privileges must be granted directly to the capture user. They cannot be granted through roles.
                        
Note:
If Oracle Database Vault is installed, then the user who changes the capture user must be granted the BECOME USER system privilege. Granting this privilege to the user is not required if Oracle Database Vault is not installed. You can revoke the BECOME USER system privilege from the user after capture user is changed, if necessary.
                           
15.1.6 Managing the Checkpoint Retention Time for a Capture Process
The checkpoint retention time is the amount of time that a capture process retains checkpoints before purging them automatically.
Set the checkpoint retention time for a capture process using checkpoint_retention_time parameter in the ALTER_CAPTURE procedure of the DBMS_CAPTURE_ADM package.
                     
This section contains these topics:
- 
                           Setting the Checkpoint Retention Time for a Capture Process to a New Value 
- 
                           Setting the Checkpoint Retention Time for a Capture Process to Infinite 
See Also:
15.1.6.1 Setting the Checkpoint Retention Time for a Capture Process to a New Value
When you set the checkpoint retention time, you can specify partial days with decimal values. For example, run the following procedure to specify that a capture process named strm01_capture should purge checkpoints automatically every ten days and twelve hours:
                           
BEGIN
  DBMS_CAPTURE_ADM.ALTER_CAPTURE(
    capture_name              => 'strm01_capture',
    checkpoint_retention_time => 10.5);
END;
/15.1.6.2 Setting the Checkpoint Retention Time for a Capture Process to Infinite
To specify that a capture process should not purge checkpoints automatically, set the checkpoint retention time to DBMS_CAPTURE_ADM.INFINITE. For example, the following procedure sets the checkpoint retention time for a name strm01_capture to infinite:
                           
BEGIN
  DBMS_CAPTURE_ADM.ALTER_CAPTURE(
    capture_name              => 'strm01_capture',
    checkpoint_retention_time => DBMS_CAPTURE_ADM.INFINITE);
END;
/15.1.7 Adding an Archived Redo Log File to a Capture Process Explicitly
You can add an archived redo log file to a capture process manually using the following statement:
ALTER DATABASE REGISTER LOGICAL LOGFILE file_name FOR capture_process;
Here, file_name is the name of the archived redo log file being added, and capture_process is the name of the capture process that will use the redo log file at the downstream database. The capture_process is equivalent to the logminer_session_name and must be specified. The redo log file must be present at the site running capture process.
                        
For example, to add the /usr/log_files/1_3_486574859.dbf archived redo log file to a capture process named strm03_capture, issue the following statement:
                        
ALTER DATABASE REGISTER LOGICAL LOGFILE '/usr/log_files/1_3_486574859.dbf' FOR 'strm03_capture';
See Also:
Oracle Database SQL Language Reference for more information about the ALTER DATABASE statement and Oracle Data Guard Concepts and Administration for more information registering redo log files
                           
15.1.8 Setting the First SCN for an Existing Capture Process
You can set the first SCN for an existing capture process.
The specified first SCN must meet the following requirements:
- 
                              It must be greater than the current first SCN for the capture process. 
- 
                              It must be less than or equal to the current applied SCN for the capture process. However, this requirement does not apply if the current applied SCN for the capture process is zero. 
- 
                              It must be less than or equal to the required checkpoint SCN for the capture process. 
You can determine the current first SCN, applied SCN, and required checkpoint SCN for each capture process in a database using the following query:
SELECT CAPTURE_NAME, FIRST_SCN, APPLIED_SCN, REQUIRED_CHECKPOINT_SCN FROM DBA_CAPTURE;
When you reset a first SCN for a capture process, information below the new first SCN setting is purged from the LogMiner data dictionary for the capture process automatically. Therefore, after the first SCN is reset for a capture process, the start SCN for the capture process cannot be set lower than the new first SCN. Also, redo log files that contain information before the new first SCN setting will never be needed by the capture process.
For example, the following procedure sets the first SCN for a capture process named strm01_capture to 351232 using the ALTER_CAPTURE procedure in the DBMS_CAPTURE_ADM package:
                        
BEGIN
  DBMS_CAPTURE_ADM.ALTER_CAPTURE(
    capture_name => 'strm01_capture',
    first_scn    => 351232);
END;
/
Note:
- 
                                 If the specified first SCN is higher than the current start SCN for the capture process, then the start SCN is set automatically to the new value of the first SCN. 
- 
                                 If you must capture changes in the redo log from a point in time in the past, then you can create a capture process and specify a first SCN that corresponds to a previous data dictionary build in the redo log. The BUILDprocedure in theDBMS_CAPTURE_ADMpackage performs a data dictionary build in the redo log.
- 
                                 You can query the DBA_LOGMNR_PURGED_LOGdata dictionary view to determine which redo log files will never be needed by any capture process.
See Also:
- 
                                 "Displaying SCN Values for Each Redo Log File Used by Each Capture Process" for a query that determines which redo log files are no longer needed 
15.1.9 Setting the Start SCN for an Existing Capture Process
You can set the start SCN for an existing capture process. Typically, you reset the start SCN for a capture process if point-in-time recovery must be performed on one of the destination databases that receive changes from the capture process.
The specified start SCN must be greater than or equal to the first SCN for the capture process. When you reset a start SCN for a capture process, ensure that the required redo log files are available to the capture process.
You can determine the first SCN for each capture process in a database using the following query:
SELECT CAPTURE_NAME, FIRST_SCN FROM DBA_CAPTURE;
For example, to set the start SCN for a capture process named strm01_capture to 750338, complete the following steps:
                        
See Also:
- 
                                 Oracle Streams Replication Administrator's Guide for information about performing database point-in-time recovery on a destination database in an Oracle Streams environment 
15.1.10 Specifying Whether Downstream Capture Uses a Database Link
You specify whether an existing downstream capture process uses a database link to the source database for administrative purposes using the ALTER_CAPTURE procedure in the DBMS_CAPTURE_ADM package. Set the use_database_link parameter to TRUE to specify that the downstream capture process uses a database link, or you set the use_database_link parameter to FALSE to specify that the downstream capture process does not use a database link.
                        
If you want a capture process that is not using a database link currently to begin using a database link, then specify TRUE for the use_database_link parameter. In this case, a database link with the same name as the global name as the source database must exist at the downstream database. 
                        
If you want a capture process that is using a database link currently to stop using a database link, then specify FALSE for the use_database_link parameter. In this case, some administration must be performed manually after you alter the capture process. For example, if you add new capture process rules using the DBMS_STREAMS_ADM package, then you must prepare the objects relating to the rules for instantiation manually at the source database.
                        
If you specify NULL for the use_database_link parameter, then the current value of this parameter for the capture process is not changed.
                        
To create a database link to the source database dbs1.example.com and specify that this capture process uses the database link, complete the following steps:
                        
See Also:
15.1.11 Dropping a Capture Process
You run the DROP_CAPTURE procedure in the DBMS_CAPTURE_ADM package to drop an existing capture process. For example, the following procedure drops a capture process named strm02_capture:
                        
BEGIN
  DBMS_CAPTURE_ADM.DROP_CAPTURE(
    capture_name          => 'strm02_capture',
    drop_unused_rule_sets => TRUE);
END;
/
Because the drop_unused_rule_sets parameter is set to TRUE, this procedure also drops any rule sets used by the strm02_capture capture process, unless a rule set is used by another Oracle Streams client. If the drop_unused_rule_sets parameter is set to TRUE, then both the positive rule set and negative rule set for the capture process might be dropped. If this procedure drops a rule set, then it also drops any rules in the rule set that are not in another rule set.
                        
Note:
The status of a capture process must be DISABLED or ABORTED before it can be dropped. You cannot drop an ENABLED capture process.
                           
15.2 Managing a Synchronous Capture
A synchronous capture uses an internal mechanism to capture data manipulation language (DML) changes made to tables. A synchronous capture reformats each captured change into a logical change record (LCR), and enqueues the LCR into an ANYDATA queue.
                  
This section contains these topics:
See Also:
- 
                           Oracle Streams Replication Administrator's Guide for an example that configures a replication environment that uses synchronous capture 
15.2.1 Managing the Rule Set for a Synchronous Capture
This section contains instructions for completing the following tasks:
15.2.1.1 Specifying a Rule Set for a Synchronous Capture
You can specify one positive rule set for a synchronous capture. The synchronous capture captures a change if it evaluates to TRUE for at least one rule in the positive rule set.
                           
You specify an existing rule set as the positive rule set for an existing synchronous capture using the rule_set_name parameter in the ALTER_SYNC_CAPTURE procedure. This procedure is in the DBMS_CAPTURE_ADM package. 
                           
For example, the following procedure sets the positive rule set for a synchronous capture named sync_capture to sync_rule_set.
                           
BEGIN
  DBMS_CAPTURE_ADM.ALTER_SYNC_CAPTURE(
    capture_name  => 'sync_capture',
    rule_set_name => 'strmadmin.sync_rule_set');
END;
/
Note:
You cannot remove the rule set for a synchronous capture.
15.2.1.2 Adding Rules to a Rule Set for a Synchronous Capture
To add rules to a rule set for an existing synchronous capture, you can run one of the following procedures in the DBMS_STREAMS_ADM package and specify the existing synchronous capture:
                           
See Also:
The following example runs the ADD_TABLE_RULES procedure in the DBMS_STREAMS_ADM package to add rules to the positive rule set of a synchronous capture named sync_capture:
                           
BEGIN
  DBMS_STREAMS_ADM.ADD_TABLE_RULES(
    table_name      =>  'hr.departments',
    streams_type    =>  'sync_capture',
    streams_name    =>  'sync_capture',
    queue_name      =>  'strmadmin.streams_queue',
    include_dml     =>  TRUE);
END;
/
Running this procedure performs the following actions:
- 
                                 Creates one rule which evaluates to TRUEfor DML changes to thehr.departmentstable. The rule name is system generated.
- 
                                 Adds the rule to the positive rule set associated with the synchronous capture. 
- 
                                 Prepares the hr.departmentstable for instantiation by running thePREPARE_SYNC_INSTANTIATIONfunction in theDBMS_CAPTURE_ADMpackage.
Note:
- 
                                    A synchronous capture captures changes to a table only if the ADD_TABLE_RULESorADD_SUBSET_RULESprocedure was used to add the rule or rules for the table to the synchronous capture rule set. Synchronous capture does not capture changes to a table if a table or subset rule is added to its rule set using theADD_RULEprocedure in theDBMS_RULE_ADMpackage. In addition, a synchronous capture ignores all non-table and non-subset rules in its rule set, including global and schema rules.
- 
                                    When the ADD_TABLE_RULESor theADD_SUBSET_RULESprocedure adds rules to a synchronous capture rule set, the procedure must obtain an exclusive lock on the specified table. If there are outstanding transactions on the specified table, then the procedure waits until it can obtain a lock.
15.2.1.3 Removing a Rule from a Rule Set for a Synchronous Capture
You remove a rule from the rule set for a synchronous capture if you no longer want the synchronous capture to capture the changes specified in the rule. For example, assume that the departments3 rule specifies that DML changes to the hr.departments table be captured. If you no longer want a synchronous capture to capture changes to the hr.departments table, then remove the departments3 rule from its rule set.
                           
You remove a rule from a rule set for an existing synchronous capture by running the REMOVE_RULE procedure in the DBMS_STREAMS_ADM package. For example, the following procedure removes a rule named departments3 from the positive rule set of a synchronous capture named sync_capture.
                           
BEGIN
  DBMS_STREAMS_ADM.REMOVE_RULE(
    rule_name        => 'departments3',
    streams_type     => 'sync_capture',
    streams_name     => 'sync_capture',
    drop_unused_rule => TRUE);
END;
/
In this example, the drop_unused_rule parameter in the REMOVE_RULE procedure is set to TRUE, which is the default setting. Therefore, if the rule being removed is not in any other rule set, then it will be dropped from the database. If the drop_unused_rule parameter is set to FALSE, then the rule is removed from the rule set, but it is not dropped from the database.
                           
To remove all of the rules in a rule set for the synchronous capture, specify NULL for the rule_name parameter when you run the REMOVE_RULE procedure.
                           
15.2.2 Setting the Capture User for a Synchronous Capture
The capture user is the user who captures all DML changes that satisfy the synchronous capture rule set. Set the capture user for a synchronous capture using the capture_user parameter in the ALTER_SYNC_CAPTURE procedure in the DBMS_CAPTURE_ADM package. 
                        
To change the capture user, the user who invokes the ALTER_SYNC_CAPTURE procedure must be granted DBA role. Only the SYS user can set the capture_user to SYS.
                        
For example, the following procedure sets the capture user for a synchronous capture named sync_capture to hr.
                        
BEGIN
  DBMS_CAPTURE_ADM.ALTER_SYNC_CAPTURE(
    capture_name => 'sync_capture',
    capture_user => 'hr');
END;
/
Running this procedure grants the new capture user enqueue privilege on the queue used by the synchronous capture and configures the user as a secure queue user of the queue. In addition, ensure that the capture user has the following privileges:
- 
                              EXECUTEprivilege on the rule set used by the synchronous capture
- 
                              EXECUTEprivilege on all custom rule-based transformation functions used in the rule set
These privileges can be granted to the capture user directly or through roles.
In addition, the capture user must be granted EXECUTE privilege on all packages, including Oracle-supplied packages, that are invoked in rule-based transformations run by the synchronous capture. These privileges must be granted directly to the capture user. They cannot be granted through roles.
                        
Note:
If Oracle Database Vault is installed, then the user who changes the capture user must be granted the BECOME USER system privilege. Granting this privilege to the user is not required if Oracle Database Vault is not installed. You can revoke the BECOME USER system privilege from the user after capture user is changed, if necessary.
                           
15.2.3 Dropping a Synchronous Capture
You run the DROP_CAPTURE procedure in the DBMS_CAPTURE_ADM package to drop an existing synchronous capture. For example, the following procedure drops a synchronous capture named sync_capture:
                        
BEGIN
  DBMS_CAPTURE_ADM.DROP_CAPTURE(
    capture_name          => 'sync_capture',
    drop_unused_rule_sets => TRUE);
END;
/
Because the drop_unused_rule_sets parameter is set to TRUE, this procedure also drops any rule sets used by the sync_capture synchronous capture, unless a rule set is used by another Oracle Streams client. If the drop_unused_rule_sets parameter is set to TRUE, then the rule set for the synchronous capture might be dropped. If this procedure drops a rule set, then it also drops any rules in the rule set that are not in another rule set.
                        
15.3 Managing Extra Attributes in Captured LCRs
You can use the INCLUDE_EXTRA_ATTRIBUTE procedure in the DBMS_CAPTURE_ADM package to instruct a capture process or a synchronous capture to capture one or more extra attributes. You can also use this procedure to instruct a capture process or synchronous capture to exclude an extra attribute that it is capturing currently.
                  
The extra attributes are the following:
- 
                        row_id(row LCRs only)
- 
                        serial#
- 
                        session#
- 
                        thread#
- 
                        tx_name
- 
                        username
This section contains instructions for completing the following tasks:
See Also:
- 
                           Oracle Database PL/SQL Packages and Types Reference for more information about the INCLUDE_EXTRA_ATTRIBUTEprocedure
15.3.1 Including Extra Attributes in Implicitly Captured LCRs
To include an extra attribute in the LCRs captured by a capture process or synchronous capture, run the INCLUDE_EXTRA_ATTRIBUTES procedure, and set the include parameter to TRUE. For example, to instruct a capture process or synchronous capture named strm01_capture to include the transaction name in each LCR that it captures, run the following procedure:
                        
BEGIN
  DBMS_CAPTURE_ADM.INCLUDE_EXTRA_ATTRIBUTE(
    capture_name   => 'strm01_capture',
    attribute_name => 'tx_name',
    include        => TRUE);
END;
/15.3.2 Excluding Extra Attributes from Implicitly Captured LCRs
To exclude an extra attribute from the LCRs captured by a capture process or synchronous capture, run the INCLUDE_EXTRA_ATTRIBUTES procedure, and set the include parameter to FALSE. For example, to instruct a capture process or synchronous capture named strm01_capture to exclude the transaction name from each LCR that it captures, run the following procedure:
                        
BEGIN
  DBMS_CAPTURE_ADM.INCLUDE_EXTRA_ATTRIBUTE(
    capture_name   => 'strm01_capture',
    attribute_name => 'tx_name',
    include        => FALSE);
END;
/15.4 Switching From a Capture Process to a Synchronous Capture
This section describes how to switch from a capture process to a synchronous capture. Typically, a synchronous capture is used to capture data manipulation language (DML) changes to a relatively small number of tables. You might decide to make this switch if you are currently capturing changes to a small number of tables with a capture process instead of a synchronous capture.
You should not switch from a capture process to a synchronous capture if any of the following conditions are true:
- 
                           Instead of capturing the changes made to a small number of tables, the capture process is capturing changes made to an entire database, one or more schemas, or a large number of tables, and you want to continue to capture these changes. 
- 
                           The capture process is capturing data definition language (DDL) changes, and you want to continue to capture DDL changes. A synchronous capture cannot capture DDL changes. 
- 
                           The capture process uses a negative rule set, and you want to continue to use a negative rule set. A synchronous capture cannot use negative rule set. 
- 
                           The capture process is a downstream capture process. Downstream capture is not possible with a synchronous capture. 
This section uses an example to describe how to switch from a capture process to a synchronous capture. Table 15-1 shows the Oracle Streams components in the sample environment before the switch and after the switch.
Table 15-1 Sample Switch From a Capture Process to a Synchronous Capture
| Oracle Streams Component | Before Switch | After Switch | 
|---|---|---|
| Capture Process | 
 | None | 
| Capture Process Rule Set | 
 | None | 
| Synchronous Capture | None | 
 | 
| Synchronous Capture Rule Set | None | 
 | 
| Propagation | 
 | 
 | 
| Propagation Rule Set | 
 | 
 | 
| Source Queue | 
 | 
 | 
| Destination Queue | 
 | 
 | 
| Apply Process | 
 | 
 | 
| Apply Process Rule Set | 
 | 
 | 
In Table 15-1, notice that the Oracle Streams environment uses the same rule sets before the switch and after the switch. Also, for the example in this section, assume that the source database is db1.example.com and the destination database is db2.example.com.
                     
Note:
The example in this section assumes that the Oracle Streams environment only involves two databases. If you are using a directed network to send changes through multiple databases, then you might need to configure additional propagations and queues for the new synchronous capture stream of changes, and you might need to drop additional propagations and queues that were used by the capture process stream.
To switch from a capture process to a synchronous capture, complete the following steps:
If you have a bi-directional replication environment, then you can perform these steps independently to switch from a capture process to synchronous capture in both directions.
15.5 Switching from a Synchronous Capture to a Capture Process
This section describes how to switch from a synchronous capture to a capture process. You might decide to make this switch for one or more of the following reasons:
- 
                           You are currently capturing changes to a small number of tables but want to expand your environment to capture changes to a large number of tables, one or more schemas, or an entire database. 
- 
                           You want to use a negative rule set during change capture. 
- 
                           You want to capture data definition language (DDL) changes to database objects. 
This section uses an example to describe how to switch from a synchronous capture to a capture process. Table 15-2 shows the Oracle Streams components in the sample environment before the switch and after the switch.
Table 15-2 Sample Switch From a Synchronous Capture to a Capture Process
| Oracle Streams Component | Before Switch | After Switch | 
|---|---|---|
| Synchronous Capture | 
 | None | 
| Synchronous Capture Rule Set | 
 | None | 
| Capture Process | None | 
 | 
| Capture Process Rule Set | None | 
 | 
| Propagation | 
 | 
 | 
| Propagation Rule Set | 
 | 
 | 
| Source Queue | 
 | 
 | 
| Destination Queue | 
 | 
 | 
| Apply Process | 
 | 
 | 
| Apply Process Rule Set | 
 | 
 | 
In Table 15-2, notice that the Oracle Streams environment uses the same rule sets before the switch and after the switch. Also, for the example in this section, assume that the source database is db1.example.com and the destination database is db2.example.com.
                     
Note:
The example in this section assumes that the Oracle Streams environment only involves two databases. If you are using a directed network to send changes through multiple databases, then you might need to configure additional propagations and queues for the new capture process stream of changes, and you might need to drop additional propagations and queues that were used by the synchronous capture stream.
To switch from a synchronous capture to a capture process, complete the following steps:
If you have a bi-directional replication environment, then you can perform these steps independently to switch from a synchronous capture to a capture process in both directions.