Oracle9i Streams Release 2 (9.2) Part Number A96571-02 |
|
|
View PDF |
This chapter provides instructions for preparing a database or a distributed database environment to use Streams and for configuring a Streams environment.
This chapter contains these topics:
To manage a Streams environment, either create a new user with the appropriate privileges or grant these privileges to an existing user. You should not use the SYS
or SYSTEM
user as a Streams administrator, and the Streams administrator should not use the SYSTEM
tablespace as its default tablespace.
Complete the following steps to configure a Streams administrator at each database in the environment that will use Streams:
strmadmin
, run the following statement:
CREATE USER strmadmin IDENTIFIED BY strmadminpw;
GRANT CONNECT, RESOURCE TO strmadmin; GRANT EXECUTE ON DBMS_AQADM TO strmadmin; GRANT EXECUTE ON DBMS_STREAMS_ADM TO strmadmin; BEGIN DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE( privilege => DBMS_RULE_ADM.CREATE_RULE_SET_OBJ, grantee => 'strmadmin', grant_option => FALSE); END; / BEGIN DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE( privilege => DBMS_RULE_ADM.CREATE_RULE_OBJ, grantee => 'strmadmin', grant_option => FALSE); END; /
EXECUTE
privilege on the DBMS_APPLY_ADM
package if the Streams administrator will manage one or more apply processes on the database. The Streams administrator also must have EXECUTE
privilege on any apply handlers and error handlers configured using the subprograms in the DBMS_APPLY_ADM
package.EXECUTE
privilege on the DBMS_CAPTURE_ADM
package if the Streams administrator will manage one or more capture processes on the databaseEXECUTE
privilege on the DBMS_PROPAGATION_ADM
package if the Streams administrator will manage one or more propagations on the databaseEXECUTE
privilege on the DBMS_FLASHBACK
package if the Streams administrator will need to obtain the current SCN for a database. Typically, the Streams administrator must determine the current SCN to set an instantiation SCN using the SET_TABLE_INSTANTIATION_SCN
, SET_SCHEMA_INSTANTIATION_SCN
, or SET_GLOBAL_INSTANTIATION_SCN
procedure in the DBMS_APPLY_ADM
package.SELECT_CATALOG_ROLE
if you want to enable the Streams administrator to monitor the environment easilySELECT
ANY
DICTIONARY
privilege if you plan to use the Streams tool in Oracle Enterprise ManagerSELECT
privilege on the DBA_APPLY_ERROR
data dictionary view if you want the Streams administrator to be able to select from this view within a PL/SQL subprogram. See "Displaying Detailed Information About Apply Errors" for an example of such a PL/SQL subprogram.EXECUTE
privilege on any PL/SQL procedure owned by another user that is executed by a Streams apply process. These procedures may be used in apply handlers or error handlers. If an apply user is specified, then the apply user must have these privileges.EXECUTE
privilege on any PL/SQL function owned by another user that is specified in a rule-based transformation for a rule used by a Streams capture process, propagation, or apply process. For an apply process, if an apply user is specified, then the apply user must have these privileges.ENQUEUE
or DEQUEUE
privileges on the queue, or both. See "Enabling a User to Perform Operations on a Secure Queue" for instructions.CREATE TABLESPACE streams_tbs DATAFILE '/usr/oracle/dbs/streams_tbs.dbf' SIZE 25 M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
ALTER USER strmadmin DEFAULT TABLESPACE streams_tbs QUOTA UNLIMITED ON streams_tbs;
Table 11-1 lists initialization parameters that are important for the operation, reliability, and performance of a Streams environment. Set these parameters appropriately for your Streams environment.
See Also:
Oracle9i Database Reference for more information about these initialization parameters |
Parameter | Values | Description |
---|---|---|
Range: |
Establishes queue monitor processes. Setting the parameter to If you want to enqueue user events into a Streams queue, then set this parameter to |
|
Limits the amount of data that can be lost and effectively increases the availability of the standby database by forcing a log switch after a user-specified time period elapses. If you are using Streams in a Real Application Clusters environment, then set this parameter to a value greater than zero to switch the log files automatically. See Also: "Streams Capture Processes and Oracle Real Application Clusters" |
||
Range: |
This parameter specifies the release with which the Oracle server must maintain compatibility. Oracle servers with different compatibility levels can interoperate. To use Streams, this parameter must be set to |
|
Range: |
Specifies whether a database link is required to have the same name as the database to which it connects. If you want to use Streams to share information between databases, then set this parameter to |
|
Range: |
Specifies the number of You can change the setting for This parameter must be set to at least |
|
Range: |
Specifies the level of concurrency for redo allocation within Oracle. If you plan to run one or more capture processes on a database, then this parameter must be set to Setting this parameter to |
|
Range: |
Specifies the maximum number of persistent LogMiner mining sessions that are concurrently active when all sessions are mining redo logs generated by instances. If you plan to run multiple Streams capture processes on a single database, then set this parameter equal to or higher than the number of planned capture processes. |
|
Range: |
Specifies the maximum number of concurrent open connections to remote databases in one session. These connections include database links, as well as external procedures and cartridges, each of which uses a separate process. In a Streams environment, make sure this parameter is set to the default value of |
|
Default: Derived from the values of the following parameters: Range: |
Specifies the maximum number of parallel execution processes and parallel recovery processes for an instance. As demand increases, Oracle will increase the number of processes from the number created at instance startup up to this value. In a Streams environment, each capture process and apply process may use multiple parallel execution servers. Set this initialization parameter to an appropriate value to ensure that there are enough parallel execution servers. |
|
Default: Derived from Range: |
Specifies the maximum number of operating system user processes that can simultaneously connect to Oracle. Make sure the value of this parameter allows for all background processes, such as locks, job queue processes, and parallel execution processes. In Streams, capture processes and apply processes use background processes and parallel execution processes, and propagation jobs use job queue processes. |
|
Range: |
Specifies the maximum number of sessions that can be created in the system. If you plan to run one or more capture processes or apply processes in a database, then you may need to increase the size of this parameter. Each background process in a database requires a session. |
|
Default: Initial size of SGA at startup Range: |
Specifies the maximum size of SGA for the lifetime of a database instance. If you plan to run multiple capture processes on a single database, then you may need to increase the size of this parameter. |
|
32-bit platforms: 8 MB, rounded up to the nearest granule size 64-bit platforms: 64 MB, rounded up to the nearest granule size Maximum: operating system-dependent |
Specifies (in bytes) the size of the shared pool. The shared pool contains shared cursors, stored procedures, control structures, and other structures. You should increase the size of the shared pool by 10 MB for each capture process on a database. |
|
If If The default for Range: |
Specifies whether or not statistics related to time are collected. If you want to collect elapsed time statistics in the data dictionary views related to Streams, then set this parameter to |
This section describes Export and Import utility parameters that are relevant to Streams.
See Also:
|
The following Export utility parameter is relevant to Streams.
The OBJECT_CONSISTENT
Export utility parameter specifies whether or not the Export utility repeatedly uses the SET
TRANSACTION
READ
ONLY
statement to ensure that the exported data and the exported procedural actions for each object are consistent to a single point in time. If OBJECT_CONSISTENT
is set to y
, then each object is exported in its own read-only transaction, even if it is partitioned. In contrast, if you use the CONSISTENT
Export utility parameter, then there is only one read-only transaction.
When you perform an instantiation in a Streams environment, some degree of consistency is required in the export dump file. The OBJECT_CONSISTENT
Export utility parameter is sufficient to ensure this consistency for Streams instantiations. If you are using an export dump file for other purposes in addition to a Streams instantiation, and these other purposes have more stringent consistency requirements than that provided by OBJECT_CONSISTENT
, then you can use Export utility parameters CONSISTENT
, FLASHBACK_SCN
, or FLASHBACK_TIME
for Streams instantiations.
By default the OBJECT_CONSISTENT
Export utility parameter is set to n
. Specify y
when an export is performed as part of a Streams instantiation and no more stringent Export utility parameter is needed.
The following Import utility parameters are relevant to Streams.
The STREAMS_INSTANTIATION
Import utility parameter specifies whether to import Streams instantiation metadata that may be present in the export dump file. When this parameter is set to y
, the import session sets its Streams tag to the hexadecimal equivalent of '00'
to avoid cycling the changes made by the import. Redo entries resulting from the import have this tag value. By default the STREAMS_INSTANTIATION
Import utility parameter is set to n
. Specify y
when an import is performed as part of a Streams instantiation.
The STREAMS_CONFIGURATION
Import utility parameter specifies whether to import any general Streams metadata that may be present in the export dump file. This import parameter is relevant only if you are performing a full database import. By default the STREAMS_CONFIGURATION
Import utility parameter is set to y
. Typically, specify y
if an import is part of a backup or restore operation.
The following objects are imported regardless of the STREAMS_CONFIGURATION
setting:
STREAMS_CONFIGURATION
is set to n
, then these queues are not started when they are imported)DBMS_STREAMS_ADM
package are run, while non-Streams rules are rules created using the DBMS_RULE_ADM
package.
If the STREAMS_CONFIGURATION
parameter is set to n
, then information about Streams rules is not imported into the following data dictionary views: ALL_STREAMS_GLOBAL_RULES
, ALL_STREAMS_SCHEMA_RULES
, ALL_STREAMS_TABLE_RULES
, DBA_STREAMS_GLOBAL_RULES
, DBA_STREAMS_SCHEMA_RULES
, and DBA_STREAMS_TABLE_RULES
. However, regardless of the STREAMS_CONFIGURATION
parameter setting, information about these rules is imported into the ALL_RULES
, ALL_RULE_SETS
, ALL_RULE_SET_RULES
, DBA_RULES
, DBA_RULE_SETS
, DBA_RULE_SET_RULES
, USER_RULES
, USER_RULE_SETS
, and USER_RULE_SET_RULES
data dictionary views.
When the STREAMS_CONFIGURATION
Import utility parameter is set to y
, the import includes the following information; when the STREAMS_CONFIGURATION
Import utility parameter is set to n
, the import does not include the following information:
DBA_APPLY_PROGRESS
data dictionary view, including applied message number, oldest message number, apply time, and applied message create timeSTREAMS_CONFIGURATION
parameter.The following sections describe database requirements for running a Streams capture process:
In addition to these tasks, make sure the initialization parameters are set properly on any database that will run a capture process.
Any database where changes are captured by a capture process must be running in ARCHIVELOG
mode.
See Also:
|
By default, the LogMiner tables are in the SYSTEM
tablespace, but the SYSTEM
tablespace may not have enough space for these tables once a capture process starts to capture changes. Therefore, you must create an alternate tablespace for the LogMiner tables.
The following example creates a tablespace named logmnrts
for use by LogMiner:
DBMS_LOGMNR_D
package.CREATE TABLESPACE logmnrts DATAFILE '/usr/oracle/dbs/logmnrts.dbf' SIZE 25 M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
SET_TABLESPACE
procedure in the DBMS_LOGMNR_D
package to set the alternate tablespace for LogMiner. For example, to specify a tablespace named logmnrts
, run the following procedure:
EXECUTE DBMS_LOGMNR_D.SET_TABLESPACE('logmnrts');
If you plan to use Streams to share information between databases, then configure network connectivity and database links between these databases:
CONNECT
TO
clause for the user propagating events between databases.
For example, to create a database link to a database named dbs2.net
connecting as a Streams administrator named strmadmin
, run the following statement:
CREATE DATABASE LINK dbs2.net CONNECT TO strmadmin IDENTIFIED BY strmadminpw USING 'dbs2.net';
See Also:
Oracle9i Database Administrator's Guide for more information about creating database links |
This section describes the general steps for performing the following tasks:
This section lists the general steps to perform when creating a new single source Streams environment. A single source environment is one in which there is only one source database for shared data. There may be more than one source database in a single source environment, but in this case no two source databases capture any of the same data.
Before starting capture processes and configuring propagations in a new Streams environment, make sure any propagations or apply processes that will receive events are configured to handle these events. That is, the propagations or apply processes should exist, and each one should be associated with a rule set that handles the events appropriately. If these propagations and apply processes are not configured properly to handle these events, then events may be lost.
In general, if you are configuring a new Streams environment in which changes for shared objects are captured at one database and then propagated and applied at remote databases, then you should configure the environment in the following order:
Some of these tasks may not be required at certain databases.
When you use the DBMS_STREAMS_ADM
package to add the capture rules, it automatically runs the PREPARE_TABLE_INSTANTIATION
, PREPARE_SCHEMA_INSTANTIATION
, or PREPARE_GLOBAL_INSTANTIATION
procedure in the DBMS_CAPTURE_ADM
package for the specified table, specified schema, or entire database, respectively.
You must run the appropriate procedure to prepare for instantiation manually if any of the following conditions is true:
DBMS_RULE_ADM
package to add or modify capture rules.If you must prepare for instantiation manually, then see "Preparing Database Objects for Instantiation at a Source Database" for instructions.
OBJECT_CONSISTENT
export parameter set to y
, or use a more stringent degree of consistency. Then, import them at the destination database with the STREAMS_INSTANTIATION
import parameter set to y
. See "Setting Instantiation SCNs Using Export/Import" for information.DBMS_APPLY_ADM
package at the destination database:
When you run one of these procedures, you must ensure that the shared objects at the destination database are consistent with the source database as of the instantiation SCN.
If you run SET_GLOBAL_INSTANTIATION_SCN
at a destination database, then you must also run SET_SCHEMA_INSTANTIATION_SCN
for each existing schema in the source database whose DDL changes you are applying, and you must run SET_TABLE_INSTANTIATION_SCN
for each existing table in the source database whose DML or DDL changes you are applying.
If you run SET_SCHEMA_INSTANTIATION_SCN
at a destination database, then you must also run SET_TABLE_INSTANTIATION_SCN
for each existing source database table in the schema whose DML or DDL changes you are applying.
See "Setting Instantiation SCNs Using the DBMS_APPLY_ADM Package" for instructions.
Alternatively, you can perform a metadata export/import to set the instantiation SCNs for existing database objects. If you choose this option, then make sure no rows are imported. Also, make sure the shared objects at all of the destination databases are consistent with the source database that performed the export at the time of the export. If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.
When you are configuring the environment, remember that capture processes and apply processes are stopped when they are created, but propagations are scheduled to propagate events immediately when they are created. The capture process must be created before the relevant objects are instantiated at a remote destination database. You must create the propagations and apply processes before starting the capture process, and you must instantiate the objects before running the whole stream.
See Also:
Chapter 21, "Simple Single Source Replication Example" and Chapter 22, "Single Source Heterogeneous Replication Example" for detailed examples that set up single source environments |
You add existing database objects to an existing single source environment by adding the necessary rules to the appropriate capture processes, propagations, and apply processes. Before creating or altering capture or propagation rules in a running Streams environment, make sure any propagations or apply processes that will receive events as a result of the new or altered rules are configured to handle these events. That is, the propagations or apply processes should exist, and each one should be associated with a rule set that handles the events appropriately. If these propagations and apply processes are not configured properly to handle these events, then events may be lost.
For example, suppose you want to add a table to a Streams environment that already captures, propagates, and applies changes to other tables. Assume only one capture process will capture changes to this table, and only one apply process will apply changes to this table. In this case, you must add one or more table-level rules to the following rule sets:
If you perform administrative steps in the wrong order, you may lose events. For example, if you add the rule to the capture rule set first, without stopping the capture process, then the propagation will not propagate the changes if it does not have a rule that instructs it to do so, and the changes may be lost.
To avoid losing events, you should complete the configuration in the following order:
When you use the DBMS_STREAMS_ADM
package to add the capture rules, it automatically runs the PREPARE_TABLE_INSTANTIATION
, PREPARE_SCHEMA_INSTANTIATION
, or PREPARE_GLOBAL_INSTANTIATION
procedure in the DBMS_CAPTURE_ADM
package for the specified table, specified schema, or entire database, respectively.
You must run the appropriate procedure to prepare for instantiation manually if any of the following conditions is true:
DBMS_RULE_ADM
to create or modify rules in the capture process rule set.If you must prepare for instantiation manually, then see "Preparing Database Objects for Instantiation at a Source Database" for instructions.
OBJECT_CONSISTENT
export parameter set to y
, or use a more stringent degree of consistency. Then, import them at the destination database with the STREAMS_INSTANTIATION
import parameter set to y
. See "Setting Instantiation SCNs Using Export/Import" for information.DBMS_APPLY_ADM
package at a destination database:
When you run one of these procedures at a destination database, you must ensure that every added object at the destination database is consistent with the source database as of the instantiation SCN.
If you run SET_GLOBAL_INSTANTIATION_SCN
at a destination database, then you must also run SET_SCHEMA_INSTANTIATION_SCN
for each existing source database schema whose changes you are applying and SET_TABLE_INSTANTIATION_SCN
for each existing source database table whose changes you are applying.
If you run SET_SCHEMA_INSTANTIATION_SCN
at a destination database, then you must also run SET_TABLE_INSTANTIATION_SCN
for each existing source database table in the schema whose DML or DDL changes you are applying.
See "Setting Instantiation SCNs Using the DBMS_APPLY_ADM Package" for instructions.
Alternatively, you can perform a metadata export/import to set the instantiation SCNs for existing database objects. If you choose this option, then make sure no rows are imported. Also, make sure every added object at the importing destination database is consistent with the source database that performed the export at the time of the export. If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.
You must stop the capture process, disable one of the propagation jobs, or stop the apply process in Step 1 to ensure that the table or schema is instantiated before the first LCR resulting from the added rule(s) reaches the apply process. Otherwise, events could be lost or could result in apply errors, depending on whether the apply rule(s) have been added.
If you are certain that the added table is not being modified at the source database during this procedure, and that there are no LCRs for the table already in the stream or waiting to be captured, then you can perform Step 5 before Step 4 to reduce the amount of time that a process or propagation job is stopped.
See Also:
"Add Objects to an Existing Streams Replication Environment" for a detailed example that adds objects to an existing single source environment |
You add a destination database to an existing single source environment by creating one or more new apply processes at the new destination database and, if necessary, configuring one or more propagations to propagate changes to the new destination database. You may also need to add rules to existing propagations in the stream that propagates to the new destination database.
As in the example that describes "Adding Shared Objects to an Existing Single Source Environment", before creating or altering propagation rules in a running Streams environment, make sure any propagations or apply processes that will receive events as a result of the new or altered rules are configured to handle these events. Otherwise, events may be lost.
To avoid losing events, you should complete the configuration in the following order:
Some of these tasks may not be required at the new database.
Keeping the apply processes stopped prevents changes made at the source databases from being applied before the instantiation of the new database is completed, which would otherwise lead to incorrect data and errors.
PREPARE_TABLE_INSTANTIATION
, PREPARE_SCHEMA_INSTANTIATION
, or PREPARE_GLOBAL_INSTANTIATION
procedure in the DBMS_CAPTURE_ADM
package for the specified table, specified schema, or entire database, respectively. See "Preparing Database Objects for Instantiation at a Source Database" for instructions.OBJECT_CONSISTENT
export parameter set to y
, or use a more stringent degree of consistency. Then, import them at the new destination database with the STREAMS_INSTANTIATION
import parameter set to y
. See "Setting Instantiation SCNs Using Export/Import" for information.DBMS_APPLY_ADM
package at the new destination database:
When you run one of these procedures, you must ensure that the shared objects at the new destination database are consistent with the source database as of the instantiation SCN.
If you run SET_GLOBAL_INSTANTIATION_SCN
at a destination database, then you must also run SET_SCHEMA_INSTANTIATION_SCN
for each existing schema in the source database whose DDL changes you are applying, and you must run SET_TABLE_INSTANTIATION_SCN
for each existing table in the source database whose DML or DDL changes you are applying.
If you run SET_SCHEMA_INSTANTIATION_SCN
at a destination database, then you must also run SET_TABLE_INSTANTIATION_SCN
for each existing source database table in the schema whose DML or DDL changes you are applying.
See "Setting Instantiation SCNs Using the DBMS_APPLY_ADM Package" for instructions.
Alternatively, you can perform a metadata export/import to set the instantiation SCNs for existing database objects. If you choose this option, then make sure no rows are imported. Also, make sure the shared objects at the importing destination database are consistent with the source database that performed the export at the time of the export. If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.
See Also:
"Add a Database to an Existing Streams Replication Environment" for detailed example that adds a database to an existing single source environment |
This section lists the general steps to perform when creating a new multiple source Streams environment. A multiple source environment is one in which there is more than one source database for any of the shared data.
This example uses the following terms:
Complete the following steps to create a new multiple source environment:
Note: Make sure no changes are made to the objects being shared at a database you are adding to the Streams environment until the instantiation at the database is complete. |
Some of these tasks may not be required at certain databases.
When you use the DBMS_STREAMS_ADM
package to add the capture rules, it automatically runs the PREPARE_TABLE_INSTANTIATION
, PREPARE_SCHEMA_INSTANTIATION
, or PREPARE_GLOBAL_INSTANTIATION
procedure in the DBMS_CAPTURE_ADM
package for the specified table, specified schema, or entire database, respectively.
You must run the appropriate procedure to prepare for instantiation manually if any of the following conditions is true:
DBMS_RULE_ADM
package to add or modify capture rules.If you must prepare for instantiation manually, then see "Preparing Database Objects for Instantiation at a Source Database" for instructions.
After completing these steps, complete the steps in each of the following sections that apply to your environment. You may need to complete the steps in only one of these sections or in both of these sections:
After completing the steps in "Creating a New Multiple Source Environment", complete the following steps for the populated databases if your environment has more than one populated database:
For each populated database, you can set these instantiation SCNs in one of the following ways:
If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.
After completing the steps in "Creating a New Multiple Source Environment", complete the following steps for the import databases:
SET_GLOBAL_INSTANTIATION_SCN
procedure in the DBMS_APPLY_ADM
package for this import database at all of the other databases in the environment.SET_SCHEMA_INSTANTIATION_SCN
procedure in the DBMS_APPLY_ADM
package for the schema at all of the other databases in the environment for the import database. Do this for each such schema.See "Setting Instantiation SCNs at a Destination Database" for instructions.
Because you are running these procedures before any tables are instantiated at the import databases, and because the local capture processes are configured already for these import databases, you will not need to run the SET_TABLE_INSTANTIATION_SCN
for each table created during the instantiation.
OBJECT_CONSISTENT
export parameter set to y
, or use a more stringent degree of consistency. Then, perform an import with the STREAMS_INSTANTIATION
import parameter set to y
at each import database. See "Setting Export and Import Parameters Relevant to Streams" and Oracle9i Database Utilities for information about using Export/Import.You can set these instantiation SCNs in one of the following ways:
If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.
Before completing the steps in this section, you should have completed the following tasks:
When all of the previous configuration steps are finished, complete the following steps:
See Also:
Chapter 23, "Multiple Source Replication Example" for a detailed example that creates a multiple source environment |
You add existing database objects to an existing multiple source environment by adding the necessary rules to the appropriate capture processes, propagations, and apply processes.
This example uses the following terms:
Before creating or altering capture or propagation rules in a running Streams environment, make sure any propagations or apply processes that will receive events as a result of the new or altered rules are configured to handle these events. That is, the propagations or apply processes should exist, and each one should be associated with a rule set that handles the events appropriately. If these propagations and apply processes are not configured properly to handle these events, then events may be lost.
For example, suppose you want to add a new table to a Streams environment that already captures, propagates, and applies changes to other tables. Assume multiple capture processes in the environment will capture changes to this table, and multiple apply processes will apply changes to this table. In this case, you must add one or more table-level rules to the following rule sets:
If you perform administrative steps in the wrong order, you may lose events. For example, if you add the rule to the capture rule set first, without stopping the capture process, then the propagation will not propagate the changes if it does not have a rule that instructs it to do so, and the changes may be lost.
To avoid losing events, you should complete the configuration in the following order:
When you use the DBMS_STREAMS_ADM
package to add the capture rules, it automatically runs the PREPARE_TABLE_INSTANTIATION
, PREPARE_SCHEMA_INSTANTIATION
, or PREPARE_GLOBAL_INSTANTIATION
procedure in the DBMS_CAPTURE_ADM
package for the specified table, specified schema, or entire database, respectively.
You must run the appropriate procedure to prepare for instantiation manually if any of the following conditions is true:
DBMS_RULE_ADM
to create or modify rules in a capture process rule set.If you must prepare for instantiation manually, then see "Preparing Database Objects for Instantiation at a Source Database" for instructions.
After completing these steps, complete the steps in each of the following sections that apply to your environment. You may need to complete the steps in only one of these sections or in both of these sections:
After completing the steps in "Adding Shared Objects to an Existing Multiple Source Environment", complete the following steps for each populated database:
For each populated database, you can set these instantiation SCNs for each added object in one of the following ways:
If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.
After completing the steps in "Adding Shared Objects to an Existing Multiple Source Environment", complete the following steps for the import databases:
SET_GLOBAL_INSTANTIATION_SCN
procedure in the DBMS_APPLY_ADM
package for this import database at all of the other databases in the environment.SET_SCHEMA_INSTANTIATION_SCN
procedure in the DBMS_APPLY_ADM
package for the schema for this import database at each of the other databases in the environment. Do this for each such schema.See "Setting Instantiation SCNs at a Destination Database" for instructions.
Because you are running these procedures before any tables are instantiated at the import databases, and because the local capture processes are configured already for these import databases, you will not need to run the SET_TABLE_INSTANTIATION_SCN
for each table created during instantiation.
OBJECT_CONSISTENT
export parameter set to y
, or use a more stringent degree of consistency. Then, perform an import of the added objects at each import database with the STREAMS_INSTANTIATION
import parameter set to y
. See "Setting Export and Import Parameters Relevant to Streams" and Oracle9i Database Utilities for information about using Export/Import.For each populated database, you can set these instantiation SCNs for the added objects in one of the following ways:
If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.
Before completing the configuration, you should have completed the following tasks:
When all of the previous configuration steps are finished, start each process you stopped and enable each propagation job you disabled in Step 2 in "Adding Shared Objects to an Existing Multiple Source Environment". See one of the following sections for instructions:
Complete the following steps to add a new database to an existing multiple source Streams environment:
Note: Make sure no changes are made to the objects being shared at the database you are adding to the Streams environment until the instantiation at the database is complete. |
Some of these tasks may not be required at the new database.
Keeping the apply processes stopped prevents changes made at the source databases from being applied before the instantiation of the new database is completed, which would otherwise lead to incorrect data and errors.
PREPARE_TABLE_INSTANTIATION
, PREPARE_SCHEMA_INSTANTIATION
, or PREPARE_GLOBAL_INSTANTIATION
procedure in the DBMS_CAPTURE_ADM
package for the specified table, specified schema, or entire database, respectively. See "Preparing Database Objects for Instantiation at a Source Database" for instructions.When you use the DBMS_STREAMS_ADM
package to add the capture rules, it automatically runs the PREPARE_TABLE_INSTANTIATION
, PREPARE_SCHEMA_INSTANTIATION
, or PREPARE_GLOBAL_INSTANTIATION
procedure in the DBMS_CAPTURE_ADM
package for the specified table, specified schema, or entire database, respectively.
You must run the appropriate procedure to prepare for instantiation manually if any of the following conditions is true:
DBMS_RULE_ADM
package to add or modify capture rules.If you must prepare for instantiation manually, then see "Preparing Database Objects for Instantiation at a Source Database" for instructions.
After completing these steps, complete the steps in the appropriate section:
After completing the steps in "Adding a New Database to an Existing Multiple Source Environment", complete the following steps if the objects that are to be shared with the new database already exist at the new database:
For each source database of the new database, you can set these instantiation SCNs in one of the following ways:
If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.
You can set these instantiation SCNs for the new database in one of the following ways:
If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.
After completing the steps in "Adding a New Database to an Existing Multiple Source Environment", complete the following steps if the objects that are to be shared with the new database do not already exist at the new database:
SET_GLOBAL_INSTANTIATION_SCN
procedure in the DBMS_APPLY_ADM
package for the new database at each destination database of the new database.SET_SCHEMA_INSTANTIATION_SCN
procedure in the DBMS_APPLY_ADM
package for the schema at each destination database of the new database. Do this for each such schema.See "Setting Instantiation SCNs at a Destination Database" for instructions.
Because you are running these procedures before any tables are instantiated at the new database, and because the local capture processes are configured already at the new database, you will not need to run the SET_TABLE_INSTANTIATION_SCN
for each table created during instantiation.
If the new database will not be a source database, then do not complete this step, and continue with the next step.
OBJECT_CONSISTENT
export parameter set to y
, or use a more stringent degree of consistency. Then, perform the import at the new database with the STREAMS_INSTANTIATION
import parameter set to y
. See "Setting Export and Import Parameters Relevant to Streams" and Oracle9i Database Utilities for information about using Export/Import.For each source database, you can set these instantiation SCNs in one of the following ways:
If you are sharing DML changes only, then table level export/import is sufficient. If you are sharing DDL changes also, then additional considerations apply. See "Setting Instantiation SCNs Using Export/Import" for more information about performing a metadata export/import.