Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\online_help\tdpii\tdpii_repcont021.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 Local Capture Processes</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:1Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Tutorial: Configuring Two-Database Replication with Local Capture Processes" /> <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_repcont020.htm" title="Previous" type="text/html" /> <link rel="next" href="tdpii_repcont022.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_repcont020.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_repcont022.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="CIHDBCGD" name="CIHDBCGD"></a><a id="TDPII181" name="TDPII181"></a></p> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h1>Tutorial: Configuring Two-Database Replication with Local Capture Processes<a id="sthref217" name="sthref217"></a><a id="sthref218" name="sthref218"></a><a id="sthref219" name="sthref219"></a><a id="sthref220" name="sthref220"></a><a id="sthref221" name="sthref221"></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 local capture processes to capture changes. This example uses the global database names <code>db1.example.com</code> and <code>db2.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>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>db1.example.com</code> database and the <code>db2.example.com</code> database before the wizard is run.</p> <p>This example provides instructions for configuring either one-way or bi-directional replication. To configure bi-directional replication, you must complete additional steps and select <span class="bold">Setup Bi-directional</span> on the appropriate wizard page.</p> <p><a href="#CIHFHFDJ">Figure: Two-Database Replication Environment with Local Capture Processes</a> provides an overview of the environment created in this example. The additional components required for bi-directional replication are shown in gray, and their actions are indicated by dashed lines.</p> <div class="figure"><a id="CIHFHFDJ" name="CIHFHFDJ"></a><a id="TDPII232" name="TDPII232"></a> <p class="titleinfigure">Two-Database Replication Environment with Local Capture Processes</p> <img src="img/tdpii509.gif" alt="Description of this figure follows" title="Description of this figure follows" longdesc="img_text/tdpii509.htm" /><br /> <a id="sthref222" name="sthref222" href="img_text/tdpii509.htm">Description of "Two-Database Replication Environment with Local Capture Processes"</a><br /> <br /></div> <!-- class="figure" --> <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>db1.example.com</code> database can communicate with the <code>db2.example.com</code> database.</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 the <code>db1.example.com</code> database to run in <code>ARCHIVELOG</code> mode. For a capture process to capture changes generated at a source database, the source database 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>If you are configuring a bi-directional replication environment, then configure the <code>db2.example.com</code> database to run in <code>ARCHIVELOG</code> mode. If you are configuring a one-way replication environment, then this step is not required, and you can move on to Step <a href="#BABECDFA">2</a>.</p> </li> </ol> </li> <li><a id="BABECDFA" name="BABECDFA"></a> <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>db1.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">Replicate Schemas</span> in Setup Streams Replication.</p> </li> <li><a id="BABCJHGB" name="BABCJHGB"></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="#BABCJHGB">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>If you do not want to replicate DDL changes, then deselect <span class="bold">Capture, Propagate and Apply data definition language (DDL) changes</span>.</p> </li> <li> <p>If you want to configure bi-directional replication, then select <span class="bold">Setup Bi-directional replication</span>.</p> </li> </ol> </li> <li> <p>Click <span class="bold">Next</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">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, optionally click the job link to monitor the job.</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> </ol> <p>When the job completes successfully, a two-database replication environment with the following characteristics is configured:</p> <ul> <li> <p>At <code>db1.example.com</code>, supplemental logging is configured for the tables in the <code>hr</code> schema.</p> </li> <li> <p>The <code>db1.example.com</code> database has the following components:</p> <ul> <li> <p>A capture process with a system-generated name. The capture process captures DML changes to the <code>hr</code> schema.</p> </li> <li> <p>A queue with a system-generated name. This queue is for the capture process at the database.</p> </li> <li> <p>A propagation with a system-generated name that sends changes from the queue at the <code>db1.example.com</code> database to the queue at the <code>db2.example.com</code> database.</p> </li> </ul> </li> <li> <p>The <code>db2.example.com</code> database has the following components:</p> <ul> <li> <p>A queue with a system-generated name that receives the changes sent from the <code>db1.example.com</code> database. This queue is for the apply process at the local database.</p> </li> <li> <p>An apply process with a system-generated name. The apply process dequeues changes from its queue and applies them to the <code>hr</code> schema.</p> </li> </ul> </li> <li> <p>If the replication environment is bi-directional, then the following are also configured:</p> <ul> <li> <p>At <code>db2.example.com</code>, supplemental logging for the tables in the <code>hr</code> schema.</p> </li> <li> <p>At <code>db2.example.com</code>, a capture process with a system-generated name. The capture process captures DML changes to the <code>hr</code> schema.</p> </li> <li> <p>At <code>db2.example.com</code>, a queue with a system-generated name. This queue is for the capture process at the database.</p> </li> <li> <p>At <code>db1.example.com</code>, a queue with a system-generated name that receives the changes sent from the <code>db2.example.com</code> database. This queue is for the apply process at the local database.</p> </li> <li> <p>At <code>db1.example.com</code>, an apply process with a system-generated name. The apply process dequeues changes from its queue and applies them to the <code>hr</code> schema.</p> </li> </ul> </li> <li> <p><a id="sthref224" name="sthref224"></a>If the replication environment is bi-directional, then tags are used to avoid change cycling in the following way:</p> <ul> <li> <p>Each apply process uses an apply tag, and redo records for changes applied by the apply process include the tag. Each apply process uses an apply tag that is unique in the replication environment.</p> </li> <li> <p>Each capture process captures all of the changes to the replicated database objects, regardless of the tag in the redo record. Therefore, each capture process captures the changes applied by the apply processes on its source database.</p> </li> <li> <p>Each propagation sends all changes made to the replicated database objects to the other database in the replication environment, except for changes that originated at the other database. The propagation rules instruct the propagation to discard these changes.</p> </li> </ul> <p>See <a href="tdpii_repcont011.htm#BABICHGF">"About Tags for Avoiding Change Cycling"</a> for more information about how the replication environment avoids change cycling. If you configured one-way replication, then change cycling is not possible because changes are only captured in a single location.</p> </li> </ul> <p class="orderedlisttitle">To check the Oracle Streams replication configuration: </p> <ol> <li> <p>At the <code>db1.example.com</code> database, ensure that the capture process is enabled and that the capture type is local. 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>db1.example.com</code> database, ensure that the propagation is enabled. To do so, follow the instructions in <a href="tdpii_adcont019.htm#CHDGEBHI">"Viewing Information About a Propagation"</a>, and check the Status field on the Propagation subpage.</p> </li> <li> <p>At the <code>db2.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 the Status field on the Apply subpage.</p> </li> <li> <p>If you configured bi-directional replication, then complete the following additional steps:</p> <ol> <li> <p>At the <code>db2.example.com</code> database, ensure that the capture process is enabled and that the capture type is local.</p> </li> <li> <p>At the <code>db2.example.com</code> database, ensure that the propagation is enabled.</p> </li> <li> <p>At the <code>db1.example.com</code> database, ensure that the apply process is enabled.</p> </li> </ol> </li> </ol> <p class="orderedlisttitle">To replicate changes: </p> <ol> <li> <p>At a database that captures changes to the <code>hr</code> schema, make DML changes to any table in the <code>hr</code> schema. In this example, the <code>db1.example.com</code> database captures changes to the <code>hr</code> schema, and, if you configured bi-directional replication, then <code>db2.example.com</code> also captures changes to the <code>hr</code> schema.</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 other 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 databases. If one-way replication is configured and they should be read only, then configure privileges at the destination databases 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=STREP599','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_repcont020.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_repcont022.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