Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\online_help\tdpii\tdpii_repcont023.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 Hub-and-Spoke 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:2Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Tutorial: Configuring Hub-and-Spoke 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_repcont022.htm" title="Previous" type="text/html" /> <link rel="next" href="tdpii_repcont024.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_repcont022.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_repcont024.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="BABBIBCD" name="BABBIBCD"></a><a id="TDPII081" name="TDPII081"></a></p> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h1>Tutorial: Configuring Hub-and-Spoke Replication with Local Capture Processes<a id="sthref236" name="sthref236"></a><a id="sthref237" name="sthref237"></a><a id="sthref238" name="sthref238"></a><a id="sthref239" name="sthref239"></a><a id="sthref240" name="sthref240"></a></h1> <a name="BEGIN" id="BEGIN"></a> <p>This example configures an Oracle Streams hub-and-spoke replication environment that replicates data manipulation language (DML) changes to all of the tables in the <code>hr</code> schema. This example uses a capture process at each database to capture these changes. Hub-and-spoke replication means that a central hub database replicates changes with one or more spoke databases. The spoke databases do not communicate with each other directly. In this sample configuration, the hub database sends changes generated at one spoke database to the other spoke database. See <a href="tdpii_repcont014.htm#CIHJEIDB">"About Hub-And-Spoke Replication Environments"</a> for more information about hub-and-spoke replication environments.</p> <p>This example uses the Setup Streams Replication Wizard in Oracle Enterprise Manager to configure the hub-and-spoke 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>In this example, the global name of the hub database is <code>hub.example.com</code>, and the global names of the spoke databases are <code>spoke1.example.com</code> and <code>spoke2.example.com</code>. However, you can substitute databases in your environment to complete the example.</p> <p>The database objects being configured for replication might or might not exist at the destination databases when you run the wizard. If the database objects do not exist at a 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 a 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 each database before the wizard is run.</p> <p><a href="#CIHEFFEH">Figure: Hub-and-Spoke Environment with Capture Processes and Read/Write Spokes</a> provides an overview of the environment created in this example.</p> <div class="figure"><a id="CIHEFFEH" name="CIHEFFEH"></a><a id="TDPII240" name="TDPII240"></a> <p class="titleinfigure">Hub-and-Spoke Environment with Capture Processes and Read/Write Spokes</p> <img src="img/tdpii504.gif" alt="Description of this figure follows" title="Description of this figure follows" longdesc="img_text/tdpii504.htm" /><br /> <a id="sthref241" name="sthref241" href="img_text/tdpii504.htm">Description of "Hub-and-Spoke Environment with Capture Processes and Read/Write Spokes"</a><br /> <br /></div> <!-- class="figure" --> <p class="orderedlisttitle">To configure this hub-and-spoke replication environment with read/write spokes: </p> <ol> <li> <p>Complete the following tasks to prepare for the hub-and-spoke replication environment:</p> <ol> <li> <p>Configure network connectivity so that the following databases can communicate with each other:</p> <ul> <li> <p>The <code>hub.example.com</code> database and the <code>spoke1.example.com</code> database</p> </li> <li> <p>The <code>hub.example.com</code> database and the <code>spoke2.example.com</code> database</p> </li> </ul> <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 each source 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. In this example, all 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> </ol> </li> <li> <p>In Enterprise Manager, log in to the hub database <code>hub.example.com</code> as the Oracle Streams administrator.</p> </li> <li><a id="BABEFBAE" name="BABEFBAE"></a> <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="BABBGCDH" name="BABBGCDH"></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><a id="BABBFEDJ" name="BABBFEDJ"></a> <p>On the Destination Options page, identify the spoke database <code>spoke1.example.com</code> by specifying its host name, port, SID or service name, and Oracle Streams administrator credentials.</p> <p>(When you configure replication with the <code>spoke2.example.com</code> database, identify <code>spoke2.example.com</code>.)</p> </li> <li> <p>Click <span class="bold">Next</span>.</p> </li> <li><a id="BABHCBGD" name="BABHCBGD"></a> <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="#BABBGCDH">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>Select <span class="bold">Setup Bi-directional</span> replication.</p> </li> <li> <p>In the Capture Process section, enter <code>capture_hns</code> in <span class="bold">Capture Name</span>.</p> </li> <li><a id="BABICFAC" name="BABICFAC"></a> <p>In the Propagation Process section, enter <code>propagation_spoke1</code> in <span class="bold">Propagation Name</span>. (When you configure replication with the <code>spoke2.example.com</code> database, enter <code>propagation_spoke2</code>.)</p> </li> <li><a id="BABHHGBF" name="BABHHGBF"></a> <p>In the Apply Process section, enter <code>apply_spoke1</code> in <span class="bold">Apply Name</span>. (When you configure replication with the <code>spoke2.example.com</code> database, enter <code>apply_spoke2</code>.)</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><a id="BABGGCGH" name="BABGGCGH"></a> <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> <li> <p>While still connected as the Oracle Streams administrator to the <code>hub.example.com</code> database, complete Steps <a href="#BABEFBAE">3</a> to <a href="#BABGGCGH">17</a> again. However, in Step <a href="#BABBFEDJ">10</a>, on the Destination Options page, identify the spoke database <code>spoke2.example.com</code> by specifying its host name, port, SID or service name, and Oracle Streams administrator credentials.</p> <p>Also, in Step <a href="#BABHCBGD">12</a><a href="#BABICFAC">g</a>, enter <code>propagation_spoke2</code> in <span class="bold">Propagation Name</span>, and in Step <a href="#BABHCBGD">12</a><a href="#BABHHGBF">h</a>, enter <code>apply_spoke2</code> in <span class="bold">Apply Name</span></p> </li> </ol> <p>When you complete the example, a hub-and-spoke replication environment with the following characteristics is configured:</p> <ul> <li> <p>Supplemental logging is configured for the tables in the <code>hr</code> schema at each database.</p> </li> <li> <p>Each database has a capture process named <code>capture_hns</code>. The capture process captures changes to the <code>hr</code> schema at the database.</p> </li> <li> <p>Each database has a queue with a system-generated name. Each queue is for the capture process at the database.</p> </li> <li> <p>The hub database <code>hub.example.com</code> has the following additional components:</p> <ul> <li> <p>An apply process named <code>apply_spoke1</code>. This apply process applies changes to the <code>hr</code> schema that were sent from the <code>spoke1.example.com</code> database.</p> </li> <li> <p>A queue with a system-generated name. This queue is for the <code>apply_spoke1</code> apply process at the database.</p> </li> <li> <p>An apply process named <code>apply_spoke2</code>. This apply process applies changes to the <code>hr</code> schema that were sent from the <code>spoke2.example.com</code> database.</p> </li> <li> <p>A queue with a system-generated name. This queue is for the <code>apply_spoke2</code> apply process at the database.</p> </li> <li> <p>A propagation named <code>propagation_spoke1</code>. This propagation sends changes to the <code>hr</code> schema from a local queue to a queue at the <code>spoke1.example.com</code> database.</p> </li> <li> <p>A propagation named <code>propagation_spoke2</code>. This propagation sends changes to the <code>hr</code> schema from a local queue to a queue at the <code>spoke2.example.com</code> database.</p> </li> </ul> </li> <li> <p>The spoke database <code>spoke1.example.com</code> has the following additional components:</p> <ul> <li> <p>An apply process named <code>apply_spoke1</code>. The apply process applies changes to the <code>hr</code> schema that were sent from the <code>hub.example.com</code> database.</p> </li> <li> <p>A queue with a system-generated name. This queue is for the <code>apply_spoke1</code> apply process at the database.</p> </li> <li> <p>A propagation named <code>propagation_spoke1</code>. This propagation sends changes to the <code>hr</code> schema from a local queue to a queue at the <code>hub.example.com</code> database.</p> </li> </ul> </li> <li> <p>The spoke database <code>spoke2.example.com</code> has the following additional components:</p> <ul> <li> <p>An apply process named <code>apply_spoke2</code>. The apply process applies changes to the <code>hr</code> schema that were sent from the <code>hub.example.com</code> database.</p> </li> <li> <p>A queue with a system-generated name. This queue is for the <code>apply_spoke2</code> apply process at the database.</p> </li> <li> <p>A propagation named <code>propagation_spoke2</code>. This propagation sends changes to the <code>hr</code> schema from a local queue to a queue at the <code>hub.example.com</code> database.</p> </li> </ul> </li> <li> <p><a id="sthref243" name="sthref243"></a>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 another 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> and <a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=ARPLS878','newWindow').focus()"><span class="italic">Oracle Database PL/SQL Packages and Types Reference</span></a> for more information about how the replication environment avoids change cycling.</p> </li> </ul> <p class="orderedlisttitle">To check the Oracle Streams replication configuration: </p> <ol> <li> <p>At each 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 each database, ensure that each 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. The hub database should have two propagations, and they should both be enabled. Each spoke database should have one propagation that is enabled.</p> </li> <li> <p>At each database, ensure that each 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. The hub database should have two apply processes, and they should both be enabled. Each spoke database should have one apply process that is enabled.</p> </li> </ol> <p class="orderedlisttitle">To replicate changes: </p> <ol> <li> <p>At one of the databases, make DML changes to any table in 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 databases to view the DML changes.</p> </li> </ol> <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=STREP604','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_repcont022.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_repcont024.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