Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\online_help\tdpii\tdpii_repextend002.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: Adding Database Objects to a Replication Environment</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: Adding Database Objects to a Replication Environment" /> <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_repextend001.htm" title="Previous" type="text/html" /> <link rel="next" href="tdpii_repextend003.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_repextend001.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_repextend003.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="CIHCDDIJ" name="CIHCDDIJ"></a><a id="TDPII088" name="TDPII088"></a></p> <div class="sect1"><!-- infolevel="all" infotype="General" --> <h1>Tutorial: Adding Database Objects to a Replication Environment<a id="sthref374" name="sthref374"></a><a id="sthref375" name="sthref375"></a><a id="sthref376" name="sthref376"></a><a id="sthref377" name="sthref377"></a></h1> <a name="BEGIN" id="BEGIN"></a> <p>This topic includes an example that uses the Setup Streams Replication Wizard in Oracle Enterprise Manager to add tables to an existing hub-and-spoke replication environment. When the example is complete, the Oracle Streams replication environment replicates the changes made to the added tables at the databases in the environment.</p> <p>Specifically, the example in this topic extends the replication environment configured in <a href="tdpii_repcont023.htm#BABBIBCD">"Tutorial: Configuring Hub-and-Spoke Replication with Local Capture Processes"</a>. That configuration has the following characteristics:</p> <ul> <li> <p>The <code>hr</code> schema is replicated at the <code>hub.example.com</code>, <code>spoke1.example.com</code>, and <code>spoke2.example.com</code> databases.</p> </li> <li> <p>The <code>hub.example.com</code> database is the hub database in the hub-and-spoke environment, while the other databases are the spoke databases.</p> </li> <li> <p>The spoke databases allow changes to the replicated schema, and each database has a local capture process to capture these changes.</p> </li> <li> <p>Update conflict handlers are configured for each replicated table at each database to resolve conflicts</p> </li> </ul> <p>This example adds the following tables to the environment:</p> <ul> <li> <p><code>oe.orders</code></p> </li> <li> <p><code>oe.order_items</code></p> </li> </ul> <p>This example uses the tables in the <code>oe</code> sample schema. The <code>oe</code> sample schema is installed by default with Oracle Database.</p> <div class="helpinfonote"> <p><span class="bold">Note: </span>Before you use the Setup Streams Replication Wizard to extend an Oracle Streams replication environment, ensure that the environment meets the conditions described in <a href="tdpii_repextend001.htm#BEBBEJHG">"About Extending an Oracle Streams Replication Environment"</a>.</p> </div> <p class="orderedlisttitle">To add database objects to an Oracle Streams replication environment: </p> <ol> <li><a id="BEBBDJEJ" name="BEBBDJEJ"></a> <p>Stop the capture process at the hub database in the hub-and-spoke environment.</p> <p>In this example, stop the capture process at the <code>hub.example.com</code> 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.</p> <ol> <li> <p>In Oracle Enterprise Manager, log in to the hub database as the Oracle Streams administrator.</p> </li> <li> <p>Go to the Database Home page.</p> </li> <li> <p>Click <span class="bold">Data Movement</span> to open the Data Movement subpage.</p> </li> <li> <p>Click <span class="bold">Manage Replication</span> in the Streams section.</p> <p>The Streams page appears, showing the Overview subpage.</p> </li> <li> <p>Click <img src="shortcut.png" alt="callback" border="0" /><a href="javascript:void(0);" onclick="redirectEMpage('STREAMS_CAPTURE');"><span class="bold">Streams</span></a> to open the Streams subpage.</p> </li> <li> <p>Select the capture process that you want to stop. If necessary, use the search tool to find the capture process, and then select it.</p> </li> <li> <p>Select <span class="bold">Disable</span> in Action.</p> </li> <li> <p>Click <span class="bold">Go</span>.</p> </li> <li> <p>Click <span class="bold">Yes</span> on the confirmation page to stop the capture process.</p> </li> </ol> <div class="helpinfonote"> <p><span class="bold">Note: </span>You can also use the <a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=ARPLS548','newWindow').focus()"><code>DBMS_CAPTURE_ADM.STOP_CAPTURE</code> procedure</a> to stop a capture process.</p> </div> </li> <li><a id="CIHJCEDB" name="CIHJCEDB"></a> <p>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.</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 Tables</span> in Setup Streams Replication.</p> </li> <li><a id="CIHDBFGI" name="CIHDBFGI"></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, click <span class="bold">Add</span> to open the Select Table page.</p> </li> <li> <p>Use the search tools to display the <code>oe.orders</code> and <code>oe.order_items</code> tables, and select these tables.</p> <p>For example, to display these tables, enter <code>oe</code> in the Schema field and click <span class="bold">Go</span>.</p> </li> <li> <p>Click <span class="bold">Select</span>. The Object Selection page displays the <code>oe.orders</code> and <code>oe.order_items</code> tables.</p> </li> <li> <p>Click <span class="bold">Next</span>.</p> </li> <li><a id="CIHEIHGH" name="CIHEIHGH"></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="CIHGCFEG" name="CIHGCFEG"></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="#CIHDBFGI">6</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="CIHDHIDI" name="CIHDHIDI"></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="CIHEFEJJ" name="CIHEFEJJ"></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="CIHJGCCG" name="CIHJGCCG"></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 hub database, complete Steps <a href="#CIHJCEDB">2</a> to <a href="#CIHJGCCG">19</a> again. However, in Step <a href="#CIHEIHGH">12</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="#CIHGCFEG">14</a><a href="#CIHDHIDI">g</a>, enter <code>propagation_spoke2</code> in <span class="bold">Propagation Name</span>, and in Step <a href="#CIHGCFEG">14</a><a href="#CIHEFEJJ">h</a>, enter <code>apply_spoke2</code> in <span class="bold">Apply Name</span></p> </li> <li> <p>Set the instantiation SCN for the replicated tables at the spoke databases:</p> <div class="helpinfonote"> <p><span class="bold">Note: </span>This step is required in this example because the replicated tables existed at the spoke databases before the wizard was run. If the replicated tables did not exist at the spoke databases before the wizard was run, then the wizard sets the instantiation SCN for the replicated tables and this step is not required. Typically, when an instantiation SCN is set for a shared table in a replication environment, the data in the shared table is consistent at the source and destination databases.</p> </div> <ol> <li> <p>In SQL*Plus, connect to the <code>hub.example.com</code> database as the Oracle Streams administrator.</p> <p>See <a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=ADMIN00102','newWindow').focus()"><span class="italic">Oracle Database Administrator's Guide</span></a> for information about connecting to a database in SQL*Plus.</p> </li> <li> <p>Set the instantiation SCN for the <code>oe.orders</code> table at the <code>spoke1.example.com</code> database:</p> <pre xml:space="preserve" class="oac_no_warn"> DECLARE iscn NUMBER; -- Variable to hold instantiation SCN value BEGIN iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER(); DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN@spoke1.example.com( source_object_name => 'oe.orders', source_database_name => 'hub.example.com', instantiation_scn => iscn); END; / </pre></li> <li> <p>Set the instantiation SCN for the <code>oe.order_items</code> table at the <code>spoke1.example.com</code> database:</p> <pre xml:space="preserve" class="oac_no_warn"> DECLARE iscn NUMBER; -- Variable to hold instantiation SCN value BEGIN iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER(); DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN@spoke1.example.com( source_object_name => 'oe.order_items', source_database_name => 'hub.example.com', instantiation_scn => iscn); END; / </pre></li> <li> <p>Set the instantiation SCN for the <code>oe.orders</code> table at the <code>spoke2.example.com</code> database:</p> <pre xml:space="preserve" class="oac_no_warn"> DECLARE iscn NUMBER; -- Variable to hold instantiation SCN value BEGIN iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER(); DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN@spoke2.example.com( source_object_name => 'oe.orders', source_database_name => 'hub.example.com', instantiation_scn => iscn); END; / </pre></li> <li> <p>Set the instantiation SCN for the <code>oe.order_items</code> table at the <code>spoke2.example.com</code> database:</p> <pre xml:space="preserve" class="oac_no_warn"> DECLARE iscn NUMBER; -- Variable to hold instantiation SCN value BEGIN iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER(); DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN@spoke2.example.com( source_object_name => 'oe.order_items', source_database_name => 'hub.example.com', instantiation_scn => iscn); END; / </pre></li> </ol> </li> <li> <p>Configure latest time conflict resolution for the <code>orders</code> and <code>order_items</code> tables in the <code>oe</code> schema at the <code>hub.example.com</code>, <code>spoke1.example.com</code>, and <code>spoke2.example.com</code> databases. See <a href="tdpii_repcont025.htm#CIHIACBB">"Tutorial: Configuring Latest Time Conflict Resolution for a Table"</a> for instructions.</p> </li> </ol> <div class="helpinfonotealso"> <h2>Related Topics</h2> <p><a href="tdpii_repcont.htm#BABEFAFI">Replicating Data Using Oracle Streams</a></p> <p><a href="tdpii_repextend.htm#BEBHDEHC">Extending an Oracle Streams Replication Environment</a></p> </div> </div> <!-- class="sect1" --> <!-- 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_repextend001.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_repextend003.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