Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\online_help\tdpii\tdpii_repcont022.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>Tutorial: Configuring Two-Database Replication with a Downstream Capture Process</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1 Build 005" /> <meta name="date" content="2009-06-04T17:1:2Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Tutorial: Configuring Two-Database Replication with a Downstream Capture Process" /> <meta name="relnum" content="11g Release 2 (11.2)" /> <meta name="partnum" content="E10703-01" /> <link rel="copyright" href="./dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> <link rel="stylesheet" href="./dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" /> <link rel="contents" href="toc.htm" title="Contents" type="text/html" /> <link rel="prev" href="tdpii_repcont021.htm" title="Previous" type="text/html" /> <link rel="next" href="tdpii_repcont023.htm" title="Next" type="text/html" /> <script src="./callback.js" type="text/javascript"></script> <noscript>Your browser does not support JavaScript. This help page requires JavaScript to render correctly.</noscript> </head> <body> <div class="zz-skip-header"><a href="#BEGIN">Skip Headers</a></div> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr valign="bottom"> <td align="left"></td> <td align="center"><a href="tdpii_repcont021.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_repcont023.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="BABIJCDG" name="BABIJCDG"></a><a id="TDPII082" name="TDPII082"></a></p> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h1>Tutorial: Configuring Two-Database Replication with a Downstream Capture Process<a id="sthref227" name="sthref227"></a><a id="sthref228" name="sthref228"></a><a id="sthref229" name="sthref229"></a><a id="sthref230" name="sthref230"></a><a id="sthref231" name="sthref231"></a></h1> <a name="BEGIN" id="BEGIN"></a> <p>This example configures an Oracle Streams replication environment that replicates data manipulation language (DML) changes to all of the tables in the <code>hr</code> schema. This example configures a two-database replication environment with a downstream capture process at the destination database. This example uses the global database names <code>src.example.com</code> and <code>dest.example.com</code>. However, you can substitute databases in your environment to complete the example. See <a href="tdpii_repcont013.htm#CIHGHCGI">"About Two-Database Replication Environments"</a> for more information about two-database replication environments.</p> <p>In this example, the downstream capture process runs on the destination database <code>dest.example.com</code>. Therefore, the resources required to capture changes are freed at the source database <code>src.example.com</code>. This example configures a real-time downstream capture process, not an archived-log downstream capture process. The advantage of real-time downstream capture is that it reduces the amount of time required to capture the changes made at the source database. The time is reduced because the real-time downstream capture process does not need to wait for the redo log file to be archived before it can capture data from it.</p> <p>This example assumes that the replicated database objects are used for reporting and analysis at the destination database. Therefore, these database objects are assumed to be read-only at the <code>dest.example.com</code> database.</p> <p>This example uses the Setup Streams Replication Wizard in Oracle Enterprise Manager to configure the two-database replication environment. This wizard is the fastest and simplest way to configure an Oracle Streams environment that replicates one or more schemas. In addition, the wizard follows established best practices for Oracle Streams replication environments.</p> <p>The database objects being configured for replication might or might not exist at the destination database when you run the wizard. If the database objects do not exist at the destination database, then the wizard instantiates them at the destination database using a Data Pump export/import. During instantiation, the instantiation SCN is set for these database objects. If the database objects already exist at the destination database, then the wizard retains the existing database objects and sets the instantiation SCN for them. In this example, the <code>hr</code> schema exists at both the <code>src.example.com</code> database and the <code>dest.example.com</code> database before the wizard is run.</p> <p><a href="#CIHHCJEC">Figure: Two-Database Replication Environment with a Downstream Capture Process</a> provides an overview of the environment created in this example.</p> <div class="figure"><a id="CIHHCJEC" name="CIHHCJEC"></a><a id="TDPII236" name="TDPII236"></a> <p class="titleinfigure">Two-Database Replication Environment with a Downstream Capture Process</p> <img src="img/tdpii506.gif" alt="Description of this figure follows" title="Description of this figure follows" longdesc="img_text/tdpii506.htm" /><br /> <a id="sthref232" name="sthref232" href="img_text/tdpii506.htm">Description of "Two-Database Replication Environment with a Downstream Capture Process"</a><br /> <br /></div> <!-- class="figure" --> <div class="helpinfonote"> <p><span class="bold">Note: </span>Local capture processes provide more flexibility than downstream capture processes in replication environments with different platforms or different versions of Oracle Database. See <a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=STRMS129','newWindow').focus()"><span class="italic">Oracle Streams Concepts and Administration</span></a> for more information.</p> </div> <p class="orderedlisttitle">To configure this two-database replication environment: </p> <ol> <li> <p>Complete the following tasks to prepare for the two-database replication environment:</p> <ol> <li> <p>Configure network connectivity so that the <code>src.example.com</code> database and the <code>dest.example.com</code> database can communicate with each other.</p> <p>See <a href="topicid:ADMQS004">Configuring the Network Environment</a> for information about configuring network connectivity between databases.</p> </li> <li> <p>Configure an Oracle Streams administrator at each database that will participate in the replication environment. See <a href="tdpii_common_ii002.htm#BGBHDJHF">"Tutorial: Configuring an Oracle Streams Administrator"</a> for instructions. This example assumes that the Oracle Streams administrator is <code>strmadmin</code>.</p> </li> <li> <p>Set initialization parameters properly at each database that will participate in the Oracle Streams replication environment. See <a href="tdpii_repcont019.htm#BABDHIIH">"Preparing for Oracle Streams Replication"</a> for instructions.</p> </li> <li> <p>Configure both databases to run in <code>ARCHIVELOG</code> 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 <code>ARCHIVELOG</code> mode. In this example, the <code>src.example.com</code> and <code>dest.example.com</code> databases must be running in <code>ARCHIVELOG</code> mode. See <a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=ADMIN008','newWindow').focus()"><span class="italic">Oracle Database Administrator's Guide</span></a> for information about configuring a database to run in <code>ARCHIVELOG</code> mode.</p> </li> <li> <p>Configure authentication at both databases to support the transfer of redo data.</p> <p>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.</p> <p>In this example, the source database is <code>src.example.com</code> and the downstream capture database is <code>dest.example.com</code>. See <a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=SBYDB00424','newWindow').focus()"><span class="italic">Oracle Data Guard Concepts and Administration</span></a> for detailed information about authentication requirements for redo transport.</p> </li> </ol> </li> <li><a id="BABJEGIA" name="BABJEGIA"></a> <p>Configure initialization parameters at both the source database and the downstream database to support downstream capture.</p> <p>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 <code>src.example.com</code> to the standby redo log at the downstream database <code>dest.example.com</code>.</p> <p>To configure initialization parameters to support downstream capture:</p> <ol> <li> <p>In Enterprise Manager, log in to the source database as the Oracle Streams administrator.</p> <p>In this example, the source database is <code>src.example.com</code>.</p> </li> <li> <p>Go to the Database Home page for the database instance.</p> </li> <li> <p>Click <span class="bold">Data Movement</span> to open the Data Movement subpage.</p> </li> <li> <p>Click <img src="shortcut.png" alt="callback" border="0" /><a href="javascript:void(0);" onclick="redirectEMpage('STREAMS_SETUP');"><span class="bold">Setup</span></a> in the Streams section.</p> <p>The Streams page appears, showing the setup options.</p> </li> <li> <p>Select <span class="bold">Setup Downstream Capture</span>.</p> </li> <li> <p>In the Host Credentials section, enter the username and password for an administrative user on the host computer system.</p> </li> <li> <p>Click <span class="bold">Continue</span>.</p> <p>The Setup Downstream Capture page appears.</p> </li> <li> <p>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.</p> </li> <li> <p>In the Capture Process Details section, enter <code>capture</code> in the Capture Process Name field and ensure that <span class="bold">Real-Time Downstream Capture</span> is selected.</p> </li> <li> <p>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.</p> <p>Specify either a valid path name for a disk directory or, to use a flash recovery area, specify <code>USE_DB_RECOVERY_FILE_DEST</code>. 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 <a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=BRADV8183','newWindow').focus()"><span class="italic">Oracle Database Backup and Recovery User's Guide</span></a> for information about configuring a flash recovery area.</p> </li> <li> <p>In the Log Details section, ensure that <span class="bold">Configure Log Parameters for Downstream Capture</span> is selected and that <code>LOG_ARCHIVE_DEST_</code><code><span class="codeinlineitalic">n</span></code> parameter in Log Parameter is not already in use at the source database.</p> </li> <li> <p>Click <span class="bold">OK</span>.</p> </li> <li> <p>On the Schedule Job page, either select <span class="bold">Immediately</span> or specify a time for the job to run later.</p> </li> <li> <p>Click <span class="bold">OK</span>.</p> </li> <li> <p>On the Confirmation page, optionally click the job link to monitor the job.</p> </li> </ol> <p>When the job completes successfully, downstream capture is configured. Do not proceed until the jobs completes successfully.</p> </li> <li> <p>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.</p> </li> <li> <p>Click <span class="bold">Data Movement</span> to open the Data Movement subpage.</p> </li> <li> <p>Click <img src="shortcut.png" alt="callback" border="0" /><a href="javascript:void(0);" onclick="redirectEMpage('STREAMS_SETUP');"><span class="bold">Setup</span></a> in the Streams section.</p> <p>The Streams page appears, showing the setup options.</p> </li> <li> <p>Select <span class="bold">Replicate Schemas</span> in Setup Streams Replication.</p> </li> <li><a id="BABEHCCE" name="BABEHCCE"></a> <p>In the Host Credentials section, enter the username and password for an administrative user on the host computer system.</p> </li> <li> <p>Click <span class="bold">Continue</span>.</p> </li> <li> <p>On the Object Selection page, select <span class="bold">HR</span> and click <span class="bold">Next</span>.</p> </li> <li> <p>On the Destination Options page, identify the destination database by specifying its host name, port, SID or service name, and Oracle Streams administrator credentials.</p> </li> <li> <p>Click <span class="bold">Next</span>.</p> </li> <li> <p>Complete the Replication Options page:</p> <ol> <li> <p>In the Directory Path section, leave the directory paths for the source and destination database unchanged if the host user you specified in Step <a href="#BABEHCCE">7</a> 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.</p> </li> <li> <p>Expand <span class="bold">Advanced Options</span>.</p> </li> <li> <p>In the Options section, ensure that <span class="bold">Capture, Propagate and Apply data manipulation language (DML) changes</span> is selected.</p> </li> <li> <p>In the Options section, deselect <span class="bold">Capture, Propagate and Apply data definition language (DDL) changes</span> and ensure that <span class="bold">Setup Bi-directional replication</span> is not selected.</p> </li> <li> <p>In the Capture Process section, select <span class="bold">Downstream Capture</span>.</p> </li> <li> <p>In the Capture Process section, identify the downstream capture host, database, and capture process, and enter the credentials for the Oracle Streams administrator at the downstream database. You configured downstream capture in Step <a href="#BABJEGIA">2</a>. In this example, the name of the downstream capture process is <code>capture</code>.</p> </li> <li> <p>In the Capture Process section, ensure that the correct <code>LOG_ARCHIVE_DEST_</code><code><span class="codeinlineitalic">n</span></code> initialization parameter is selected in Log Parameter. You configured this initialization parameter Step <a href="#BABJEGIA">2</a>.</p> </li> <li> <p>In the Apply Process section, enter <code>apply</code>.</p> </li> </ol> </li> <li> <p>On the Schedule Job page, either select <span class="bold">Immediately</span> or specify a time for the job to run later.</p> </li> <li> <p>Click <span class="bold">Next</span>.</p> </li> <li> <p>On the Review page, review the configuration information and click <span class="bold">Submit</span>.</p> </li> <li> <p>On the Confirmation page, click the job link to monitor the job. Do not proceed to the next step until the job completes successfully.</p> <p>When the job is running, information about its progress is recorded in the following data dictionary views: <code>DBA_RECOVERABLE_SCRIPT</code>, <code>DBA_RECOVERABLE_SCRIPT_PARAMS</code>, <code>DBA_RECOVERABLE_SCRIPT_BLOCKS</code>, and <code>DBA_RECOVERABLE_SCRIPT_ERRORS</code>. If the job stops because it encounters an error, then see <a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=STREP149','newWindow').focus()"><span class="italic">Oracle Streams Replication Administrator's Guide</span></a> for instructions about using the <code>RECOVER_OPERATION</code> procedure in the <code>DBMS_STREAMS_ADM</code> package to recover from these errors.</p> </li> <li> <p>In SQL*Plus, connect to the source database <code>src.example.com</code> as an administrative user.</p> <p>See <a href="topicid:ADMQS0361">Starting SQL*Plus and Connecting to the Database</a> for more information about starting SQL*Plus.</p> </li> <li> <p>Archive the current log file at the source database:</p> <pre xml:space="preserve" class="oac_no_warn"> ALTER SYSTEM ARCHIVE LOG CURRENT; </pre> <p>Archiving the current log file at the source database starts real-time mining of the source database redo log.</p> </li> </ol> <p>When you complete the example, a two-database replication environment with the following characteristics is configured:</p> <ul> <li> <p>At the <code>src.example.com</code> database, supplemental logging is configured for the tables in the <code>hr</code> schema.</p> </li> <li> <p>The <code>dest.example.com</code> database has the following components:</p> <ul> <li> <p>A downstream capture process named <code>capture</code>. The capture process captures changes to the <code>hr</code> schema in the redo log information sent from the source database <code>src.example.com</code>.</p> </li> <li> <p>A queue with a system-generated name. This queue is for the capture process and apply process at the database.</p> </li> <li> <p>An apply process named <code>apply</code>. The apply process applies changes to the <code>hr</code> schema.</p> </li> </ul> </li> </ul> <p class="orderedlisttitle">To check the Oracle Streams replication configuration: </p> <ol> <li> <p>At the <code>dest.example.com</code> database, ensure that the capture process is enabled and that the capture type is downstream. To do so, follow the instructions in <a href="tdpii_adcont015.htm#CHDIFCCD">"Viewing Information About a Capture Process"</a>, and check the Status and Capture Type fields on the Capture subpage.</p> </li> <li> <p>At the <code>dest.example.com</code> database, ensure that the apply process is enabled. To do so, follow the instructions in <a href="tdpii_adcont022.htm#CHDIGAED">"Viewing Information About an Apply Process"</a>, and check Status field on the Apply subpage.</p> </li> </ol> <p class="orderedlisttitle">To replicate changes: </p> <ol> <li> <p>At the <code>src.example.com</code> database, make DML changes to any table in the <code>hr</code> schema, and commit the changes.</p> </li> <li> <p>After some time has passed to allow for replication of the changes, use SQL*Plus to query the modified table at the <code>dest.example.com</code> database to view the DML changes.</p> </li> </ol> <div class="helpinfonote"> <p><span class="bold">Note: </span>The wizard does not configure the replicated tables to be read only at the destination database. If they should be read only, then configure privileges at the destination database accordingly. However, the apply user for the apply process must be able to make DML changes to the replicated database objects. In this example, the apply user is the Oracle Streams administrator. See <a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=DBSEG004','newWindow').focus()"><span class="italic">Oracle Database Security Guide</span></a> for information about configuring privileges.</p> </div> <div class="helpinfonotealso"> <h2>Related Topics</h2> <p><a href="tdpii_repcont014.htm#CIHJEIDB">About Hub-And-Spoke Replication Environments</a></p> <p><a href="tdpii_intro2ii004.htm#CFHJAAEA">When to Replicate Data with Oracle Streams</a></p> <p><a href="tdpii_adcont.htm#CHDHCDDJ">Administering an Oracle Streams Replication Environment</a></p> <p><a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=STRMS153','newWindow').focus()"><span class="italic">Oracle Streams Concepts and Administration</span></a> for more information about downstream capture processes</p> <p><a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=STREP602','newWindow').focus()"><span class="italic">Oracle Streams Replication Administrator's Guide</span></a> for an example that configures this replication environment using the <code>DBMS_STREAMS_ADM</code> supplied PL/SQL package</p> </div> </div> <!-- class="sect2" --> <!-- Start Footer --> <div class="footer"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr> <td align="left"><span class="copyrightlogo">Copyright © 2007, 2009, Oracle and/or its affiliates. All rights reserved.</span><br /> <a href="./dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td> <td align="center"><a href="tdpii_repcont021.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_repcont023.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> </div> <!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de