instantiation SCN for them. In this example, the hr schema exists at both the src.example.com database and the dest.example.com database before the wizard is run.
Figure 4–12 provides an overview of the environment created in this example.
Figure 4–12 Two-Database Replication Environment with a Downstream Capture Process
To configure this two-database replication environment:
1. Complete the following tasks to prepare for the two-database replication environment:
a. Configure network connectivity so that the src.example.com database and the dest.example.com database can communicate with each other.
See Oracle Database 2 Day DBA for information about configuring network connectivity between databases.
b. Configure an Oracle Streams administrator at each database that will participate in the replication environment. See "Tutorial: Configuring an Note: Local capture processes provide more flexibility than
downstream capture processes in replication environments with different platforms or different versions of Oracle Database. See Oracle Streams Concepts and Administration for more information.
Sent by Redo Transport Services
Oracle Database src.example.com
Queue
Oracle Database dest.example.com
Enqueue Changes
Dequeue Changes Apply
Changes Record Changes
Capture DML Changes to hr Schema Redo
Log
Redo Log from src.example.com
Capture Process capture
Apply Process apply
Tables in hr schema
Tables in hr schema
Oracle Streams Administrator" on page 2-2 for instructions. This example assumes that the Oracle Streams administrator is strmadmin.
c. Set initialization parameters properly at each database that will participate in the Oracle Streams replication environment. See "Preparing for Oracle Streams Replication" on page 4-18 for instructions.
d. Configure both databases to run in ARCHIVELOG mode. For a downstream capture process to capture changes generated at a source database, both the source database and the downstream capture database must be running in ARCHIVELOG mode. In this example, the src.example.com and
dest.example.com databases must be running in ARCHIVELOG mode. See Oracle Database Administrator's Guide for information about configuring a database to run in ARCHIVELOG mode.
e. Configure authentication at both databases to support the transfer of redo data.
Redo transport sessions are authenticated using either the Secure Sockets Layer (SSL) protocol or a remote login password file. If the source database has a remote login password file, then copy it to the appropriate directory on the downstream capture database system. The password file must be the same at the source database and the downstream capture database.
In this example, the source database is src.example.com and the
downstream capture database is dest.example.com. See Oracle Data Guard Concepts and Administration for detailed information about authentication requirements for redo transport.
2. Configure initialization parameters at both the source database and the downstream database to support downstream capture.
The initialization parameters must be set properly at both databases for redo transport services to transmit redo data from the online redo log at the source database src.example.com to the standby redo log at the downstream database dest.example.com.
To configure initialization parameters to support downstream capture:
a. In Enterprise Manager, log in to the source database as the Oracle Streams administrator.
In this example, the source database is src.example.com.
b. Go to the Database Home page for the database instance.
c. Click Data Movement to open the Data Movement subpage.
d. Click Setup in the Streams section.
The Streams page appears, showing the setup options.
e. Select Setup Downstream Capture.
f. In the Host Credentials section, enter the username and password for an administrative user on the host computer system.
g. Click Continue.
The Setup Downstream Capture page appears.
h. In the Downstream Database Details section, identify the downstream capture database host name, port, and SID or service name, and enter the credentials for the Oracle Streams administrator at the downstream database.
In this example, the downstream capture database is dest.example.com.
i. In the Capture Process Details section, enter capture in the Capture Process Name field and ensure that Real-Time Downstream Capture is selected.
j. In the Log Details section, enter a location for the archived redo log files on the computer system running the downstream database in the Standby Redo Log File Location field.
Specify either a valid path name for a disk directory or, to use a fast recovery area, specify USE_DB_RECOVERY_FILE_DEST. This location is the local destination for archived redo log files written from the standby redo logs. Log files from a remote source database should be kept separate from local
database log files. See Oracle Database Backup and Recovery User's Guide for information about configuring a fast recovery area.
k. In the Log Details section, ensure that Configure Log Parameters for
Downstream Capture is selected and that LOG_ARCHIVE_DEST_n parameter in Log Parameter is not already in use at the source database.
l. Click OK.
m. On the Schedule Job page, either select Immediately or specify a time for the job to run later.
n. Click OK.
o. On the Confirmation page, optionally click the job link to monitor the job.
When the job completes successfully, downstream capture is configured. Do not proceed until the jobs completes successfully.
3. While still logged in to the source database in Enterprise Manager as the Oracle Streams administrator, go to the Database Home page for the database instance.
4. Click Data Movement to open the Data Movement subpage.
5. Click Setup 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 destination database by specifying its host name, port, SID or service name, and Oracle Streams administrator credentials.
In this example, the destination database is dest.example.com.
11. Click Next.
The Replication Options page appears.
12. Complete the Replication Options page:
a. 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.
b. Expand Advanced Options.
c. In the Options section, ensure that Capture, Propagate and Apply data manipulation language (DML) changes is selected.
d. In the Options section, deselect Capture, Propagate and Apply data definition language (DDL) changes and ensure that Setup Bi-directional replication is not selected.
e. In the Capture Process section, select Downstream Capture.
f. In the Capture Process section, enter the downstream capture database host name, port, and SID or service name, and enter the credentials for the Oracle Streams administrator at the downstream database.
g. In the Capture Name field, enter capture. You configured this downstream capture process in Step 2.
h. In the Apply Name field, enter apply.
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, click the job link to monitor the job. Do not proceed to the next step until the job completes successfully.
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. In SQL*Plus, connect to the source database src.example.com as an administrative user.
See Oracle Database 2 Day DBA for more information about starting SQL*Plus.
19. Archive the current log file at the source database:
ALTER SYSTEM ARCHIVE LOG CURRENT;
Archiving the current log file at the source database starts real-time mining of the source database redo log.
When you complete the example, a two-database replication environment with the following characteristics is configured:
■ At the src.example.com database, supplemental logging is configured for the tables in the hr schema.
■ The dest.example.com database has the following components:
– A downstream capture process named capture. The capture process captures changes to the hr schema in the redo log information sent from the source database src.example.com.
– A queue with a system-generated name. This queue is for the capture process and apply process at the database.
– An apply process named apply. The apply process applies changes to the hr schema.
To check the Oracle Streams replication configuration:
1. At the dest.example.com database, ensure that the capture process is enabled and that the capture type is downstream. To do so, follow the instructions in
"Viewing Information About a Capture Process" on page 5-13, and check the Status and Capture Type fields on the Capture subpage.
2. At the dest.example.com database, ensure that the apply process is enabled. To do so, follow the instructions in "Viewing Information About an Apply Process"
on page 5-22, and check Status field on the Apply subpage.
To replicate changes:
1. At the src.example.com database, make DML changes to any table in the hr schema, and commit the changes.
2. After some time has passed to allow for replication of the changes, use SQL*Plus to query the modified table at the dest.example.com database to view the DML changes.