• Non ci sono risultati.

Adding a New Destination Database to a Single-Source Environment

Instantiation SCNs Using Export/Import" on page 10-28 for more information about performing a metadata export/import.

7. Start any Streams client you stopped in Step 2:

Use the START_CAPTURE procedure in the DBMS_CAPTURE_ADM package to start a capture process.

Use the START_PROPAGATION procedure in the DBMS_PROPAGATION_ADM package start a propagation.

Use the START_APPLY procedure in the DBMS_APPLY_ADM package to start an apply process.

You must stop the capture process, disable one of the propagation jobs, or stop the apply process in Step 2 to ensure that the table or schema is instantiated before the first LCR resulting from the added rule(s) reaches the apply process. Otherwise, LCRs could be lost or could result in apply errors, depending on whether the apply process 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 7 before Step 6 to reduce the amount of time that a Streams process or propagation job is stopped.

Adding a New Destination Database to a 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 might 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" on page 8-2, before creating or altering propagation rules in a running Streams environment, make sure any propagations or apply processes that will receive LCRs as a result of the new or altered rules are configured to handle these LCRs.

Otherwise, LCRs can be lost.

This example assumes that the shared database objects are read-only at the destination databases. If the shared objects are read/write at the destination databases, then the replication environment will not stay synchronized because Streams is not configured to replicate the changes made to the shared objects at the destination databases.

Figure 8–2 shows the additional configuration steps that must be completed to add a destination database to a single-source Streams environment.

See Also: Oracle Streams Concepts and Administration for more information about completing these tasks

See Also: "Add Objects to an Existing Streams Replication Environment" on page 19-5 for a detailed example that adds objects to an existing single-source environment

Adding a New Destination Database to a Single-Source Environment

Figure 8–2 Example of Adding a Destination to a Single-Source Environment

To avoid losing LCRs, you should complete the configuration in the following order:

1. Complete the necessary tasks to prepare each database in your environment for Streams:

Configure a Streams administrator.

Set initialization parameters relevant to Streams.

Configure network connectivity and database links.

Some of these tasks might not be required at certain databases.

2. Create any necessary ANYDATA queues that do not already exist at the destination database. When you create an apply process, you associate the apply process with a specific ANYDATA queue. See "Creating an ANYDATA Queue to Stage LCRs" on page 9-7 for instructions.

3. Create one or more apply processes at the new destination database to apply the changes from its source database. Make sure each apply process uses rule sets that are appropriate for applying changes. Do not start any of the apply processes at the new database. See "Creating an Apply Process that Applies LCRs" on page 9-9 for instructions.

See Also: Oracle Streams Concepts and Administration for more information about preparing a database for Streams

Existing Destination Database Added Destination Database Source Database

Existing database

link for existing propagation

Added database

link for added propagation Additional configuration includes:

· Each shared object prepared for instantiation

· A propagation for the added destination database

Additional configuration includes:

· A SYS.AnyData queue

· Instantiation SCN set for each shared object

· An apply process for the source database

· Rule sets for the apply process No Additional configuration required

· · ·

Additional Destination Databases

Adding a New Destination Database to a Single-Source Environment

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.

4. Configure any necessary propagations to propagate changes from the source databases to the new destination database. Make sure each propagation uses rule sets that are appropriate for propagating changes. See "Creating a Propagation that Propagates LCRs" on page 9-7.

5. At the source database, prepare for instantiation each database object for which changes will be applied by an apply process at the new destination database. Run either 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. See "Preparing Database Objects for Instantiation at a Source Database" on page 10-1 for instructions.

6. At the new destination database, either instantiate, or set the instantiation SCNs for, each database object for which changes will be applied by an apply process. If the database objects do not already exist at the new destination database, then instantiate them using export/import, transportable tablespaces, or RMAN. If the database objects exist at the new destination database, then set the instantiation SCNs for them.

To instantiate database objects using export/import, first export them at the source database. Next, import them at the destination database. See "Setting Instantiation SCNs Using Export/Import" on page 10-28 for information. Also, see "Instantiating Objects in a Streams Replication Environment" on page 10-3 for information about instantiating objects using export/import, transportable tablespaces, and RMAN.

If you use the original Export utility, then set the OBJECT_CONSISTENT export parameter to y. Regardless of whether you use Data Pump export or original export, you can specify a more stringent degree of consistency by using an export parameter such as FLASHBACK_SCN or FLASHBACK_TIME.

If you use the original Import utility, then set the STREAMS_INSTANTIATION import parameter to y.

To set the instantiation SCN for a table, schema, or database manually, run the appropriate procedure or procedures in the DBMS_APPLY_ADM package at the new destination database:

SET_TABLE_INSTANTIATION_SCN SET_SCHEMA_INSTANTIATION_SCN SET_GLOBAL_INSTANTIATION_SCN

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 set the recursive parameter for this procedure to true so that the instantiation SCN also is set for each schema at the destination database and for the tables owned by these schemas.

If you run SET_SCHEMA_INSTANTIATION_SCN at a destination database, then set the recursive parameter for this procedure to true so that the instantiation SCN also is set for each table in the schema.