Your browser does not support JavaScript. This help page requires JavaScript to render correctly.
Skip Headers
Previous
Previous
 
Next
Next

Tutorial: Adding Databases to a Replication Environment

This topic includes an example that uses the Setup Streams Replication Wizard in Oracle Enterprise Manager to add a new spoke database to an existing hub-and-spoke replication environment. When the example is complete, the Oracle Streams replication environment replicates the changes made to the schema with the new database.

Specifically, the example in this topic extends the replication environment configured in "Tutorial: Configuring Hub-and-Spoke Replication with Local Capture Processes". That configuration has the following characteristics:

This example adds the spoke3.example.com database to the environment.

Note: Before you use the Setup Streams Replication Wizard to extend an Oracle Streams replication environment, ensure that the environment meets the conditions described in "About Extending an Oracle Streams Replication Environment".

To add a database to an existing Oracle Streams replication environment: 

  1. Complete the following tasks to prepare the environment for the new database:

    1. Configure network connectivity so that the hub database can communicate with the new spoke database. In this example, configure network connectivity so that the hub.example.com database and the spoke3.example.com databases can communicate with each other.

      See Configuring the Network Environment for information about configuring network connectivity between databases.

    2. Configure an Oracle Streams administrator at the new spoke database. In this example, configure an Oracle Streams administrator at the spoke3.example.com database. See "Tutorial: Configuring an Oracle Streams Administrator" for instructions. This example assumes that the Oracle Streams administrator is strmadmin.

    3. Set initialization parameters properly at the new spoke database. In this example, set initialization parameters properly at the spoke3.example.com database. See "Preparing for Oracle Streams Replication" for instructions.

    4. Configure the new spoke database to run in ARCHIVELOG mode. For a capture process to capture changes generated at a source database, the source database must be running in ARCHIVELOG mode. In this example, configure the spoke3.example.com database to run in ARCHIVELOG mode. See Oracle Database Administrator's Guide for information about configuring a database to run in ARCHIVELOG mode.

  2. Stop the capture process at the hub database in the hub-and-spoke environment.

    In this example, stop the capture process at the hub.example.com database. The replicated database objects can remain open to changes while the capture process is stopped. These changes will be captured when the capture process is restarted.

    1. In Oracle Enterprise Manager, log in to the hub database as the Oracle Streams administrator.

    2. Go to the Database Home page.

    3. Click Data Movement to open the Data Movement subpage.

    4. Click Manage Replication in the Streams section.

      The Streams page appears, showing the Overview subpage.

    5. Click callbackStreams to open the Streams subpage.

    6. Select the capture process that you want to stop. If necessary, use the search tool to find the capture process, and then select it.

    7. Select Disable in Action.

    8. Click Go.

    9. Click Yes on the confirmation page to stop the capture process.

    Note: You can also use the DBMS_CAPTURE_ADM.STOP_CAPTURE procedure to stop a capture process.

  3. While still connected to the hub database as the Oracle Streams administrator in Oracle Enterprise Manager, go to the Database Home page for the database instance.

  4. Click Data Movement to open the Data Movement subpage.

  5. Click callbackSetup in the Streams section.

    The Streams page appears, showing the setup options.

  6. Select Replicate Schemas in Setup Streams Replication.

  7. In the Host Credentials section, enter the username and password for an administrative user on the host computer system.

  8. Click Continue.

  9. On the Object Selection page, select HR and click Next.

  10. On the Destination Options page, identify the spoke database spoke3.example.com by specifying its host name, port, SID or service name, and Oracle Streams administrator credentials.

  11. Click Next.

  12. Complete the Replication Options page:

    1. In the Directory Path section, leave the directory paths for the source and destination database unchanged if the host user you specified in Step 7 can read from and write to the directories and the directories have enough space for a Data Pump export dump file. Otherwise, specify different directory paths, or create directory objects that meet these requirements and specify those.

    2. Expand Advanced Options.

    3. In the Options section, ensure that Capture, Propagate and Apply data manipulation language (DML) changes is selected.

    4. If you do not want to replicate DDL changes, then deselect Capture, Propagate and Apply data definition language (DDL) changes.

    5. Select Setup Bi-directional replication.

    6. In the Capture Process section, enter capture_hns in Capture Name.

    7. In the Propagation Process section, enter propagation_spoke3 in Propagation Name.

    8. In the Apply Process section, enter apply_spoke3 in Apply Name.

  13. Click Next.

  14. On the Schedule Job page, either select Immediately or specify a time for the job to run later.

  15. Click Next.

  16. On the Review page, review the configuration information and click Submit.

  17. On the Confirmation page, optionally click the job link to monitor the job.

    When the job is running, information about its progress is recorded in the following data dictionary views: DBA_RECOVERABLE_SCRIPT, DBA_RECOVERABLE_SCRIPT_PARAMS, DBA_RECOVERABLE_SCRIPT_BLOCKS, and DBA_RECOVERABLE_SCRIPT_ERRORS. If the job stops because it encounters an error, then see Oracle Streams Replication Administrator's Guide for instructions about using the RECOVER_OPERATION procedure in the DBMS_STREAMS_ADM package to recover from these errors.

  18. Configure latest time conflict resolution for all of the tables in the hr schema at the spoke3.example.com database. This schema includes the countries, departments, employees, jobs, job_history, locations, and regions tables. "Tutorial: Configuring Latest Time Conflict Resolution for a Table" for instructions.

Related Topics

Replicating Data Using Oracle Streams

Extending an Oracle Streams Replication Environment