• Non ci sono risultati.

Creating a New Streams Multiple-Source Environment

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" on page 10-28 for more information about performing a metadata export/import.

6. Start each apply process you created in Step 4 using the START_APPLY procedure in the DBMS_APPLY_ADM package.

7. Start each capture process you created in Step 4 using the START_CAPTURE procedure in the DBMS_CAPTURE_ADM package.

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 LCRs 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.

Creating a New Streams Multiple-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:

Populated database: A database that already contains the shared database objects before you create the new multiple-source environment. You must have at least one populated database to create the new Streams environment.

Export database: A populated database on which you perform an export of the shared database objects. This export is used to instantiate the shared database objects at the import databases. You might not have an export database if all of the databases in the environment are populated databases.

Import database: A database that does not contain the shared database objects before you create the new multiple-source environment. You instantiate the shared database objects at an import database by performing an import of these database objects. You might not have any import databases if all of the databases in the environment are populated databases.

Figure 7–2 shows an example multiple-source Streams environment.

See Also:

Chapter 18, "Simple Single-Source Replication Example" and Chapter 19, "Single-Source Heterogeneous

Replication Example" for detailed examples that set up single-source environments

Creating a New Streams Multiple-Source Environment

Figure 7–2 Example Streams Multiple-Source Environment

You can create a Streams environment that is more complicated than the one shown in Figure 7–2. For example, a multiple-source Streams environment can use downstream capture and directed networks.

Complete the following steps to create a new multiple-source environment:

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

Configure a Streams administrator.

Set initialization parameters relevant to Streams.

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.

Source / Destination Database

Database links for propagations Includes:

· One or more SYS.AnyData queues

· Supplemental logging specifications

· Each shared object prepared for instantiation

· One or more capture processes

· One propagation for each of the other destination databases

· Instantiation SCN set for each shared object for each of the other source databases

· One apply process for each of the other source databases

· Rule sets for the capture process(es), propagation(s), and apply process(es)

· Conflict resolution if necessary

· · ·

· One or more SYS.AnyData queues

· Supplemental logging specifications

· Each shared object prepared for instantiation

· One or more capture processes

· One propagation for each of the other destination databases

· Instantiation SCN set for each shared object for each of the other source databases

· One apply process for each of the other source databases

· Rule sets for the capture process(es), propagation(s), and apply process(es)

· Conflict resolution if necessary

Creating a New Streams Multiple-Source Environment

For each database that will run a capture process, prepare the database to run a capture process.

Configure network connectivity and database links.

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

2. At each populated database, specify any necessary supplemental logging for the shared objects. See "Managing Supplemental Logging in a Streams Replication Environment" on page 9-3 for instructions.

3. Create any necessary ANYDATA queues that do not already exist. When you create a capture process or apply process, you associate the process with a specific ANYDATA queue. When you create a propagation, you associate it with a specific source queue and destination queue. See "Creating an ANYDATA Queue to Stage LCRs" on page 9-7 for instructions.

4. At each database, create the required capture processes, propagations, and apply processes for your environment. You can create them in any order.

Create one or more capture processes at each database that will capture changes. Make sure each capture process uses rule sets that are appropriate for capturing changes. Do not start the capture processes you create. Oracle recommends that you use only one capture process for each source database.

See "Creating a Capture Process" on page 9-1 for instructions.

When you a procedure in the DBMS_STREAMS_ADM package to add the capture process 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, if the capture process is a local capture process or a downstream capture process with a database link to the source database.

You must run the appropriate procedure to prepare for instantiation manually if any of the following conditions is true:

You use the DBMS_RULE_ADM package to add or modify rules.

You use an existing capture process and do not add capture process rules for any shared object.

You use a downstream capture process with no database link to the source database.

If you must prepare for instantiation manually, then see "Preparing Database Objects for Instantiation at a Source Database" on page 10-1 for instructions.

Create all propagations that propagate the captured LCRs from a source queue to a destination queue. Make sure each propagation uses rule sets that are appropriate for propagating changes. See "Creating a Propagation that Propagates LCRs" on page 9-7 for instructions.

Create one or more apply processes at each database that will apply changes.

Make sure each apply process uses rule sets that are appropriate for applying changes. Do not start the apply processes you create. 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

Creating a New Streams Multiple-Source Environment

After completing these steps, complete the steps in each of the following sections that apply to your environment. You might need to complete the steps in only one of these sections or in both of these sections:

For each populated database, complete the steps in "Configuring Populated Databases When Creating a Multiple-Source Environment" on page 7-8. These steps are required only if your environment has more than one populated database.

For each import database, complete the steps in "Adding Shared Objects to Import Databases When Creating a New Environment" on page 7-8.