208 DBMS_XSTREAM_ADM
This DBMS_XSTREAM_ADM
package provides interfaces for streaming database changes between an Oracle database and other systems. XStream enables applications to stream out or stream in database changes.
This chapter contains the following topic:
208.1 DBMS_XSTREAM_ADM Overview
The package provides interfaces for configuring outbound servers that stream database changes from an Oracle database to other systems. The package also provides interfaces for configuring inbound servers that stream database changes from other systems to an Oracle database.
In both cases, the database changes are encapsulated in logical change records (LCRs). Also, the other systems can be Oracle systems or a non-Oracle systems, such as non-Oracle databases or file systems.
XStream outbound servers can stream out LCRs from an Oracle database programmatically using C or Java. After receiving the LCRs, the other system can process them in any customized way. For example, the other system can save the contents of the LCRs to a file, send the LCRs to an Oracle database through an XStream inbound server, or generate SQL statements and execute them on any Oracle or non-Oracle databases.
XStream inbound servers accept LCRs from another system and either apply them to an Oracle database or process them in a customized way using apply handlers.
XStream can be used in a multitenant container database (CDB). A CDB is an Oracle database that includes zero, one, or many user-created pluggable databases (PDBs).
See Also:
-
Oracle Database Concepts for more information about CDBs and PDBs
208.2 DBMS_XSTREAM_ADM Security Model
To ensure that the user who runs the subprograms in this package has the necessary privileges, configure an XStream administrator and connect as the XStream administrator when using this package.
An administrator must be granted the DBA
role when the administrator is performing any of the following actions:
-
Running the
ADD_OUTBOUND
procedure while connected as a user that is different from the configured connect user for an outbound server -
Running the
ALTER_OUTBOUND
procedure to change the capture user for a capture process or the connect user for an outbound server -
Running the
CREATE_OUTBOUND
procedure, because this procedure creates a capture process -
Running the
ALTER_INBOUND
procedure to change the apply user for an inbound server -
Running the
ADD_INBOUND
procedure while connected as a user that is different from the configured apply user for an inbound server
When the administrator does not need to perform the preceding tasks, the DBA
role is not required.
See Also:
-
Oracle Database XStream Guide, Chapter 4, "XStream Out and Security" for more information about XStream and security.
208.3 DBMS_XSTREAM_ADM Operational Notes
Some subprograms in the DBMS_APPLY_ADM
package can manage XStream outbound servers, and some subprograms in the DBMS_APPLY_ADM
package can manage XStream inbound servers.
See Also:
DBMS_APPLY_ADM for details about which subprograms can manage outbound servers and inbound servers
208.4 Summary of DBMS_XSTREAM_ADM Subprograms
This table lists the DBMS_XSTREAM_ADM
subprograms and briefly describes them.
Table 208-1 DBMS_XSTREAM_ADM Package Subprograms
Subprogram | Description |
---|---|
Either adds or removes a declarative rule-based transformation which adds a column to a row logical change record (row LCR) that satisfies the specified rule |
|
Either adds global rules to the positive rule set for a propagation, or adds global rules to the negative rule set for a propagation, and creates the specified propagation if it does not exist |
|
Adds global rules to either the positive or negative rule set of a capture process or apply process, and creates the specified capture process or apply process if it does not exist |
|
Creates an XStream outbound server that dequeues LCRs from the specified queue |
|
Either adds schema rules to the positive rule set for a propagation, or adds schema rules to the negative rule set for a propagation, and creates the specified propagation if it does not exist |
|
Adds rules to a rule set of XStream clients. |
|
Adds subset rules to an outbound server configuration |
|
Adds subset rules to the positive rule set for a propagation, and creates the specified propagation if it does not exist |
|
Adds subset rules to the positive rule set of a capture process or apply process, and creates the specified capture process or apply process if it does not exist |
|
Either adds table rules to the positive rule set for a propagation, or adds table rules to the negative rule set for a propagation, and creates the specified propagation if it does not exist |
|
This procedure adds rules to a rule set of an XStream client. |
|
Modifies an XStream inbound server |
|
Modifies an XStream outbound server |
|
Creates an XStream inbound server and its queue |
|
Creates an XStream outbound server, queue, and capture process to enable XStream client applications to stream out Oracle database changes encapsulated in LCRs |
|
Either adds or removes a declarative rule-based transformation which deletes a column from a row LCR that satisfies the specified rule |
|
Removes an inbound server configuration |
|
Removes an outbound server configuration |
|
Enables XStream performance optimizations for Oracle Replication components |
|
Returns the tracking label for the current session |
|
Gets the binary tag for all redo entries generated by the current session |
|
Returns |
|
Either adds or removes a declarative rule-based transformation which keeps a list of columns in a row LCR that satisfies the specified rule |
|
Merges a stream flowing from one capture process with a stream flowing from another capture process |
|
Determines whether the original capture process and the cloned capture are within the specified merge threshold and, if they are, runs the |
|
Removes all Oracle Replication data dictionary information at the local database for the specified object |
|
Provides options for a split and merge operation that stopped because it encountered an error. This procedure either rolls forward the operation, rolls back the operation, or purges all of the metadata about the operation. |
|
Removes the specified |
|
Removes the specified rule or all rules from the rule set associated with the specified capture process, apply process, or propagation. |
|
Removes subset rules from an outbound server configuration |
|
Removes the XStream configuration at the local database |
|
Either adds or removes a declarative rule-based transformation which renames a column in a row LCR that satisfies the specified rule |
|
Either adds or removes a declarative rule-based transformation which renames a schema in a row LCR that satisfies the specified rule |
|
Either adds or removes a declarative rule-based transformation which renames a table in a row LCR that satisfies the specified rule |
|
Sets the tracking label for logical change records (LCRs) produced by the current session |
|
Sets a parameter for an outbound server, an inbound server, or an outbound server's capture process |
|
Sets the binary tag for all redo entries subsequently generated by the current session |
|
Creates a queue table and a queue for use with the capture, propagate, and apply functionality of XStream |
|
Splits one stream flowing from a capture process off from all of the other streams flowing from the capture process |
|
Starts an XStream outbound server |
|
Stops an XStream outbound server |
Note:
All subprograms commit unless specified otherwise.
208.4.1 ADD_COLUMN Procedure
This procedure either adds or removes a declarative rule-based transformation which adds a column to a row logical change record (row LCR) that satisfies the specified rule.
For the transformation to be performed when the specified rule evaluates to TRUE
, the rule must be in the positive rule set of an XStream client. XStream clients include capture processes, propagations, and apply processes.
This procedure is overloaded. The column_value
and column_function
parameters are mutually exclusive.
Note:
-
ADD_COLUMN
transformations cannot add columns of the following data types:BLOB
,CLOB
,NCLOB
,BFILE
,LONG
,LONG
RAW
,ROWID
, user-defined types (including object types,REF
s, varrays, nested tables), and Oracle-supplied types (including any types, XML types, spatial types, and media types). -
Declarative transformations can transform row LCRs only. Therefore, a DML rule must be specified when you run this procedure. If a DDL rule is specified, then the procedure raises an error.
See Also:
Oracle Database XStream Guide for more information about declarative rule-based transformations
Syntax
DBMS_XSTREAM_ADM.ADD_COLUMN( rule_name IN VARCHAR2, table_name IN VARCHAR2, column_name IN VARCHAR2, column_value IN ANYDATA, value_type IN VARCHAR2 DEFAULT 'NEW', step_number IN NUMBER DEFAULT 0, operation IN VARCHAR2 DEFAULT 'ADD');
DBMS_XSTREAM_ADM.ADD_COLUMN( rule_name IN VARCHAR2, table_name IN VARCHAR2, column_name IN VARCHAR2, column_function IN VARCHAR2, value_type IN VARCHAR2 DEFAULT 'NEW', step_number IN NUMBER DEFAULT 0, operation IN VARCHAR2 DEFAULT 'ADD');
Parameters
Table 208-2 ADD_COLUMN Procedure Parameters
Parameter | Description |
---|---|
|
The name of the rule, specified as For example, to specify a rule in the |
|
The name of the table to which the column is added in the row LCR, specified as |
|
The name of the column added to each row LCR that satisfies the rule. |
|
The value of the added column. Specify the appropriate This parameter cannot be specified if the |
|
Either the The The The function executes when the rule evaluates to This parameter cannot be specified if the |
|
Specify Specify |
|
The order of execution of the transformation. See Also: Oracle Database XStream Guide for more information about transformation ordering |
|
Specify Specify |
Usage Notes
When 'REMOVE'
is specified for the operation
parameter, all of the add column declarative rule-based transformations for the specified rule are removed that match the specified table_name
, column_name
, and step_number
parameters. Nulls specified for these parameters act as wildcards. The following table lists the behavior of the ADD_COLUMN
procedures when one or more of these parameters is NULL
:
table_name | column_name | step_number | Result |
---|---|---|---|
|
|
|
Remove all add column transformations for the specified rule. |
|
|
non- |
Remove all add column transformations with the specified |
|
non- |
non- |
Remove all add column transformations with the specified |
non- |
|
|
Remove all add column transformations with the specified |
|
|
|
Remove all add column transformations with the specified |
non- |
non- |
|
Remove all add column transformations with the specified |
non- |
|
|
Remove all add column transformations with the specified |
non- |
non- |
non- |
Remove all add column transformations with the specified |
208.4.2 ADD_GLOBAL_PROPAGATION_RULES Procedure
This procedure either adds global rules to the positive rule set for a propagation, or adds global rules to the negative rule set for a propagation, and creates the specified propagation if it does not exist.
This procedure is overloaded. One version of this procedure contains two OUT
parameters, and the other does not.
Syntax
DBMS_XSTREAM_ADM.ADD_GLOBAL_PROPAGATION_RULES( streams_name IN VARCHAR2 DEFAULT NULL, source_queue_name IN VARCHAR2, destination_queue_name IN VARCHAR2, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, dml_rule_name OUT VARCHAR2, ddl_rule_name OUT VARCHAR2, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, queue_to_queue IN BOOLEAN DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_GLOBAL_PROPAGATION_RULES( streams_name IN VARCHAR2 DEFAULT NULL, source_queue_name IN VARCHAR2, destination_queue_name IN VARCHAR2, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, queue_to_queue IN BOOLEAN DEFAULT NULL);
Parameters
Table 208-3 ADD_GLOBAL_PROPAGATION_RULES Procedure Parameters
Parameter | Description |
---|---|
|
The name of the propagation. Do not specify an owner. If the specified propagation does not exist, then the procedure creates it automatically. If If |
|
The name of the source queue, specified as For example, to specify a source queue named If the schema is not specified, then the current user is the default. |
|
The name of the destination queue, including a database link, specified as For example, to specify a destination queue named If the schema is not specified, then the current user is the default. If the database link is omitted, then the procedure uses the global name of the current database, and the source queue and destination queue must be in the same database. Note: Connection qualifiers are not allowed. |
|
If |
|
If |
|
If If Usually, specify |
|
The global name of the source database. The source database is where the changes originated. If If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Oracle recommends that you specify a source database for propagation rules. |
|
If If |
|
If If |
|
If If In either case, the system creates the rule set if it does not exist. |
|
If non- (system_condition) AND (and_condition) The variable in the specified condition must be :lcr.get_tag() = HEXTORAW(''02'') The Specifically, if you specify an LCR member subprogram that is valid only for row LCRs, then specify See Also: Logical Change Record TYPEs |
|
If If The procedure cannot change the queue to queue property of an exiting propagation. If the specified propagation exists, then the procedure behaves in the following way for each setting:
|
Usage Notes
This procedure configures propagation using the current user. Only one propagation is allowed between a particular source queue and destination queue.
This procedure creates DML and DDL rules automatically based on include_dml
and include_ddl
parameter values, respectively. Each rule has a system-generated rule name that consists of the database name with a sequence number appended to it. The sequence number is used to avoid naming conflicts. If the database name plus the sequence number is too long, then the database name is truncated. A propagation uses the rules for filtering.
Examples
The following is an example of a global rule condition created for DML changes:
(:dml.is_null_tag() = 'Y' and :dml.get_source_database_name() = 'DBS1.NET' )
208.4.3 ADD_GLOBAL_RULES Procedure
This procedure adds rules to an XStream clients rule set.
It adds rules to a rule set of one of the following types of XStream clients:
-
When the
streams_type
parameter is set tocapture
, this procedure adds capture process rules for capturing changes to an entire database.This procedure creates the specified capture process if it does not exist.
-
When the
streams_type
parameter is set toapply
and thestreams_name
parameter specifies the name of an apply process, outbound server, or inbound server, this procedure adds apply rules for applying all logical change records (LCRs) it receives. The rules can specify that the LCRs must be from a particular source database.This procedure creates an apply process if no apply process, outbound server, or inbound server exists with the specified
streams_name
. This procedure can add rules to an outbound server or inbound server, but it cannot create an outbound server or inbound server.
This procedure is overloaded. One version of this procedure contains two OUT
parameters, and the other does not.
Note:
If you add global rules to the positive rule set for a capture process, then make sure you add rules to the negative capture process rule set to exclude database objects that are not supported by Oracle Replication. Query the DBA_XSTREAM_OUT_SUPPORT_MODE
data dictionary view to determine which database objects are not supported by Oracle Replication. If unsupported database objects are not excluded, then capture errors will result.
Syntax
DBMS_XSTREAM_ADM.ADD_GLOBAL_RULES( streams_type IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT 'streams_queue', include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, dml_rule_name OUT VARCHAR2, ddl_rule_name OUT VARCHAR2, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_GLOBAL_RULES( streams_type IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT 'streams_queue', include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-4 ADD_GLOBAL_RULES Procedure Parameters
Parameter | Description |
---|---|
|
The type of XStream client:
|
|
The name of the capture process or apply process. Do not specify an owner. If If
If If Each apply process must have a unique name. |
|
The name of the local queue, specified as For example, to specify a queue named For capture process rules, this is the queue into which a capture process enqueues LCRs. For outbound server rules, this is the queue from which the outbound server dequeues LCRs. For inbound server rules, this is the queue into which an inbound server enqueues error transactions. |
|
If |
|
If |
|
If If Usually, specify |
|
The global name of the source database. If For capture process rules, specify For apply process rules, specify the source database of the changes that will be applied by the apply process. The source database is the database where the changes originated. If an apply process applies captured LCRs, then the apply process can apply LCRs from only one capture process at one source database. In a CDB, specify the global name of the container to which the rules pertain. The container can be the root or a PDB. For example, If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify |
|
If If |
|
If If |
|
If If In either case, the system creates the rule set if it does not exist. |
|
If non- (system_condition) AND (and_condition) The variable in the specified condition must be :lcr.get_tag() = HEXTORAW(''02'') The Specifically, if you specify an LCR member subprogram that is valid only for row LCRs, then specify See Also: Logical Change Record TYPEs |
|
The global name of the root in the source CDB. For example, If this parameter is If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Note: This parameter only applies to a CDB. |
|
The short name of the source container. The container can be the root or a PDB. For example, Note: This parameter only applies to a CDB. |
Usage Notes
This procedure creates DML and DDL rules automatically based on include_dml
and include_ddl
parameter values, respectively. Each rule has a system-generated rule name that consists of the database name with a sequence number appended to it. The sequence number is used to avoid naming conflicts. If the database name plus the sequence number is too long, then the database name is truncated. A capture process or apply process uses the rules for filtering.
See Also:
Examples
The following is an example of a global rule condition created for DML changes:
(:dml.is_null_tag() = 'Y' and :dml.get_source_database_name() = 'DBS1.NET' )
208.4.4 ADD_OUTBOUND Procedure
This procedure creates an XStream outbound server that dequeues LCRs from the specified queue. The outbound server streams out the LCRs to an XStream client application.
This procedure creates neither a capture process nor a queue. To create an outbound server, a capture process, and a queue with one procedure call, use the CREATE_OUTBOUND Procedure.
To create the capture process individually, use one of the following packages:
-
DBMS_XSTREAM_ADM
-
DBMS_CAPTURE_ADM
To create a queue individually, use the SET_UP_QUEUE
procedure in the DBMS_XSTREAM_ADM
package.
This procedure is overloaded. One table_names
parameter is type VARCHAR2
and the other table_names
parameter is type DBMS_UTILITY.UNCL_ARRAY
. Also, one schema_names
parameter is type VARCHAR2
and the other schema_names
parameter is type DBMS_UTILITY.UNCL_ARRAY
. These parameters enable you to enter the lists of tables and schemas in different ways and are mutually exclusive.
Note:
-
A client application can create multiple sessions. Each session can attach to only one outbound server, and each outbound server can serve only one session at a time. However, different client application sessions can connect to different outbound servers. See Oracle Call Interface Programmer's Guide and Oracle Database XStream Java API Reference for information about attaching to an outbound server.
-
This procedure enables the outbound server that it creates.
-
Starting with Oracle Database 11g Release 2 (11.2.0.2), the
capture_name
,start_scn
, andstart_time
parameters are included in this procedure.
Syntax
DBMS_XSTREAM_ADM.ADD_OUTBOUND( server_name IN VARCHAR2, queue_name IN VARCHAR2 DEFAULT NULL, source_database IN VARCHAR2 DEFAULT NULL, table_names IN DBMS_UTILITY.UNCL_ARRAY, schema_names IN DBMS_UTILITY.UNCL_ARRAY, connect_user IN VARCHAR2 DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL, capture_name IN VARCHAR2 DEFAULT NULL, start_scn IN NUMBER DEFAULT NULL, start_time IN TIMESTAMP DEFAULT NULL, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL, lcrid_version IN NUMBER DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_OUTBOUND( server_name IN VARCHAR2, queue_name IN VARCHAR2 DEFAULT NULL, source_database IN VARCHAR2 DEFAULT NULL, table_names IN VARCHAR2 DEFAULT NULL, schema_names IN VARCHAR2 DEFAULT NULL, connect_user IN VARCHAR2 DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL, capture_name IN VARCHAR2 DEFAULT NULL, start_scn IN NUMBER DEFAULT NULL, start_time IN TIMESTAMP DEFAULT NULL, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL, lcrid_version IN NUMBER DEFAULT NULL);
Parameters
Table 208-5 ADD_OUTBOUND Procedure Parameters
Parameter | Description |
---|---|
|
The name of the outbound server being created. A The specified name must not match the name of an existing outbound server, inbound server, apply process, or messaging client. Note: The |
|
The name of the local queue from which the outbound server dequeues LCRs, specified as For example, to specify a queue named If |
|
The global name of the source database. If In a CDB, specify the global name of the container to which the rules pertain. The container can be the root or a PDB. For example, If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify |
|
The tables for which data manipulation language (DML) and data definition language (DDL) changes are streamed out to the XStream client application. The tables can be specified in the following ways:
Each table should be specified as See Also: "Usage Notes" for more information about this parameter |
|
The schemas for which DML and DDL changes are streamed out to the XStream client application. The schemas can be specified in the following ways:
Note: This procedure does not concatenate the See Also: "Usage Notes" for more information about this parameter |
|
The user who can attach to the specified outbound server to retrieve the LCR stream. The client application must attach to the outbound server as the specified connect user. See "CREATE_OUTBOUND Procedure" for information about the privileges required by a connect user. If |
|
An optional comment associated with the outbound server. |
|
The name of the capture process configured to capture changes for the outbound server. Do not specify an owner. If the specified name matches the name of an existing capture process for another outbound server, then the procedure uses the existing capture process and adds the rules for capturing changes to the database to the positive capture process rule set. If the specified name matches the name of an existing capture process for an apply process, then an error is raised. If the specified name does not match the name of an existing capture process, then an error is raised. If |
|
A valid system change number (SCN) for the database from which the capture process starts capturing changes. If the If An error is returned if an invalid SCN is specified. The |
|
A valid time from which the capture process starts capturing changes. If the If The |
|
If |
|
If |
|
The global name of the root in the source CDB. For example, If this parameter is If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Note: This parameter only applies to a CDB. |
|
The short name of the source container. The container can be the root or a PDB. For example, Note: This parameter only applies to a CDB. |
|
The LCRID version for captured LCRs, either If If If |
Usage Notes
The following list describes the behavior of the outbound server for various combinations of the table_names
and schema_names
parameters:
-
If both the
table_names
andschema_names
parameters areNULL
or empty, then the outbound server streams all DML and DDL changes to the client application.This procedure is overloaded. The
table_names
andschema_names
parameters are defaulted toNULL
. Do not specifyNULL
for bothtable_names
andschema_names
in the same call; otherwise, errorPLS-00307
is returned. -
If both the
table_names
andschema_names
parameters are specified, then the outbound server streams DML and DDL changes for the specified tables and schemas. -
If the
table_names
parameter is specified and theschema_names
parameter isNULL
or empty, then the outbound server streams DML and DDL changes for the specified tables. -
If the
table_names
parameter isNULL
or empty and theschema_names
parameter is specified, then the outbound server streams DML and DDL changes for the specified schemas.
For the procedure that uses the DBMS_UTILITY.UNCL_ARRAY
type for the table_names
and schema_names
parameters, both parameters must be specified. To specify only tables, the schema_names
parameter must be specified and empty. To specify only schemas, the table_names
parameter must be specified and empty.
Note:
An empty array includes one NULL
entry.
208.4.5 ADD_SCHEMA_PROPAGATION_RULES Procedure
This procedure either adds schema rules to the positive rule set for a propagation, or adds schema rules to the negative rule set for a propagation, and creates the specified propagation if it does not exist.
This procedure is overloaded. One version of this procedure contains two OUT
parameters, and the other does not.
Syntax
DBMS_XSTREAM_ADM.ADD_SCHEMA_PROPAGATION_RULES( schema_name IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, source_queue_name IN VARCHAR2, destination_queue_name IN VARCHAR2, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, dml_rule_name OUT VARCHAR2, ddl_rule_name OUT VARCHAR2, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, queue_to_queue IN BOOLEAN DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_SCHEMA_PROPAGATION_RULES( schema_name IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, source_queue_name IN VARCHAR2, destination_queue_name IN VARCHAR2, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, queue_to_queue IN BOOLEAN DEFAULT NULL);
Parameters
Table 208-6 ADD_SCHEMA_PROPAGATION_RULES Procedure Parameters
Parameter | Description |
---|---|
|
The name of the schema. For example, |
|
The name of the propagation. Do not specify an owner. If the specified propagation does not exist, then the procedure creates it automatically. If If |
|
The name of the source queue, specified as For example, to specify a source queue named If the schema is not specified, then the current user is the default. |
|
The name of the destination queue, including a database link, specified as For example, to specify a destination queue named If the schema is not specified, then the current user is the default. If the database link is omitted, then the procedure uses the global name of the current database, and the source queue and destination queue must be in the same database. Note: Connection qualifiers are not allowed. |
|
If |
|
If |
|
If If Usually, specify |
|
The global name of the source database. The source database is where the change originated. If If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Oracle recommends that you specify a source database for propagation rules. |
|
If If |
|
If If |
|
If If In either case, the system creates the rule set if it does not exist. |
|
If non- (system_condition) AND (and_condition) The variable in the specified condition must be :lcr.get_tag() = HEXTORAW(''02'') The Specifically, if you specify an LCR member subprogram that is valid only for row LCRs, then specify See Also: Logical Change Record TYPEs |
|
If If This procedure cannot change the queue to queue property of an exiting propagation. If the specified propagation exists, then the procedure behaves in the following way for each setting:
|
Usage Notes
This procedure configures propagation using the current user. Only one propagation is allowed between a particular source queue and destination queue.
This procedure creates DML and DDL rules automatically based on include_dml
and include_ddl
parameter values, respectively. Each rule has a system-generated rule name that consists of the schema name with a sequence number appended to it. The sequence number is used to avoid naming conflicts. If the schema name plus the sequence number is too long, then the schema name is truncated. A propagation uses the rules for filtering.
Examples
The following is an example of a schema rule condition created for DML changes:
((:dml.get_object_owner() = 'HR') and :dml.is_null_tag() = 'Y' and :dml.get_source_database_name() = 'DBS1.NET' )
208.4.6 ADD_SCHEMA_RULES Procedure
This procedures adds rules to a rule set of one of the following types of XStream clients:
-
When the
streams_type
parameter is set tocapture
, this procedure adds capture process rules for capturing changes to a specified schema.This procedure creates the specified capture process if it does not exist.
-
When the
streams_type
parameter is set toapply
and thestreams_name
parameter specifies the name of an apply process, outbound server, or inbound server, this procedure adds apply rules for applying logical change records (LCRs) that contain changes to a specified schema. The rules can specify that the LCRs must be from a particular source database.This procedure creates an apply process if no apply process, outbound server, or inbound server exists with the specified
streams_name
. This procedure can add rules to an outbound server or inbound server, but it cannot create an outbound server or inbound server.
This procedure is overloaded. One version of this procedure contains two OUT
parameters, and the other does not.
Note:
If you add schema rules to the positive rule set for a capture process, then make sure you add rules to the negative capture process rule set to exclude database objects in the schema that are not supported by Oracle Replication. Query the DBA_XSTREAM_OUT_SUPPORT_MODE
data dictionary view to determine which database objects are not supported by Oracle Replication. If unsupported database objects are not excluded, then capture errors will result.
Syntax
DBMS_XSTREAM_ADM.ADD_SCHEMA_RULES( schema_name IN VARCHAR2, streams_type IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT 'streams_queue', include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, dml_rule_name OUT VARCHAR2, ddl_rule_name OUT VARCHAR2, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_SCHEMA_RULES( schema_name IN VARCHAR2, streams_type IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT 'streams_queue', include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-7 ADD_SCHEMA_RULES Procedure Parameters
Parameter | Description |
---|---|
|
The name of the schema. For example, You can specify a schema that does not yet exist, because Oracle Replication does not validate the existence of the schema. |
|
The type of XStream client:
|
|
The name of the capture process or apply process. Do not specify an owner. If If
If If Each apply process must have a unique name. |
|
The name of the local queue, specified as For example, to specify a queue named For capture process rules, this is the queue into which a capture process enqueues LCRs. For outbound server rules, this is the queue from which the outbound server dequeues LCRs. For inbound server rules, this is the queue into which an inbound server enqueues error transactions. |
|
If |
|
If |
|
If If Usually, specify |
|
The global name of the source database. If For capture process rules, specify For apply process rules, specify the source database of the changes that will be applied by the apply process. The source database is the database where the changes originated. If an apply process applies captured LCRs, then the apply process can apply LCRs from only one capture process at one source database. In a CDB, specify the global name of the container to which the rules pertain. The container can be the root or a PDB. For example, If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify |
|
If If |
|
If If |
|
If If In either case, the system creates the rule set if it does not exist. |
|
If non- (system_condition) AND (and_condition) The variable in the specified condition must be :lcr.get_tag() = HEXTORAW(''02'') The Specifically, if you specify an LCR member subprogram that is valid only for row LCRs, then specify See Also: Logical Change Record TYPEs |
|
The global name of the root in the source CDB. For example, If this parameter is If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Note: This parameter only applies to a CDB. |
|
The short name of the source container. The container can be the root or a PDB. For example, Note: This parameter only applies to a CDB. |
Usage Notes
This procedure creates DML and DDL rules automatically based on include_dml
and include_ddl
parameter values, respectively. Each rule has a system-generated rule name that consists of the schema name with a sequence number appended to it. The sequence number is used to avoid naming conflicts. If the schema name plus the sequence number is too long, then the schema name is truncated. A capture process or apply process uses the rules for filtering.
See Also:
Examples
The following is an example of a schema rule condition created for DML changes:
((:dml.get_object_owner() = 'HR') and :dml.is_null_tag() = 'Y' and :dml.get_source_database_name() = 'DBS1.NET' )
208.4.7 ADD_SUBSET_OUTBOUND_RULES Procedure
This procedure adds subset rules to an outbound server configuration. Subset rules instruct the outbound server to stream out a subset of the changes to the specified tables. Outbound servers can stream out a subset of both rows and columns.
This procedure is overloaded. One column_list
parameter is type VARCHAR2
and the other column_list
parameter is type DBMS_UTILITY.LNAME_ARRAY
. These parameters enable you to enter the list of columns in different ways and are mutually exclusive.
Note:
This procedure does not add rules to the outbound server's capture process.
Syntax
DBMS_XSTREAM_ADM.ADD_SUBSET_OUTBOUND_RULES( server_name IN VARCHAR2, table_name IN VARCHAR2, condition IN VARCHAR2 DEFAULT NULL, column_list IN DBMS_UTILITY.LNAME_ARRAY, keep IN BOOLEAN DEFAULT TRUE, source_database IN VARCHAR2 DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_SUBSET_OUTBOUND_RULES( server_name IN VARCHAR2, table_name IN VARCHAR2, condition IN VARCHAR2 DEFAULT NULL, column_list IN VARCHAR2 DEFAULT NULL, keep IN BOOLEAN DEFAULT TRUE, source_database IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-8 ADD_SUBSET_OUTBOUND_RULES Procedure Parameters
Parameter | Description |
---|---|
|
The name of the outbound server to which rules are being added. Specify an existing outbound server. Do not specify an owner. |
|
The name of the table specified as If the outbound server configuration uses a local capture process, then the table must exist at the local source database. If the outbound server configuration uses a downstream capture process, then the table must exist at both the source database and at the downstream capture database. The specified table cannot have any LOB, |
|
The subset condition. Specify this condition similar to the way you specify conditions in a For example, to specify rows in the
If Note: The quotation marks in the preceding example are all single quotation marks. |
|
The list of columns either to include in the outbound server configuration or to exclude from the outbound server configuration. Whether the columns are included or excluded depends on the setting for the The columns can be specified in the following ways:
To include or exclude all of the columns in a table, specify each column in the table in the list or array. If |
|
If If See Also: "Usage Notes" |
|
The global name of the container where the specified If non- In a CDB, specify the global name of the container to which the rules pertain. The container can be the root or a PDB. For example, If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify |
Usage Notes
When the keep
parameter is set to TRUE
, this procedure creates a keep columns declarative rule-based transformation for the columns listed in column_list
.
When the keep
parameter is set to FALSE
, this procedure creates a delete column declarative rule-based transformation for each column listed in column_list
.
See Also:
Oracle Database XStream Guide for information about declarative rule-based transformations
208.4.8 ADD_SUBSET_PROPAGATION_RULES Procedure
This procedures adds propagation rules that propagate the logical change records (LCRs) related to a subset of the rows in the specified table in a source queue to a destination queue, and creates the specified propagation if it does not exist.
This procedure is overloaded. One version of this procedure contains three OUT
parameters, and the other does not.
Syntax
DBMS_XSTREAM_ADM.ADD_SUBSET_PROPAGATION_RULES( table_name IN VARCHAR2, dml_condition IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, source_queue_name IN VARCHAR2, destination_queue_name IN VARCHAR2, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, insert_rule_name OUT VARCHAR2, update_rule_name OUT VARCHAR2, delete_rule_name OUT VARCHAR2, queue_to_queue IN BOOLEAN DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_SUBSET_PROPAGATION_RULES( table_name IN VARCHAR2, dml_condition IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, source_queue_name IN VARCHAR2, destination_queue_name IN VARCHAR2, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, queue_to_queue IN BOOLEAN DEFAULT NULL);
Parameters
Table 208-9 ADD_SUBSET_PROPAGATION_RULES Procedure Parameters
Parameter | Description |
---|---|
|
The name of the table specified as The specified table must exist in the same database as the propagation. Also, the specified table cannot have any LOB, |
|
The subset condition. Specify this condition similar to the way you specify conditions in a For example, to specify rows in the
Note: The quotation marks in the preceding example are all single quotation marks. |
|
The name of the propagation. Do not specify an owner. If the specified propagation does not exist, then the procedure creates it automatically. If If |
|
The name of the source queue, specified as For example, to specify a source queue named If the schema is not specified, then the current user is the default. |
|
The name of the destination queue, including a database link, specified as For example, to specify a destination queue named If the schema is not specified, then the current user is the default. If the database link is omitted, then the procedure uses the global name of the current database, and the source queue and destination queue must be in the same database. Note: Connection qualifiers are not allowed. |
|
If If |
|
The global name of the source database. The source database is where the change originated. If If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Oracle recommends that you specify a source database for propagation rules. |
|
Contains the system-generated |
|
Contains the system-generated |
|
Contains the system-generated |
|
If If This procedure cannot change the queue to queue property of an exiting propagation. If the specified propagation exists, then the procedure behaves in the following way for each setting:
|
Usage Notes
This procedure configures propagation using the current user. Only one propagation is allowed between a particular source queue and destination queue.
Running this procedure generates three rules for the specified propagation: one for INSERT
statements, one for UPDATE
statements, and one for DELETE
statements. For INSERT
and DELETE
statements, only row LCRs that satisfy the condition specified for the dml_condition
parameter are propagated. For UPDATE
statements, the following variations are possible:
-
If both the new and old values in a row LCR satisfy the specified
dml_condition
, then the row LCR is propagated without any changes. -
If neither the new or old values in a row LCR satisfy the specified
dml_condition
, then the row LCR is not propagated. -
If the old values for a row LCR satisfy the specified
dml_condition
, but the new values do not, then the update row LCR is converted into a delete row LCR. -
If the new values for a row LCR satisfy the specified
dml_condition
, but the old values do not, then the update row LCR is converted to an insert row LCR.
When an update is converted into an insert or a delete, it is called row migration.
A propagation uses the rules for filtering. If the propagation does not have a positive rule set, then the procedure creates a positive rule set automatically, and the rules for propagating changes to the table are added to the positive rule set. A subset rule can be added to positive rule set only, not to a negative rule set. Other rules in an existing positive rule set for the propagation are not affected. Additional rules can be added using either the DBMS_XSTREAM_ADM
package or the DBMS_RULE_ADM
package.
Rules for INSERT
, UPDATE
, and DELETE
statements are created automatically when you run this procedure, and these rules are given a system-generated rule name. Each rule has a system-generated rule name that consists of the table name with a sequence number appended to it. The sequence number is used to avoid naming conflicts. If the table name plus the sequence number is too long, then the table name is truncated. The ADD_SUBSET_RULES
procedure is overloaded, and the system-generated rule names for INSERT
, UPDATE
, and DELETE
statements are returned.
When you create propagation subset rules for a table, you should create an unconditional supplemental log group at the source database with all the columns in the table. Supplemental logging is required if an update must be converted to an insert. The propagation rule must have all the column values to be able to perform this conversion correctly.
Note:
Subset rules should only reside in positive rule sets. You should not add subset rules to negative rule sets. Doing so might have unpredictable results because row migration would not be performed on LCRs that are not discarded by the negative rule set.
Examples
The following is an example of a rule condition created for filtering a row LCR containing an update operation when the dml_condition
is region_id = 2
, the table_name
is hr.regions
, and the source_database
is dbs1.net
:
:dml.get_object_owner()='HR' AND :dml.get_object_name()='REGIONS' AND :dml.is_null_tag()='Y' AND :dml.get_source_database_name()='DBS1.NET' AND :dml.get_command_type()='UPDATE' AND (:dml.get_value('NEW','"REGION_ID"') IS NOT NULL) AND (:dml.get_value('OLD','"REGION_ID"') IS NOT NULL) AND (:dml.get_value('OLD','"REGION_ID"').AccessNumber()=2) AND (:dml.get_value('NEW','"REGION_ID"').AccessNumber()=2)
208.4.9 ADD_SUBSET_RULES Procedure
This procedure adds rules to an XStream client.
It adds rules to a rule set of one of the following types of XStream clients:
-
When the
streams_type
parameter is set tocapture
, this procedure adds capture process rules for capturing changes to a subset of rows in a specified table.This procedure creates the specified capture process if it does not exist.
-
When the
streams_type
parameter is set toapply
and thestreams_name
parameter specifies the name of an apply process, outbound server, or inbound server, this procedure adds apply rules for applying logical change records (LCRs) that contain changes to a subset of rows in a specified table. The rules can specify that the LCRs must be from a particular source database.This procedure creates an apply process if no apply process, outbound server, or inbound server exists with the specified
streams_name
. This procedure can add rules to an outbound server or inbound server, but it cannot create an outbound server or inbound server.
This procedure is overloaded. One version of this procedure contains three OUT
parameters, and the other does not.
Syntax
DBMS_XSTREAM_ADM.ADD_SUBSET_RULES( table_name IN VARCHAR2, dml_condition IN VARCHAR2, streams_type IN VARCHAR2 DEFAULT 'apply', streams_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT 'streams_queue', include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, insert_rule_name OUT VARCHAR2, update_rule_name OUT VARCHAR2, delete_rule_name OUT VARCHAR2, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_SUBSET_RULES( table_name IN VARCHAR2, dml_condition IN VARCHAR2, streams_type IN VARCHAR2 DEFAULT 'apply', streams_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT 'streams_queue', include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-10 ADD_SUBSET_RULES Procedure Parameters
Parameter | Description |
---|---|
|
The name of the table specified as The specified table must exist in the same database as the capture process or apply process. Also, the specified table cannot have any LOB, |
|
The subset condition. Specify this condition similar to the way you specify conditions in a For example, to specify rows in the
Note: The quotation marks in the preceding example are all single quotation marks. |
|
The type of XStream client:
|
|
The name of the capture process or apply process. Do not specify an owner. If If
If If Each apply process must have a unique name. |
|
The name of the local queue, specified as For example, to specify a queue named For capture process rules, this is the queue into which a capture process enqueues LCRs. For outbound server rules, this is the queue from which the outbound server dequeues LCRs. For inbound server rules, this is the queue into which an inbound server enqueues error transactions. |
|
If
If
A setting of |
|
The global name of the source database. If For capture process rules, specify For apply process rules, specify the source database of the changes that will be applied by the apply process. The source database is the database where the changes originated. If an apply process applies captured LCRs, then the apply process can apply LCRs from only one capture process at one source database. In a CDB, specify the global name of the container to which the rules pertain. The container can be the root or a PDB. For example, If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify |
|
Contains the system-generated |
|
Contains the system-generated |
|
Contains the system-generated |
|
The global name of the root in the source CDB. For example, If this parameter is If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Note: This parameter only applies to a CDB. |
|
The short name of the source container. The container can be the root or a PDB. For example, Note: This parameter only applies to a CDB. |
Usage Notes
Running this procedure generates three rules for the specified capture process or apply process: one for INSERT
statements, one for UPDATE
statements, and one for DELETE
statements. For INSERT
and DELETE
statements, only DML changes that satisfy the condition specified for the dml_condition
parameter are captured or applied. For UPDATE
statements, the following variations are possible:
-
If both the new and old values in a DML change satisfy the specified
dml_condition
, then the DML change is captured or applied without any changes. -
If neither the new or old values in a DML change satisfy the specified
dml_condition
, then the DML change is not captured or applied. -
If the old values for a DML change satisfy the specified
dml_condition
, but the new values do not, then the DML change is converted into a delete. -
If the new values for a DML change satisfy the specified
dml_condition
, but the old values do not, then the DML change is converted to an insert.
When an update is converted into an insert or a delete, it is called row migration.
A capture process or apply process uses the rules for filtering. If the XStream client does not have a positive rule set, then this procedure creates a positive rule set automatically, and adds the rules for the table to the positive rule set. A subset rule can be added to positive rule set only, not to a negative rule set. Other rules in an existing rule set for the process are not affected. Additional rules can be added using either the DBMS_XSTREAM_ADM
package or the DBMS_RULE_ADM
package.
Rules for INSERT
, UPDATE
, and DELETE
statements are created automatically when you run this procedure, and these rules are given a system-generated rule name. Each rule has a system-generated rule name that consists of the table name with a sequence number appended to it. The sequence number is used to avoid naming conflicts. If the table name plus the sequence number is too long, then the table name is truncated. The ADD_SUBSET_RULES
procedure is overloaded, and the system-generated rule names for INSERT
, UPDATE
, and DELETE
statements are returned.
Note:
Subset rules should only reside in positive rule sets. You should not add subset rules to negative rule sets. Doing so might have unpredictable results because row migration would not be performed on LCRs that are not discarded by the negative rule set.
Examples
The following is an example of a rule condition created for filtering DML changes containing an update operation when the dml_condition
is region_id = 2
, the table_name
is hr.regions
, and the source_database
is dbs1.net
:
:dml.get_object_owner()='HR' AND :dml.get_object_name()='REGIONS' AND :dml.is_null_tag()='Y' AND :dml.get_source_database_name()='DBS1.NET' AND :dml.get_command_type()='UPDATE' AND (:dml.get_value('NEW','"REGION_ID"') IS NOT NULL) AND (:dml.get_value('OLD','"REGION_ID"') IS NOT NULL) AND (:dml.get_value('OLD','"REGION_ID"').AccessNumber()=2) AND (:dml.get_value('NEW','"REGION_ID"').AccessNumber()=2)
208.4.10 ADD_TABLE_PROPAGATION_RULES Procedure
This procedures adds table rules to the positive rule set for a propagation, or adds table rules to the negative rule set for a propagation, and creates the specified propagation if it does not exist.
This procedure is overloaded. One version of this procedure contains two OUT
parameters, and the other does not.
Syntax
DBMS_XSTREAM_ADM.ADD_TABLE_PROPAGATION_RULES( table_name IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, source_queue_name IN VARCHAR2, destination_queue_name IN VARCHAR2, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, dml_rule_name OUT VARCHAR2, ddl_rule_name OUT VARCHAR2, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, queue_to_queue IN BOOLEAN DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_TABLE_PROPAGATION_RULES( table_name IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, source_queue_name IN VARCHAR2, destination_queue_name IN VARCHAR2, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, queue_to_queue IN BOOLEAN DEFAULT NULL);
Parameters
Table 208-11 ADD_TABLE_PROPAGATION_RULES Procedure Parameters
Parameter | Description |
---|---|
|
The name of the table specified as |
|
The name of the propagation. Do not specify an owner. If the specified propagation does not exist, then the procedure creates it automatically. If If |
|
The name of the source queue, specified as For example, to specify a source queue named If the schema is not specified, then the current user is the default. |
|
The name of the destination queue, including a database link, specified as For example, to specify a destination queue named If the schema is not specified, then the current user is the default. If the database link is omitted, then the procedure uses the global name of the current database, and the source queue and destination queue must be in the same database. Note: Connection qualifiers are not allowed. |
|
If |
|
If The generated rule evaluates to |
|
If If Usually, specify |
|
The global name of the source database. The source database is where the change originated. If If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Oracle recommends that you specify a source database for propagation rules. |
|
If If |
|
If If |
|
If If In either case, the system creates the rule set if it does not exist. |
|
If non- (system_condition) AND (and_condition) The variable in the specified condition must be :lcr.get_tag() = HEXTORAW(''02'') The Specifically, if you specify an LCR member subprogram that is valid only for row LCRs, then specify See Also: Logical Change Record TYPEs |
|
If If This procedure cannot change the queue to queue property of an exiting propagation. If the specified propagation exists, then the procedure behaves in the following way for each setting:
|
Usage Notes
This procedure configures propagation using the current user. Only one propagation is allowed between a particular source queue and destination queue.
This procedure creates DML and DDL rules automatically based on include_dml
and include_ddl
parameter values, respectively. Each rule has a system-generated rule name that consists of the table name with a sequence number appended to it. The sequence number is used to avoid naming conflicts. If the table name plus the sequence number is too long, then the table name is truncated. A propagation uses the rules for filtering.
Examples
The following is an example of a table rule condition created for filtering DML statements:
(((:dml.get_object_owner() = 'HR' and :dml.get_object_name() = 'LOCATIONS')) and :dml.is_null_tag() = 'Y' and :dml.get_source_database_name() = 'DBS1.NET' )
208.4.11 ADD_TABLE_RULES Procedure
This procedure adds rules to an XStream client rule set.
It adds rules to a rule set of one of the following types of XStream clients:
-
When the
streams_type
parameter is set tocapture
, this procedure adds capture process rules for capturing changes to a specified table.This procedure creates the specified capture process if it does not exist.
-
When the
streams_type
parameter is set toapply
and thestreams_name
parameter specifies the name of an apply process, outbound server, or inbound server, this procedure adds apply rules for applying logical change records (LCRs) that contain changes to a specified table. The rules can specify that the LCRs must be from a particular source database.This procedure creates an apply process if no apply process, outbound server, or inbound server exists with the specified
streams_name
. This procedure can add rules to an outbound server or inbound server, but it cannot create an outbound server or inbound server.
This procedure is overloaded. One version of this procedure contains two OUT
parameters, and the other does not.
Syntax
DBMS_XSTREAM_ADM.ADD_TABLE_RULES( table_name IN VARCHAR2, streams_type IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT 'streams_queue', include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, dml_rule_name OUT VARCHAR2, ddl_rule_name OUT VARCHAR2, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL); DBMS_XSTREAM_ADM.ADD_TABLE_RULES( table_name IN VARCHAR2, streams_type IN VARCHAR2, streams_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT 'streams_queue', include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, include_tagged_lcr IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, inclusion_rule IN BOOLEAN DEFAULT TRUE, and_condition IN VARCHAR2 DEFAULT NULL, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-12 ADD_TABLE_RULES Procedure Parameters
Parameter | Description |
---|---|
|
The name of the table specified as You can specify a table that does not yet exist, because Oracle Replication does not validate the existence of the table. |
|
The type of XStream client:
|
|
The name of the capture process or apply process. Do not specify an owner. If If
If If Each apply process must have a unique name. |
|
The name of the local queue, specified as For example, to specify a queue named For capture process rules, this is the queue into which a capture process enqueues LCRs. For outbound server rules, this is the queue from which the outbound server dequeues LCRs. For inbound server rules, this is the queue into which an inbound server enqueues error transactions. |
|
If |
|
If The generated rule evaluates to |
|
If
If the rules are added to a positive rule set, then setting this parameter to If
If the rules are added to a positive rule set, then setting this parameter to A setting of Usually, specify |
|
The global name of the source database. If For capture process rules, specify For apply process rules, specify the source database of the changes that will be applied by the apply process. The source database is the database where the changes originated. If an apply process applies captured LCRs, then the apply process can apply LCRs from only one capture process at one source database. In a CDB, specify the global name of the container to which the rules pertain. The container can be the root or a PDB. For example, If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify |
|
If If |
|
If If |
|
If If In either case, the system creates the rule set if it does not exist. |
|
If non- (system_condition) AND (and_condition) The variable in the specified condition must be :lcr.get_tag() = HEXTORAW(''02'') The Specifically, if you specify an LCR member subprogram that is valid only for row LCRs, then specify See Also: Logical Change Record TYPEs |
|
The global name of the root in the source CDB. For example, If this parameter is If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Note: This parameter only applies to a CDB. |
|
The short name of the source container. The container can be the root or a PDB. For example, Note: This parameter only applies to a CDB. |
Usage Notes
This procedure creates DML and DDL rules automatically based on include_dml
and include_ddl
parameter values, respectively. Each rule has a system-generated rule name that consists of the table name with a sequence number appended to it. The sequence number is used to avoid naming conflicts. If the table name plus the sequence number is too long, then the table name is truncated. A capture process or apply process uses the rules for filtering.
See Also:
Examples
The following is an example of a table rule condition created for DML changes:
(((:dml.get_object_owner() = 'HR' and :dml.get_object_name() = 'LOCATIONS')) and :dml.is_null_tag() = 'Y' and :dml.get_source_database_name() = 'DBS1.NET' )
208.4.12 ALTER_INBOUND Procedure
This procedure modifies an XStream inbound server.
Syntax
DBMS_XSTREAM_ADM.ALTER_INBOUND( server_name IN VARCHAR2, apply_user IN VARCHAR2 DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-13 ALTER_INBOUND Procedure Parameters
Parameter | Description |
---|---|
|
The name of the inbound server being altered. Specify an existing inbound server. Do not specify an owner. |
|
The user who applies all DML and DDL changes that satisfy the inbound server rule sets, who runs user-defined apply handlers, and who runs custom rule-based transformations configured for inbound server rules. The client application must attach to the inbound server as the apply user. Specify a user to change the apply user. In this case, the user who invokes the If See "CREATE_INBOUND Procedure" for information about the required privileges for an apply user. |
|
An optional comment associated with the inbound server. If non- If |
208.4.13 ALTER_OUTBOUND Procedure
This procedure modifies an XStream outbound server configuration.
This procedure always alters the specified outbound server. This procedure can also alter the outbound server's capture process when either of the following conditions is met:
-
The capture process was created by the
CREATE_OUTBOUND
procedure in this package. -
The queue used by the capture process was created by the
CREATE_OUTBOUND
procedure.
To check whether this procedure can alter the outbound server's capture process, query the CAPTURE_NAME
column in the ALL_XSTREAM_OUTBOUND
view. When the name of the capture process appears in the CAPTURE_NAME
column of this view, the ALTER_OUTBOUND
procedure can manage the capture process's rules or change the capture user for the capture process. When the CAPTURE_NAME
column of this view is NULL
, the ALTER_OUTBOUND
procedure cannot manage the capture process.
This procedure is overloaded. One table_names
parameter is type VARCHAR2
and the other table_names
parameter is type DBMS_UTILITY.UNCL_ARRAY
. Also, one schema_names
parameter is type VARCHAR2
and the other schema_names
parameter is type DBMS_UTILITY.UNCL_ARRAY
. These parameters enable you to enter the list of tables and schemas in different ways and are mutually exclusive.
Note:
Starting with Oracle Database 11g Release 2 (11.2.0.2), the start_scn
and start_time
parameters are included in this procedure.
Syntax
DBMS_XSTREAM_ADM.ALTER_OUTBOUND( server_name IN VARCHAR2, table_names IN DBMS_UTILITY.UNCL_ARRAY, schema_names IN DBMS_UTILITY.UNCL_ARRAY, add IN BOOLEAN DEFAULT TRUE, capture_user IN VARCHAR2 DEFAULT NULL, connect_user IN VARCHR2 DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL, inclusion_rule IN BOOLEAN DEFAULT TRUE, start_scn IN NUMBER DEFAULT NULL, start_time IN TIMESTAMP DEFAULT NULL, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL); DBMS_XSTREAM_ADM.ALTER_OUTBOUND( server_name IN VARCHAR2, table_names IN VARCHAR2 DEFAULT NULL, schema_names IN VARCHAR2 DEFAULT NULL, add IN BOOLEAN DEFAULT TRUE, capture_user IN VARCHAR2 DEFAULT NULL, connect_user IN VARCHAR2 DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL, inclusion_rule IN BOOLEAN DEFAULT TRUE, start_scn IN NUMBER DEFAULT NULL, start_time IN TIMESTAMP DEFAULT NULL, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-14 ALTER_OUTBOUND Procedure Parameters
Parameter | Description |
---|---|
|
The name of the outbound server being altered. Specify an existing outbound server. Do not specify an owner. |
|
The tables that are either added to or removed from the XStream Out configuration. Whether the tables are added or removed depends on the setting for the The tables can be specified in the following ways:
Each table should be specified as See Also: "Usage Notes" for more information about this parameter |
|
The schemas that are either added to or removed from the XStream Out configuration. Whether the schemas are added or removed depends on the setting for the The schemas can be specified in the following ways:
Note: This procedure does not concatenate the See Also: "Usage Notes" for more information about this parameter |
|
If If |
|
The user in whose security domain a capture process captures changes that satisfy its rule sets and runs custom rule-based transformations configured for capture process rules. Specify a user to change the capture user. In this case, the user who invokes the If If you change the capture user, then 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. Ensure that the capture user is granted the other required privileges. See "CREATE_OUTBOUND Procedure" for information about the privileges required by a capture user. The capture process is stopped and restarted automatically when you change the value of this parameter. Note: If the capture user for a capture process is dropped using |
|
The user who can attach to the specified outbound server to retrieve the change stream. The XStream client application must attach to the outbound server as the specified connect user. Specify a user to change the connect user. In this case, the user who invokes the If If you change the connect user, then this procedure grants the new connect user dequeue privileges on the queue used by the outbound server and configures the user as a secure queue user. Ensure that the connect user is granted the other required privileges. See "CREATE_OUTBOUND Procedure" for information about the privileges required by a connect user. |
|
An optional comment associated with the outbound server. If non- If |
|
If If If If |
|
A valid SCN for the database from which the capture process starts capturing changes. To be valid, the SCN value must be greater than or equal to the first SCN for the capture process. If a valid SCN is specified, then the capture process captures changes from the specified SCN when it is restarted. An error is returned if an invalid SCN is specified. If If The Note: If the capture process is enabled, then the |
|
A valid time from which the capture process starts capturing changes. To be valid, the time must correspond to an SCN value that is greater than or equal to the first SCN for the capture process. If a valid time is specified, then the capture process captures changes from the specified time when it is restarted. An error is returned if an invalid time is specified. If If The Note: If the capture process is enabled, then the |
|
If |
|
If |
|
The global name of the container where the specified If |
|
The short name of the source container. The container can be the root or a PDB. For example, Note: This parameter only applies to a CDB. |
Usage Notes
The following list describes the behavior of the outbound server for various combinations of the table_names
and schema_names
parameters:
-
If both the
table_names
andschema_names
parameters areNULL
or empty, then no rules are changed for the XStream Out configuration.This procedure is overloaded. The
table_names
andschema_names
parameters are defaulted toNULL
. Do not specifyNULL
for bothtable_names
andschema_names
in the same call; otherwise, errorPLS-00307
is returned. -
If both the
table_names
andschema_names
parameters are specified, then the rules for the tables and schemas are added to or removed from the XStream Out configuration, depending on the setting of theadd
parameter. -
If the
table_names
parameter is specified and theschema_names
parameter isNULL
or empty, then the rules for the tables are added to or removed from the XStream Out configuration, depending on the setting of theadd
parameter. The existing rules for schemas are not changed for the XStream Out configuration. -
If the
table_names
parameter isNULL
or empty and theschema_names
parameter is specified, then the rules for the schemas are added to or removed from the XStream Out configuration, depending on the setting of theadd
parameter. The existing rules for tables are not changed for the XStream Out configuration.
For the procedure that uses the DBMS_UTILITY.UNCL_ARRAY
type for the table_names
and schema_names
parameters, both parameters must be specified. To specify only tables, the schema_names
parameter must be specified and empty. To specify only schemas, the table_names
parameter must be specified and empty.
Note:
An empty array includes one NULL
entry.
208.4.14 CREATE_INBOUND Procedure
This procedure creates an XStream inbound server and its queue.
Note:
A client application can create multiple sessions. Each session can attach to only one inbound server, and each inbound server can serve only one session at a time. However, different client application sessions can connect to different inbound servers. See Oracle Call Interface Programmer's Guide and Oracle Database XStream Java API Reference for information about attaching to an inbound server.
Syntax
DBMS_XSTREAM_ADM.CREATE_INBOUND( server_name IN VARCHAR2, queue_name IN VARCHAR2, apply_user IN VARCHAR2 DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-15 CREATE_INBOUND Procedure Parameters
Parameter | Description |
---|---|
|
The name of the inbound server being created. A The specified name must not match the name of an existing outbound server, inbound server, apply process, or messaging client. Note: The |
|
The name of the local queue used by the inbound server, specified as If the specified queue exists, then it is used. If the specified queue does not exist, then the procedure creates it. For example, to specify a queue named Note: An inbound server's queue is used only to store error transactions. |
|
The apply user. If The client application must attach to the inbound server as the apply user. The apply user is the user in whose security domain an inbound server evaluates whether LCRs satisfy its rule sets, applies DML and DDL changes directly to database objects, runs custom rule-based transformations configured for inbound server rules, and runs apply handlers configured for the inbound server. This user must have the necessary privileges to perform these actions. This procedure grants the apply user dequeue privileges on the queue used by the inbound server and configures the user as a secure queue user. In addition to the privileges granted by this procedure, you must grant the following privileges to the apply user:
You can grant these privileges directly to the apply user, or you can grant them through roles. In addition, the apply user must be granted Note: If the apply user for an inbound server is dropped using |
|
An optional comment associated with the inbound server. |
Usage Notes
By default, an inbound server does not use rules or rule sets. Therefore, an inbound server applies all of the LCRs sent to it by an XStream client application. However, to filter the LCRs sent to an inbound server, you can add rules and rule sets to an inbound server using the DBMS_XSTREAM_ADM
and DBMS_RULE_ADM
packages.
In a CDB, you can execute the CREATE_INBOUND
procedure from either the root or a PDB. The inbound server is restricted to receiving LCRs from one source database and only applying the changes to its local container. If the inbound server is at the root level, then the apply user must be a common user.
See Also:
208.4.15 CREATE_OUTBOUND Procedure
This procedure creates an XStream outbound server, queue, and capture process to enable client applications to stream out Oracle database changes.
This procedure is overloaded. One table_names
parameter is type VARCHAR2
and the other table_names
parameter is type DBMS_UTILITY.UNCL_ARRAY
. Also, one schema_names
parameter is type VARCHAR2
and the other schema_names
parameter is type DBMS_UTILITY.UNCL_ARRAY
. These parameters enable you to enter the list of tables and schemas in different ways and are mutually exclusive.
Note:
-
A client application can create multiple sessions. Each session can attach to only one outbound server, and each outbound server can serve only one session at a time. However, different client application sessions can connect to different outbound servers. See "OCIXStreamOutAttach()" in the Oracle Call Interface Programmer's Guide and Oracle Database XStream Java API Reference for information about attaching to an outbound server.
-
If the
capture_name
parameter isNULL
, then this procedure automatically generates a name for the capture process that it creates. -
This procedure automatically generates a name for the queue that it creates.
-
This procedure enables both the capture process and outbound server that it creates.
-
Starting with Oracle Database 11g Release 2 (11.2.0.2), the
capture_name
parameter is included in this procedure.
Syntax
DBMS_XSTREAM_ADM.CREATE_OUTBOUND( server_name IN VARCHAR2, source_database IN VARCHAR2 DEFAULT NULL, table_names IN DBMS_UTILITY.UNCL_ARRAY, schema_names IN DBMS_UTILITY.UNCL_ARRAY, capture_user IN VARCHAR2 DEFAULT NULL, connect_user IN VARCHAR2 DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL, capture_name IN VARCHAR2 DEFAULT NULL, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL, lcrid_version IN NUMBER DEFAULT NULL); DBMS_XSTREAM_ADM.CREATE_OUTBOUND( server_name IN VARCHAR2, source_database IN VARCHAR2 DEFAULT NULL, table_names IN VARCHAR2 DEFAULT NULL, schema_names IN VARCHAR2 DEFAULT NULL, capture_user IN VARCHAR2 DEFAULT NULL, connect_user IN VARCHAR2 DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL, capture_name IN VARCHAR2 DEFAULT NULL, include_dml IN BOOLEAN DEFAULT TRUE, include_ddl IN BOOLEAN DEFAULT FALSE, source_root_name IN VARCHAR2 DEFAULT NULL, source_container_name IN VARCHAR2 DEFAULT NULL, lcrid_version IN NUMBER DEFAULT NULL);
Parameters
Table 208-16 CREATE_OUTBOUND Procedure Parameters
Parameter | Description |
---|---|
|
The name of the outbound server being created. A The specified name must not match the name of an existing outbound server, inbound server, apply process, or messaging client. Note: The |
|
The global name of the source database. The source database is where the changes to be captured originated. If non- In a CDB, specify the global name of the container to which the rules pertain. The container can be the root or a PDB. For example, In a non-CDB, if non- If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify |
|
The tables for which DML and DDL changes are streamed out to the XStream client application. The tables can be specified in the following ways:
Each table should be specified as See Also: "Usage Notes" for more information about this parameter |
|
The schemas for which DML and DDL changes are streamed out to the XStream client application. The schemas can be specified in the following ways:
Note: This procedure does not concatenate the See Also: "Usage Notes" for more information about this parameter |
|
The user in whose security domain a capture process captures changes that satisfy its rule sets and runs custom rule-based transformations configured for capture process rules. If This procedure grants the capture user enqueue privilege on the queue used by the capture process and configures the user as a secure queue user. In addition, ensure that the capture user has the following privileges:
You can grant these privileges directly to the apply user, or you can grant them through roles. In addition, the capture user must be granted Only a user who is granted the A capture user does not require privileges on a database object to capture changes made to it. The capture process can pass these changes to a custom rule-based transformation function. Therefore, ensure that you consider security implications when you configure a capture process. |
|
The user who can attach to the specified outbound server to retrieve the change stream. The client application must attach to the outbound server as the specified connect user. If The connect user is the user in whose security domain an outbound server evaluates LCRs against its rule sets and runs custom rule-based transformations configured for outbound server rules. This user must have the necessary privileges to perform these actions. This procedure grants the connect user dequeue privileges on the queue used by the outbound server and configures the user as a secure queue user. In addition to the privileges granted by this procedure, grant the following privileges to the connect user:
You can grant these privileges directly to the connect user, or you can grant them through roles. In addition, the connect user must be granted |
|
An optional comment associated with the outbound server. |
|
The name of the capture process configured to capture changes for the outbound server. Do not specify an owner. The capture process must not exist. If the specified name matches the name of an existing capture process, then an error is raised. If the name does not match the name of an existing capture process, then the procedure creates a new capture process with the specified name. If Note: The capture process name cannot be altered after the capture process is created. |
|
If |
|
If |
|
The global name of the root in the source CDB. For example, If this parameter is If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify Note: This parameter only applies to a CDB. |
|
The short name of the source container. The container can be the root or a PDB. For example, Note: This parameter only applies to a CDB. |
|
The LCRID version for captured LCRs, either If If If |
Usage Notes
The following list describes the behavior of the outbound server for various combinations of the table_names
and schema_names
parameters:
-
If both the
table_names
andschema_names
parameters areNULL
or empty, then the outbound server streams all DML and DDL changes to the client application.This procedure is overloaded. The
table_names
andschema_names
parameters are defaulted toNULL
. Do not specifyNULL
for bothtable_names
andschema_names
in the same call; otherwise, errorPLS-00307
is returned. -
If both the
table_names
andschema_names
parameters are specified, then the outbound server streams DML and DDL changes for the specified tables and schemas. -
If the
table_names
parameter is specified and theschema_names
parameter isNULL
or empty, then the outbound server streams DML and DDL changes for the specified tables. -
If the
table_names
parameter isNULL
or empty and theschema_names
parameter is specified, then the outbound server streams DML and DDL changes for the specified schema.
For the procedure that uses the DBMS_UTILITY.UNCL_ARRAY
type for the table_names
and schema_names
parameters, both parameters must be specified. To specify only tables, the schema_names
parameter must be specified and empty. To specify only schemas, the table_names
parameter must be specified and empty.
Note:
An empty array includes one NULL
entry.
208.4.16 DELETE_COLUMN Procedure
This procedure either adds or removes a declarative rule-based transformation which deletes a column from a row logical change record (LCR) that satisfies the specified rule.
For the transformation to be performed when the specified rule evaluates to TRUE
, the rule must be in the positive rule set of an XStream client. XStream clients include capture processes, propagations, and apply processes.
Note:
-
The
DELETE_COLUMN
procedure supports the same data types supported by Oracle Replication capture processes. -
The
DELETE_COLUMN
procedure is useful when you want to delete a relatively small number of columns in a row LCR. To delete most of the columns in a row LCR and keep a relatively small number of columns, consider using theKEEP_COLUMNS
procedure in this package. -
Declarative transformations can transform row LCRs only. Therefore, a DML rule must be specified when you run this procedure. If a DDL rule is specified, then the procedure raises an error.
See Also:
-
Oracle Database XStream Guide for more information about declarative rule-based transformations and about the data types supported by capture processes
Syntax
DBMS_XSTREAM_ADM.DELETE_COLUMN( rule_name IN VARCHAR2, table_name IN VARCHAR2, column_name IN VARCHAR2, value_type IN VARCHAR2 DEFAULT '*', step_number IN NUMBER DEFAULT 0, operation IN VARCHAR2 DEFAULT 'ADD');
Parameters
Table 208-17 DELETE_COLUMN Procedure Parameters
Parameter | Description |
---|---|
|
The name of the rule, specified as For example, to specify a rule in the |
|
The name of the table from which the column is deleted in the row LCR, specified as |
|
The name of the column deleted from each row LCR that satisfies the rule. |
|
Specify Specify Specify |
|
The order of execution of the transformation. See Also: Oracle Database XStream Guide for more information about transformation ordering |
|
Specify Specify |
Usage Notes
When 'REMOVE'
is specified for the operation
parameter, all of the delete column declarative rule-based transformations for the specified rule are removed that match the specified table_name
, column_name
, and step_number
parameters. Nulls specified for these parameters act as wildcards. The following table lists the behavior of the DELETE_COLUMN
procedure when one or more of these parameters is NULL
:
table_name | column_name | step_number | Result |
---|---|---|---|
|
|
|
Remove all delete column transformations for the specified rule. |
|
|
non- |
Remove all delete column transformations with the specified |
|
non- |
non- |
Remove all delete column transformations with the specified |
non- |
|
|
Remove all delete column transformations with the specified |
|
|
|
Remove all delete column transformations with the specified |
non- |
non- |
|
Remove all delete column transformations with the specified |
non- |
|
|
Remove all delete column transformations with the specified |
non- |
non- |
non- |
Remove all delete column transformations with the specified |
208.4.17 DROP_INBOUND Procedure
This procedure removes an inbound server configuration.
This procedure always removes the specified inbound server. This procedure also removes the queue for the inbound server if all of the following conditions are met:
-
One call to the
CREATE_INBOUND
procedure created the queue. -
The inbound server is the only subscriber to the queue.
See Also:
Syntax
DBMS_XSTREAM_ADM.DROP_INBOUND( server_name IN VARCHAR2);
Parameters
Table 208-18 DROP_INBOUND Procedure Parameters
Parameter | Description |
---|---|
|
The name of the inbound server being removed. Specify an existing inbound server. Do not specify an owner. |
208.4.18 DROP_OUTBOUND Procedure
This procedure removes an outbound server configuration.
This procedure always drops the specified outbound server. This procedure also drops the queue used by the outbound server if both of the following conditions are met:
-
The queue was created by the
CREATE_OUTBOUND
procedure in this package. -
The outbound server is the only subscriber to the queue.
If either one of the preceding conditions is not met, then the DROP_OUTBOUND
procedure only drops the outbound server. It does not drop the queue.
This procedure also drops the capture process for the outbound server if both of the following conditions are met:
-
The procedure can drop the outbound server's queue.
-
The capture process was created by the
CREATE_OUTBOUND
procedure.
If the procedure can drop the queue but cannot manage the capture process, then it drops the queue without dropping the capture process.
See Also:
Syntax
DBMS_XSTREAM_ADM.DROP_OUTBOUND( server_name IN VARCHAR2);
Parameters
Table 208-19 DROP_OUTBOUND Procedure Parameters
Parameter | Description |
---|---|
|
The name of the outbound server being removed. Specify an existing outbound server. Do not specify an owner. |
208.4.19 ENABLE_GG_XSTREAM_FOR_STREAMS Procedure
This procedure enables XStream optimizations and performance optimizations for Oracle Replication components.
This procedure is intended for users of Oracle Replication who want to enable XStream optimizations and optimizations. For example, you can enable the optimizations for an Oracle Replication configuration that uses capture processes and apply processes to replicate changes between Oracle databases.
These capabilities and optimizations are enabled automatically for XStream components, such as outbound servers, inbound servers, and capture processes that send changes to outbound servers. It is not necessary to run this procedure for XStream components.
When XStream optimizations are enabled, Oracle Replication components can stream ID key LCRs and sequence LCRs. The XStream performance optimizations improve efficiency in various areas, including:
-
LCR processing
-
Handling large transactions
-
DML execution during apply
-
Dependency computation and scheduling
-
Capture process parallelism
Syntax
DBMS_XSTREAM_ADM.ENABLE_GG_XSTREAM_FOR_STREAMS( enable IN BOOLEAN TRUE);
Parameters
Table 208-20 ENABLE_GG_XSTREAM_FOR_STREAMS Procedure Parameters
Parameter | Description |
---|---|
|
If If |
Usage Notes
The following usage notes apply to this procedure:
-
When you run this procedure, all capture processes and apply processes are restarted.
-
After you run this procedure, the
PURPOSE
column in the following views displaysXStream
Streams
:-
ALL_APPLY
-
DBA_APPLY
-
ALL_CAPTURE
-
DBA_CAPTURE
-
-
A license for the Oracle GoldenGate product is required to enable XStream performance optimizations for Oracle Replication components.
208.4.20 GET_MESSAGE_TRACKING Function
The GET_MESSAGE_TRACKING
Function returns the tracking label for the current session.
See Also:
Syntax
DBMS_XSTREAM_ADM.GET_MESSAGE_TRACKING RETURN VARCHAR2;
208.4.21 GET_TAG Function
This function gets the binary tag for all redo entries generated by the current session.
See Also:
Syntax
DBMS_XSTREAM_ADM.GET_TAG RETURN RAW;
Examples
The following example illustrates how to display the current logical change record (LCR) tag as output:
SET SERVEROUTPUT ON DECLARE raw_tag RAW(2000); BEGIN raw_tag := DBMS_XSTREAM_ADM.GET_TAG(); DBMS_OUTPUT.PUT_LINE('Tag Value = ' || RAWTOHEX(raw_tag)); END; /
You can also display the value by querying the DUAL
view:
SELECT DBMS_XSTREAM_ADM.GET_TAG FROM DUAL;
208.4.22 IS_GG_XSTREAM_FOR_STREAMS Function
This function returns TRUE
if XStream performance optimizations are enabled for Oracle Replication components, or this function returns FALSE
if XStream performance optimizations are disabled for Oracle Replication components.
See Also:
Syntax
DBMS_XSTREAM_ADM.IS_GG_XSTREAM_FOR_STREAMS RETURN BOOLEAN;
208.4.23 KEEP_COLUMNS Procedure
This procedure either adds or removes a declarative rule-based transformation which keeps a list of columns in a row logical change record (LCR) that satisfies the specified rule. The transformation deletes columns that are not in the list from the row LCR.
For the transformation to be performed when the specified rule evaluates to TRUE
, the rule must be in the positive rule set of an XStream client. XStream clients include capture processes, propagations, and apply processes.
This procedure is overloaded. The column_list
parameter is type VARCHAR2
and the column_table
parameter is type DBMS_UTILITY.LNAME_ARRAY
. These parameters enable you to enter the list of columns in different ways and are mutually exclusive.
Note:
-
The
KEEP_COLUMNS
procedure supports the same data types supported by Oracle Replication capture processes. -
The
KEEP_COLUMNS
procedure is useful when you want to keep a relatively small number of columns in a row LCR. To keep most of the columns in a row LCR and delete a relatively small number of columns, consider using theDELETE_COLUMN
procedure in this package. -
Declarative transformations can transform row LCRs only. Therefore, a DML rule must be specified when you run this procedure. If a DDL rule is specified, then the procedure raises an error.
See Also:
-
Oracle Database XStream Guide for more information about declarative rule-based transformations and about the data types supported by Oracle Replication capture processes
Syntax
DBMS_XSTREAM_ADM.KEEP_COLUMNS( rule_name IN VARCHAR2, table_name IN VARCHAR2, column_list IN VARCHAR2, value_type IN VARCHAR2 DEFAULT '*', step_number IN NUMBER DEFAULT 0, operation IN VARCHAR2 DEFAULT 'ADD'); DBMS_XSTREAM_ADM.KEEP_COLUMNS( rule_name IN VARCHAR2, table_name IN VARCHAR2, column_table IN DBMS_UTILITY.LNAME_ARRAY, value_type IN VARCHAR2 DEFAULT '*', step_number IN NUMBER DEFAULT 0, operation IN VARCHAR2 DEFAULT 'ADD');
Parameters
Table 208-21 KEEP_COLUMNS Procedure Parameters
Parameter | Description |
---|---|
|
The name of the rule, specified as For example, to specify a rule in the |
|
The name of the table for which the columns are kept in the row LCR, specified as |
|
The names of the columns kept for each row LCR that satisfies the rule. Specify a comma-delimited list of type If this parameter is set to |
|
The names of the columns kept for each row LCR that satisfies the rule. Specify a PL/SQL associative array of type The transformation removes columns that are not in the table from the row LCR. If this parameter is set to |
|
Specify Specify Specify |
|
The order of execution of the transformation. See Also: Oracle Database XStream Guide for more information about transformation ordering |
|
Specify Specify |
Usage Notes
When 'REMOVE'
is specified for the operation
parameter, all of the keep columns declarative rule-based transformations for the specified rule are removed that match the specified table_name
, column_list
, column_table
, and step_number
parameters. Nulls specified for these parameters act as wildcards. The following table lists the behavior of the KEEP_COLUMNS
procedure when one or more of these parameters is NULL
:
table_name | column_list/column_table | step_number | Result |
---|---|---|---|
|
|
|
Remove all keep columns transformations for the specified rule. |
|
|
non- |
Remove all keep columns transformations with the specified |
|
non- |
non- |
Remove all keep columns transformations with the specified |
non- |
|
non- |
Remove all keep columns transformations with the specified |
|
non- |
|
Remove all keep columns transformations with the specified |
non- |
non- |
|
Remove all keep columns transformations with the specified |
non- |
|
|
Remove all keep columns transformations with the specified |
non- |
non- |
non- |
Remove all keep columns transformations with the specified |
208.4.24 MERGE_STREAMS Procedure
This procedure merges a stream that is flowing from one capture process with a stream that is flowing from another capture process.
Typically, this procedure is used to merge two streams that were split using the SPLIT_STREAMS
procedure in this package. The SPLIT_STREAMS
procedure clones components of the original stream when it splits the streams. Therefore, the information in this section uses the following terminology:
-
The stream before it was split off has the original queue, original capture process, and original propagation.
-
The stream that was split off by the
SPLIT_STREAMS
procedure has a cloned queue, cloned capture process, and cloned propagation.
This procedure is called by the MERGE_STREAMS_JOB
procedure. The MERGE_STREAMS_JOB
procedure determines whether the streams are within a user-specified merge threshold so that the streams can be merged safely. If the streams are not within the merge threshold, then the MERGE_STREAMS_JOB
procedure does nothing. Typically, it is best to run the MERGE_STREAMS_JOB
procedure instead of running the MERGE_STREAMS
procedure directly.
However, you can choose to run the MERGE_STREAMS
procedure directly when the following conditions are met:
-
The problem at the destination of the split stream has been corrected, and the destination queue can accept changes.
-
The cloned capture process used by the split stream is started and is capturing changes.
-
The apply process at the destination database is applying the changes captured by the cloned capture process.
-
The
CAPTURE_MESSAGE_CREATE_TIME
in theGV$XSTREAM_CAPTURE
view of the cloned capture process has caught up to, or nearly caught up to, theCAPTURE_MESSAGE_CREATE_TIME
of the original capture process. The cloned capture process might never completely catch up to the original capture process. Therefore, you can merge the split stream when the cloned capture process has nearly caught up to the original capture process.
The MERGE_STREAMS
procedure performs the following actions:
-
Stops the cloned capture process.
-
Stops the original capture process.
-
Copies the cloned propagation back to the original propagation. The propagation has the same name as the original propagation after it is copied back.
-
Starts the original capture process from the lower SCN value of these two SCN values:
-
The acknowledged SCN of the cloned propagation.
-
The lowest acknowledged SCN of the other propagations that propagate changes captured by the original capture process.
When the original capture process is started, it might recapture changes that it already captured, or it might capture changes that were already captured by the cloned capture process. In either case, the relevant apply processes will discard any duplicate changes they receive.
-
-
Drops the cloned propagation.
-
Drops the cloned capture process.
-
Drops the cloned queue.
See Also:
Syntax
DBMS_XSTREAM_ADM.MERGE_STREAMS( cloned_propagation_name IN VARCHAR2, propagation_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT NULL, perform_actions IN BOOLEAN DEFAULT TRUE, script_name IN VARCHAR2 DEFAULT NULL, script_directory_object IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-22 MERGE_STREAMS Procedure Parameters
Parameter | Description |
---|---|
|
The name of the cloned propagation used by the stream that was split off from the original stream using the You must specify an existing propagation name. Do not specify an owner. |
|
The name of the propagation that is merged back to the original stream. If Specify a non- If a non-
|
|
The name of the queue that is the source queue for the propagation that is merged back. If Specify a non- |
|
If If Specify
|
|
If non- If non- If If |
|
The directory object for the directory on the local computer system into which the generated script is placed. If the If Note: The specified directory object cannot point to an Oracle Automatic Storage Management (ASM) disk group. |
Usage Notes
You can use the MERGE_STREAMS
procedure to merge two streams that were not split using the SPLIT_STREAMS
procedure. Merging streams in this way can save resources and improve performance when a single database is running two or more capture processes.
208.4.25 MERGE_STREAMS_JOB Procedure
This procedure determines whether the original capture process and the cloned capture process are within the specified merge threshold. If they are within the merge threshold, then this procedure runs the MERGE_STREAMS
procedure to merge the two streams.
Typically, this procedure is used to merge two streams that were split using the SPLIT_STREAMS
procedure in this package. The SPLIT_STREAMS
procedure clones components of the original stream when it splits the streams. Therefore, the information in this section uses the following terminology:
-
The stream before it was split off has the original queue, original capture process, and original propagation.
-
The stream that was split off by the
SPLIT_STREAMS
procedure has a cloned queue, cloned capture process, and cloned propagation.
If the auto_merge_threshold
parameter was set to a positive number in the SPLIT_STREAMS
procedure that split the streams, then a merge job runs the MERGE_STREAMS_JOB
procedure automatically according to its schedule. The schedule name is specified for the schedule_name
parameter, and the merge job name is specified for the merge_job_name
parameter when the MERGE_STREAMS_JOB
procedure is run automatically. The merge job and its schedule were created by the SPLIT_STREAMS
procedure.
If the auto_merge_threshold
parameter was set to NULL
or 0
(zero) in the SPLIT_STREAMS
procedure that split the streams, then you can run the MERGE_STREAMS_JOB
procedure manually. In this case, it is not run automatically.
Syntax
DBMS_XSTREAM_ADM.MERGE_STREAMS_JOB( cloned_propagation_name IN VARCHAR2, propagation_name IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT NULL, merge_threshold IN NUMBER, schedule_name IN VARCHAR2 DEFAULT NULL, merge_job_name IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-23 MERGE_STREAMS_JOB Procedure Parameters
Parameter | Description |
---|---|
|
The name of the cloned propagation used by the stream that was split off from the original stream using the You must specify an existing propagation name. Do not specify an owner. |
|
The name of the propagation that is merged back to the original stream. If Specify a non- If a non-
|
|
The name of the queue that is the source queue for the propagation that is merged back. If Specify a non- |
|
The merge threshold in seconds. The value of the Specifically, if the difference, in seconds, between the |
|
The name of the schedule for the merge job. If Specify |
|
The name of the job that merges the streams. If Specify |
Usage Notes
You can use the MERGE_STREAMS_JOB
procedure to merge two streams that were not split using the SPLIT_STREAMS
procedure. Merging streams in this way can save resources and improve performance when a single database is running two or more capture processes.
After the MERGE_STREAMS_JOB
procedure completes, you can query the DBA_CAPTURE
and DBA_PROPAGATION
views to determine whether the streams were merged. If the streams were merged, then the cloned capture process and cloned propagation do not appear in these views.
If the streams were merged and the schedule_name
and merge_job_name
parameters were non-NULL
, then the specified schedule and merge job are deleted automatically.
208.4.26 PURGE_SOURCE_CATALOG Procedure
This procedure removes all Oracle Replication data dictionary information at the local database for the specified object.
You can use this procedure to remove Oracle Replication metadata that is not needed currently and will not be needed in the future.
Syntax
DBMS_XSTREAM_ADM.PURGE_SOURCE_CATALOG( source_database IN VARCHAR2, source_object_name IN VARCHAR2, source_object_type IN VARCHAR2, source_root_name IN VARCHAR2);
Parameters
Table 208-24 PURGE_SOURCE_CATALOG Procedure Parameters
Parameter | Description |
---|---|
|
In a non-CDB, specify the global name of the source database containing the database object. In a CDB, specify the global name of the container containing the database object. The container can be the root or a PDB. If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify |
|
The name of the object specified as |
|
Type of the object. Currently, |
|
The global name of the source root containing the object in a CDB. The source root is where the changes being captured originated in a CDB. If you do not include the domain name, then the procedure appends it to the database name automatically. For example, if you specify If the Note: This parameter only applies to a CDB. |
Usage Notes
The global name of the source database containing the object must be specified for the source_database
parameter. If the current database is not the source database for the object, then the procedure removes data dictionary information about the object from the current database, not the source database.
For example, suppose changes to the hr.employees
table at the dbs1.net
source database are being applied to the hr.employees
table at the dbs2.net
destination database. Also, suppose hr.employees
at dbs2.net
is not a source at all. In this case, specifying dbs2.net
as the source_database
for this table results in an error. However, specifying dbs1.net
as the source_database
for this table while running the PURGE_SOURCE_CATALOG
procedure at the dbs2.net
database removes data dictionary information about the table at dbs2.net
.
Do not run this procedure at a database if either of the following conditions is true:
-
Logical change records (LCRs) captured by the capture process for the object are or might be applied locally without reinstantiating the object.
-
LCRs captured by the capture process for the object are or might be forwarded by the database without reinstantiating the object.
Note:
These conditions do not apply to LCRs that were not created by the capture process. That is, these conditions do not apply to user-created LCRs.
208.4.27 RECOVER_OPERATION Procedure
This procedure provides options for split and merge operations that stopped because they encountered an errors.
This procedure either rolls forward the operation, rolls back the operation, or purges all of the metadata about the operation. Split and merge operations might be run in an XStream Out environment in which multiple outbound servers use the same capture process.
This procedure only can perform these actions for split and merge operations using the split_threshold
and merge_threshold
capture process parameters set to non-NULL
values to enable automatic split and merge.
Information about the operation is stored in the following data dictionary views when the operation is in process:
The data dictionary views are populated at the database that contains the capture process.
When the operation completes successfully, metadata about the operation is moved from the DBA_RECOVERABLE_SCRIPT
view to the DBA_RECOVERABLE_SCRIPT_HIST
view. The other views, DBA_RECOVERABLE_SCRIPT_PARAMS
, DBA_RECOVERABLE_SCRIPT_BLOCKS
, and DBA_RECOVERABLE_SCRIPT_ERRORS
, retain information about the operation until it is purged automatically after 30 days.
When one of these operations encounters an error and stops, metadata about the operation remains in these views. In this case, you can either roll forward, roll back, or purge the metadata about the operation using the RECOVER_OPERATION
procedure. If you choose to roll forward the operation, then correct conditions that caused the errors reported in DBA_RECOVERABLE_SCRIPT_ERRORS
before proceeding.
Run the RECOVER_OPERATION
procedure at the database that contains the capture process.
Note:
To run the RECOVER_OPERATION
procedure, both databases must be Oracle Database 10g Release 2 or later databases.
Syntax
DBMS_XSTREAM_ADM.RECOVER_OPERATION( script_id IN RAW, operation_mode IN VARCHAR2 DEFAULT 'FORWARD');
Parameters
Table 208-25 RECOVER_OPERATION Procedure Parameters
Parameter | Description |
---|---|
|
The operation id of the operation that is being rolled forward, rolled back, or purged. Query the |
|
If If If |
208.4.28 REMOVE_QUEUE Procedure
This procedure removes the specified ANYDATA
queue.
Specifically, this procedure performs the following actions:
-
Waits until all current enqueue and dequeue transactions commit.
-
Stops the queue, which means that no further enqueues into the queue or dequeues from the queue are allowed.
-
Drops the queue.
-
If the
drop_unused_queue_table
parameter is set toTRUE
, then drops the queue table if it is empty and no other queues are using it. -
If the
cascade
parameter is set toTRUE
, then drops all of the XStream clients that are using the queue.Note:
The specified queue must be a
ANYDATA
queue.
Syntax
DBMS_XSTREAM_ADM.REMOVE_QUEUE( queue_name IN VARCHAR2, cascade IN BOOLEAN DEFAULT FALSE, drop_unused_queue_table IN BOOLEAN DEFAULT TRUE);
Parameters
Table 208-26 REMOVE_QUEUE Procedure Parameters
Parameter | Description |
---|---|
|
The name of the queue to remove, specified as |
|
If If |
|
If If |
208.4.29 REMOVE_RULE Procedure
This procedure removes the specified rule or all rules from the rule set associated with the specified capture process, apply process, or propagation.
Note:
If a rule was automatically created by the system, and you want to drop the rule, then you should use this procedure to remove the rule instead of the DBMS_RULE_ADM.DROP_RULE
procedure. If you use the DBMS_RULE_ADM.DROP_RULE
procedure, then some metadata about the rule might remain.
Syntax
DBMS_XSTREAM_ADM.REMOVE_RULE( rule_name IN VARCHAR2, streams_type IN VARCHAR2,   streams_name IN VARCHAR2, drop_unused_rule IN BOOLEAN DEFAULT TRUE, inclusion_rule IN BOOLEAN DEFAULT TRUE);
Parameters
Table 208-27 REMOVE_RULE Procedure Parameters
Parameter | Description |
---|---|
|
The name of the rule to remove, specified as For example, to specify a rule in the |
|
The type of XStream client:
|
|
The name of the XStream client, which can be a capture process, propagation, or apply process. Do not specify an owner. If the specified XStream client does not exist, but there is metadata in the data dictionary that associates the rule with this client, then the procedure removes the metadata. If the specified XStream client does not exist, and there is no metadata in the data dictionary that associates the rule with this client, then the procedure raises an error. |
|
If If If |
|
If If |
208.4.30 REMOVE_SUBSET_OUTBOUND_RULES Procedure
This procedure removes subset rules from an outbound server configuration.
The names of the specified insert, update, and delete rules must match those generated by the ADD_SUBSET_OUTBOUND_RULES
procedure. To view the rule names for subset rules, run the following query:
SELECT RULE_OWNER, SUBSETTING_OPERATION, RULE_NAME FROM ALL_XSTREAM_RULES WHERE SUBSETTING_OPERATION IS NOT NULL;
Note:
-
This procedure removes the declarative rule-based transformation associated with each rule it removes.
-
This procedure does not remove rules from the outbound server's capture process.
See Also:
Syntax
DBMS_XSTREAM_ADM.REMOVE_SUBSET_OUTBOUND_RULES( server_name IN VARCHAR2, insert_rule_name IN VARCHAR2, update_rule_name IN VARCHAR2, delete_rule_name IN VARCHAR2);
208.4.31 REMOVE_XSTREAM_CONFIGURATION Procedure
This procedure removes the XStream configuration at the local database.
Syntax
DBMS_XSTREAM_ADM.REMOVE_XSTREAM_CONFIGURATION( container IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-28 REMOVE_XSTREAM_CONFIGURATION Procedure Parameters
Parameter | Description |
---|---|
|
If If If a container name, then the XStream configuration is removed from the specified container. To specify root, use Note: This parameter only applies to a CDB. |
Usage Notes
Specifically, this procedure performs the following actions at the local database:
-
Drops all capture processes
-
If any tables have been prepared for instantiation, then aborts preparation for instantiation for the table using the
ABORT_TABLE_INSTANTIATION
procedure in theDBMS_CAPTURE_ADM
package -
If any schemas have been prepared for instantiation, then aborts preparation for instantiation for the schema using the
ABORT_SCHEMA_INSTANTIATION
procedure in theDBMS_CAPTURE_ADM
package -
If the database has been prepared for instantiation, then aborts preparation for instantiation for the database using the
ABORT_GLOBAL_INSTANTIATION
procedure in theDBMS_CAPTURE_ADM
package -
Drops propagations that were created using either the
DBMS_XSTREAM_ADM
package or theDBMS_PROPAGATION_ADM
package. Before a propagation is dropped, its propagation job is disabled. Does not drop propagations that were created using theDBMS_AQADM
package. -
Disables all propagation jobs used by propagations
-
Drops all apply processes. If there are apply errors in the error queue for an apply process, then this procedure deletes these apply errors before it drops the apply process.
-
Removes specifications for DDL handlers used by apply processes, but does not delete the PL/SQL procedures used by these handlers
-
Removes specifications for message handlers used by apply processes, but does not delete the PL/SQL procedures used by these handlers
-
Removes specifications for precommit handlers used by apply processes, but does not delete the PL/SQL procedures used by these handlers
-
Removes the instantiation SCN and ignore SCN for each apply object and schema and for the entire database
-
Removes messaging clients
-
Unsets message notification specifications that were set using the
SET_MESSAGE_NOTIFICATION
procedure in theDBMS_XSTREAM_ADM
package -
Removes specifications for procedure DML handlers and error handlers, but does not delete the PL/SQL procedures used by these handlers
-
Removes update conflict handlers
-
Removes specifications for substitute key columns for apply tables
-
Drops rule sets and rules that were created using the
DBMS_XSTREAM_ADM
package. -
Drops unused rule sets that were used by capture processes, propagations, apply processes, and messaging clients, and removes the rules in these rule sets. These rules and rule sets are removed regardless of whether they were created using the
DBMS_XSTREAM_ADM
package or theDBMS_RULE_ADM
package.
This procedure stops capture processes and apply processes before it drops them.
This procedure does not drop rule sets or rules if they meet both of the following conditions:
-
The rule sets or rules were created using the
DBMS_RULE_ADM
package. -
The rule sets or rules were not used by a capture process, propagation, apply process, or messaging client.
Note:
Running this procedure is dangerous. You should run this procedure only if you are sure you want to remove the entire XStream configuration at a database. If an Oracle Replication configuration exists at the database, then this procedure also removes the entire Oracle Replication configuration.
Note:
-
Running this procedure repeatedly does not cause errors. If the procedure fails to complete, then you can run it again.
-
This procedure commits multiple times.
208.4.32 RENAME_COLUMN Procedure
This procedure either adds or removes a declarative rule-based transformation which renames a column in a row logical change record (LCR) that satisfies the specified rule.
For the transformation to be performed when the specified rule evaluates to TRUE
, the rule must be in the positive rule set of an XStream client. XStream clients include capture processes, propagations, and apply processes.
Note:
-
The
RENAME_COLUMN
procedure supports the same data types supported by Oracle Replication capture processes. -
Declarative transformations can transform row LCRs only. Therefore, a DML rule must be specified when you run this procedure. If a DDL rule is specified, then the procedure raises an error.
See Also:
Oracle Database XStream Guide for more information about declarative rule-based transformations and about the data types supported by Oracle Replication capture processes
Syntax
DBMS_XSTREAM_ADM.RENAME_COLUMN( rule_name IN VARCHAR2, table_name IN VARCHAR2, from_column_name IN VARCHAR2, to_column_name IN VARCHAR2, value_type IN VARCHAR2 DEFAULT '*', step_number IN NUMBER DEFAULT 0, operation IN VARCHAR2 DEFAULT 'ADD');
Parameters
Table 208-29 RENAME_COLUMN Procedure Parameters
Parameter | Description |
---|---|
|
The name of the rule, specified as For example, to specify a rule in the |
|
The name of the table in which the column is renamed in the row LCR, specified as |
|
The name of the column to be renamed in each row LCR that satisfies the rule. |
|
The new name of the column in each row LCR that satisfies the rule. |
|
Specify Specify Specify |
|
The order of execution of the transformation. See Also: Oracle Database XStream Guide for more information about transformation ordering |
|
Specify Specify |
Usage Notes
When 'REMOVE'
is specified for the operation
parameter, all of the rename column declarative rule-based transformations for the specified rule are removed that match the specified table_name
, column_name
, and step_number
parameters. Nulls specified for these parameters act as wildcards. The following table lists the behavior of the RENAME_COLUMN
procedure when one or more of these parameters is NULL
:
table_name | from_column_name | to_column_name | step_number | Result |
---|---|---|---|---|
|
|
|
|
Remove all rename column transformations for the specified rule. |
|
|
|
non- |
Remove all rename column transformations with the specified |
|
|
non- |
non- |
Remove all rename column transformations with the specified |
|
non- |
non- |
non- |
Remove all rename column transformations with the specified |
|
|
non- |
|
Remove all rename column transformations with the specified column_name for the specified rule. |
non- |
|
non- |
|
Remove all rename column transformations with the specified |
|
non- |
|
|
Remove all rename column transformations with the specified |
|
non- |
non- |
|
Remove all rename column transformations with the specified |
non- |
|
non- |
|
Remove all rename column transformations with the specified |
non- |
non- |
non- |
|
Remove all rename column transformations with the specified |
non- |
non- |
non- |
non- |
Remove all rename column transformations with the specified |
208.4.33 RENAME_SCHEMA Procedure
This procedure either adds or removes a declarative rule-based transformation which renames a schema in a row logical change record (LCR) that satisfies the specified rule.
For the transformation to be performed when the specified rule evaluates to TRUE
, the rule must be in the positive rule set of an XStream client. XStream clients include capture processes, propagations, and apply processes.
Note:
Declarative transformations can transform row LCRs only. Therefore, a DML rule must be specified when you run this procedure. If a DDL rule is specified, then the procedure raises an error.
See Also:
Oracle Database XStream Guide for more information about declarative rule-based transformations
Syntax
DBMS_XSTREAM_ADM.RENAME_SCHEMA( rule_name IN VARCHAR2, from_schema_name IN VARCHAR2, to_schema_name IN VARCHAR2, step_number IN NUMBER DEFAULT 0, operation IN VARCHAR2 DEFAULT 'ADD');
Parameters
Table 208-30 RENAME_SCHEMA Procedure Parameters
Parameter | Description |
---|---|
|
The name of the rule, specified as For example, to specify a rule in the |
|
The name of the schema to be renamed in each row LCR that satisfies the rule. |
|
The new name of the schema in each row LCR that satisfies the rule. |
|
The order of execution of the transformation. See Also: Oracle Database XStream Guide for more information about transformation ordering |
|
Specify Specify |
Usage Notes
When 'REMOVE'
is specified for the operation
parameter, all of the rename schema declarative rule-based transformations for the specified rule are removed that match the specified from_schema_name
, to_schema_name
, and step_number
parameters. Nulls specified for these parameters act as wildcards. The following table lists the behavior of the RENAME_SCHEMA
procedure when one or more of these parameters is NULL
:
from_schema_name | to_schema_name | step_number | Result |
---|---|---|---|
|
|
|
Remove all rename schema transformations for the specified rule. |
|
|
non- |
Remove all rename schema transformations with the specified |
|
non- |
non- |
Remove all rename schema transformations with the specified |
non- |
|
non- |
Remove all rename schema transformations with the specified |
|
non- |
|
Remove all rename schema transformations with the specified |
non- |
non- |
|
Remove all rename schema transformations with the specified |
non- |
|
|
Remove all rename schema transformations with the specified |
non- |
non- |
non- |
Remove all rename schema transformations with the specified |
208.4.34 RENAME_TABLE Procedure
This procedure either adds or removes a declarative rule-based transformation which renames a table in a row logical change record (row LCR) that satisfies the specified rule.
For the transformation to be performed when the specified rule evaluates to TRUE
, the rule must be in the positive rule set of an XStream client. XStream clients include capture processes, propagations, and apply processes.
Note:
Declarative transformations can transform row LCRs only. Therefore, a DML rule must be specified when you run this procedure. If a DDL rule is specified, then the procedure raises an error.
See Also:
Oracle Database XStream Guide for more information about declarative rule-based transformations
Syntax
DBMS_XSTREAM_ADM.RENAME_TABLE( rule_name IN VARCHAR2, from_table_name IN VARCHAR2, to_table_name IN VARCHAR2, step_number IN NUMBER DEFAULT 0, operation IN VARCHAR2 DEFAULT 'ADD');
Parameters
Table 208-31 RENAME_TABLE Procedure Parameters
Parameter | Description |
---|---|
|
The name of the rule, specified as For example, to specify a rule in the |
|
The name of the table to be renamed in each row LCR that satisfies the rule, specified as |
|
The new name of the table in each row LCR that satisfies the rule, specified as The transformation can rename the table only, the schema only, or the table and the schema. If the schema is not specified, then the current user is the default. |
|
The order of execution of the transformation. See Also: Oracle Database XStream Guide for more information about transformation ordering |
|
Specify Specify |
Usage Notes
When 'REMOVE'
is specified for the operation
parameter, all of the rename table declarative rule-based transformations for the specified rule are removed that match the specified from_table_name
, to_table_name
, and step_number
parameters. Nulls specified for these parameters act as wildcards. The following table lists the behavior of the RENAME_TABLE
procedure when one or more of these parameters is NULL
:
from_table_name | to_table_name | step_number | Result |
---|---|---|---|
|
|
|
Remove all rename table transformations for the specified rule. |
|
|
non- |
Remove all rename table transformations with the specified |
|
non- |
non- |
Remove all rename table transformations with the specified |
non- |
|
non- |
Remove all rename table transformations with the specified |
|
non- |
|
Remove all rename table transformations with the specified |
non- |
non- |
|
Remove all rename table transformations with the specified |
non- |
|
|
Remove all rename table transformations with the specified |
non- |
non- |
non- |
Remove all rename table transformations with the specified |
208.4.35 SET_MESSAGE_TRACKING Procedure
This procedure sets the tracking label for logical change records (LCRs) produced by the current session.
This procedure affects only the current session. Any LCRs produced by the current session are tracked, including captured LCRs and persistent LCRs.
Note:
The tracking label set by this procedure does not track non-LCR messages.
See Also:
KAWGET_MESSAGE_TRACKING
Syntax
DBMS_XSTREAM_ADM.SET_MESSAGE_TRACKING( tracking_label IN VARCHAR2 DEFAULT 'Streams_tracking', actions IN NUMBER DEFAULT DBMS_XSTREAM_ADM.ACTION_MEMORY);
Parameters
Table 208-32 SET_MESSAGE_TRACKING Procedure Parameters
Parameter | Description |
---|---|
|
The label used to track the LCRs produced by the session. Set this parameter to The size limit for a label is 4,000 bytes. |
|
When Currently, The value specified for this parameter is an enumerated constant. Enumerated constants must be prefixed with the package name. |
208.4.36 SET_PARAMETER Procedure
This procedure sets a parameter for an outbound server, an inbound server, or an outbound server's capture process.
Syntax
DBMS_XSTREAM_ADM.SET_PARAMETER( streams_name IN VARCHAR2, streams_type IN VARCHAR2, parameter IN VARCHAR2, value IN VARCHAR2 DEFAULT NULL, no_wait IN BOOLEAN DEFAULT FALSE, source_database IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-33 SET_PARAMETER Procedure Parameters
Parameter | Description |
---|---|
|
The type of XStream client:
|
|
The name of the capture process, outbound server, or inbound server. Do not specify an owner. |
|
The name of the parameter you are setting. See "Capture Process Parameters" for information about capture process parameters. See "Apply Component Parameters" for information about outbound server and inbound server parameters. |
|
The value to which the parameter is set. If |
|
If If When you modify multiple parameters for the same process consecutively, setting this parameter to |
|
If If If a container name, then the parameter is set in the specified container. To specify root, use Note: This parameter only applies to CDBs. Also, a non-null value can be specified only for the following parameters:
|
208.4.37 SET_TAG Procedure
This procedure sets the binary tag for all redo entries subsequently generated by the current session.
Each redo entry generated by DML or DDL statements in the current session will have this tag. This procedure affects only the current session.
Syntax
DBMS_XSTREAM_ADM.SET_TAG( tag IN RAW DEFAULT NULL);
Parameters
Table 208-34 SET_TAG Procedure Parameters
Parameter | Description |
---|---|
|
The binary tag for all subsequent redo entries generated by the current session. A raw value is a sequence of bytes, and a byte is a sequence of bits. By default, the tag for a session is The size limit for a tag value is 2000 bytes. |
Usage Notes
To set the tag to the hexadecimal value of '17'
in the current session, run the following procedure:
EXEC DBMS_XSTREAM_ADM.SET_TAG(tag => HEXTORAW('17'));
The following are considerations for the SET_TAG
procedure:
-
This procedure is not transactional. That is, the effects of
SET_TAG
cannot be rolled back. -
If the
SET_TAG
procedure is run to set a non-NULL
session tag before a data dictionary build has been performed on the database, then the redo entries for a transaction that started before the dictionary build might not include the specified tag value for the session. Therefore, perform a data dictionary build before using theSET_TAG
procedure in a session. A data dictionary build happens when theDBMS_CAPTURE_ADM.BUILD
procedure is run. TheBUILD
procedure can be run automatically when a capture process is created.
See Also:
208.4.38 SET_UP_QUEUE Procedure
This procedure creates a queue table and a ANYDATA
queue.
Syntax
DBMS_XSTREAM_ADM.SET_UP_QUEUE( queue_table IN VARCHAR2 DEFAULT 'streams_queue_table', storage_clause IN VARCHAR2 DEFAULT NULL, queue_name IN VARCHAR2 DEFAULT 'streams_queue', queue_user IN VARCHAR2 DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL);
Parameters
Table 208-35 SET_UP_QUEUE Procedure Parameters
Parameter | Description |
---|---|
|
The name of the queue table specified as If the queue table owner is not specified, then the procedure specifies the user who runs this procedure automatically as the queue table owner. Queue table names can be a maximum of 24 bytes. |
|
The storage clause for queue table The storage parameter is included in the If a tablespace is not specified here, then the procedure creates the queue table and all its related objects in the default user tablespace of the user who runs this procedure. If a tablespace is specified here, then the procedure creates the queue table and all its related objects in the tablespace specified in the storage clause. If See Also: Oracle Database SQL Language Referencefor more information about storage clauses |
|
The name of the queue that will function as the If the schema is not specified, then the procedure uses the queue table owner. The owner of the queue table must also be the owner of the queue. The queue owner automatically has privileges to perform all queue operations on the queue. If the schema is not specified for this parameter, and the queue table owner is not specified in Queue names can be a maximum of 24 bytes. |
|
The name of the user who requires If |
|
The comment for the queue |
Usage Notes
Set up includes the following actions:
-
If the specified queue table does not exist, then this procedure runs the
CREATE_QUEUE_TABLE
procedure in theDBMS_AQADM
package to create the queue table with the specified storage clause. If this procedure creates the queue table, then it creates a multiple consumerANYDATA
queue that is both a secure queue and a transactional queue.Also, if the database is Oracle Database 10g release 2 or later, the
sort_list
setting inCREATE_QUEUE_TABLE
is set tocommit_time
. If the database is a release before Oracle Database 10g release 2, thesort_list
setting inCREATE_QUEUE_TABLE
is set toenq_time
. -
If the specified queue table exists, then the queue uses the properties of the existing queue table.
-
If the specified queue name does not exist, then this procedure runs the
CREATE_QUEUE
procedure in theDBMS_AQADM
package to create the queue. -
This procedure starts the queue.
-
If a queue user is specified, then this procedure configures this user as a secure queue user of the queue and grants
ENQUEUE
andDEQUEUE
privileges on the queue to the specified queue user.To configure the queue user as a secure queue user, this procedure creates an Advanced Queuing agent with the same name as the user name, if one does not exist. If an agent with this name exists and is associated with the queue user only, then it is used.
SET_UP_QUEUE
then runs theENABLE_DB_ACCESS
procedure in theDBMS_AQADM
package, specifying the agent and the user.
Note:
If the agent that SET_UP_QUEUE
tries to create exists and is associated with a user other than the user specified by queue_user
, then the procedure raises an error. In this case, rename or remove the existing agent, and retry SET_UP_QUEUE
.
208.4.39 SPLIT_STREAMS Procedure
This procedure splits one stream flowing from a capture process off from all of the other streams flowing from the capture process.
This procedure is intended for an Oracle Replication environment in which a capture process captures changes that are propagated to two or more destination databases. When one destination of a propagation stops accepting the captured changes, the changes remain in the capture process's queue. The queue can grow and begin to spill LCRs to the hard disk, degrading the performance of the Oracle Replication environment. A destination might stop accepting changes for several reasons. For example, the destination database might be down.
Specifically, this procedure performs the following actions:
-
Creates a new queue at the database running the capture process. The new queue is called the cloned queue because it is a clone of the queue used by the original stream. The new queue will be used by the new, cloned capture process, and it will be the source queue for the new, cloned propagation.
-
Creates a new propagation that propagates LCRs from the source queue created in Step 1 to the existing destination queue. The new propagation is called the cloned propagation because it is a clone of the propagation used by the original stream. The cloned propagation uses the same rule set as the original propagation.
-
Stops the capture process.
-
Queries the acknowledge SCN for the original propagation. The acknowledged SCN is the last SCN acknowledged by the apply process that applies the changes sent by the propagation.
-
Creates a new capture process. The new capture process is called the cloned capture process because it is a clone of the capture process used by the original stream. The procedure sets the start SCN for the cloned capture process to the value of the queried acknowledged SCN. The cloned capture process uses the same rule set as the original capture process.
-
Drops the original propagation.
-
Starts the original capture process with the start SCN set to the acknowledged SCN queried in Step 4.
-
If the
auto_merge_threshold
parameter is set to a positive number, then creates an Oracle Scheduler job to run theMERGE_STREAMS_JOB
procedure at set intervals according to its schedule. When the two streams are within the specified merge threshold, theMERGE_STREAMS_JOB
procedure runs theMERGE_STREAMS
procedure to merge the streams automatically.
After the SPLIT_STREAMS
procedure has finished running, the cloned capture process is disabled. When the problem at the destination database is solved, and the destination queue can accept changes, you should start the cloned capture process using the START_CAPTURE
procedure in the DBMS_CAPTURE_ADM
package.
Note:
If the original capture process is a downstream capture process, then you must configure the cloned capture process to read the redo log from the source database before you start the cloned capture process.
See Also:
Syntax
DBMS_XSTREAM_ADM.SPLIT_STREAMS( propagation_name IN VARCHAR2, cloned_propagation_name IN VARCHAR2 DEFAULT NULL, cloned_queue_name IN VARCHAR2 DEFAULT NULL, cloned_capture_name IN VARCHAR2 DEFAULT NULL, perform_actions IN BOOLEAN DEFAULT TRUE, script_name IN VARCHAR2 DEFAULT NULL, script_directory_object IN VARCHAR2 DEFAULT NULL, auto_merge_threshold IN NUMBER DEFAULT NULL, schedule_name IN OUT VARCHAR2, merge_job_name IN OUT VARCHAR2);
Parameters
Table 208-36 SPLIT_STREAMS Procedure Parameters
Parameter | Description |
---|---|
|
The name of the propagation that cannot send LCRs to its destination queue. The specified propagation is the propagation for the stream that is being split off from the other streams. You must specify an existing propagation name. Do not specify an owner. |
|
The name of the new propagation created by this procedure for the stream that is split off. If |
|
The name of the new queue created by this procedure for the stream that is split off. If |
|
The name of the new capture process created by this procedure for the stream that is split off. If |
|
If If Specify
|
|
If non- If non- If If |
|
The directory object for the directory on the local computer system into which the generated script is placed. If the If Note: The specified directory object cannot point to an Oracle Automatic Storage Management (ASM) disk group. |
|
If a positive number is specified, then the stream that was split off is automatically merged back into all of the other streams flowing from the capture process by an Oracle Scheduler job. The job runs the If The |
|
The Oracle Scheduler schedule name, specified as If If If If this procedure creates a schedule, the schedule starts when the procedure completes. You can modify the schedule to control how often the merge job is run. If an existing schedule name is specified, an error is raised. |
|
The Oracle Scheduler job name, specified as If If If If an existing job name is specified, an error is raised. |
See Also:
Oracle Database Administrator's Guide for information about Oracle Scheduler
208.4.40 START_OUTBOUND Procedure
This procedure starts an XStream outbound server. The outbound server streams out the LCRs to an XStream client application.
Syntax
DBMS_XSTREAM_ADM.START_OUTBOUND( server_name IN VARCHAR2);
Parameters
Table 208-37 START_OUTBOUND Procedure Parameters
Parameter | Description |
---|---|
|
The name of the outbound server being started. A |
208.4.41 STOP_OUTBOUND Procedure
This procedure stops an XStream outbound server. The outbound server streams out the LCRs to an XStream client application.
Syntax
DBMS_XSTREAM_ADM.STOP_OUTBOUND( server_name IN VARCHAR2, force IN BOOLEAN DEFAULT FALSE);
Parameters
Table 208-38 STOP_OUTBOUND Procedure Parameters
Parameter | Description |
---|---|
|
The name of the outbound server being stopped. A |
|
If If The behavior of the apply component depends on the setting specified for the |