Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\online_help\tdpii\tdpii_diverge002.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: Preparing to Compare and Converge Data</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:3Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Tutorial: Preparing to Compare and Converge Data" /> <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_diverge001.htm" title="Previous" type="text/html" /> <link rel="next" href="tdpii_diverge003.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_diverge001.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_diverge003.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="BABDBGFC" name="BABDBGFC"></a><a id="TDPII092" name="TDPII092"></a></p> <div class="sect1"><!-- infolevel="all" infotype="General" --> <h1>Tutorial: Preparing to Compare and Converge Data</h1> <a name="BEGIN" id="BEGIN"></a> <p>Suppose you share the <code>hr.departments</code> table in two databases. You want to compare this table at these databases to see if their data is consistent. If the tables have diverged at the two databases, then you want to converge them to make them consistent.</p> <p>Meet the following prerequisites to complete this tutorial:</p> <ul> <li> <p>Configure network connectivity so that the two databases can communicate with each other. See <a href="topicid:ADMQS004">Configuring the Network Environment</a> for information about configuring network connectivity between databases.</p> </li> <li> <p>Ensure that the <code>hr</code> sample schema is installed on both databases. The <code>hr</code> sample schema is installed by default with Oracle Database.</p> </li> </ul> <p>In this example, the global names of the databases are <code>ii1.example.com</code> and <code>ii2.example.com</code>, but you can substitute any two databases in your environment that meet the prerequisites.</p> <p class="orderedlisttitle">To prepare for comparison and convergence of the hr.departments table at the ii1.example.com and ii2.example.com databases: </p> <ol> <li><a id="BABCFHIG" name="BABCFHIG"></a> <p>For the purposes of this example, make the <code>hr.departments</code> table diverge at the two databases:</p> <ol> <li> <p>On a command line, open SQL*Plus and connect to the <code>ii2.example.com</code> database as <code>hr</code> 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>Delete the department in the <code>hr.departments</code> table with the <code>department_id</code> equal to <code>270</code>:</p> <pre xml:space="preserve" class="oac_no_warn"> DELETE FROM hr.departments WHERE department_id=270; COMMIT; </pre></li> <li> <p>Modify the data in a row in the <code>hr.departments</code> table:</p> <pre xml:space="preserve" class="oac_no_warn"> UPDATE hr.departments SET manager_id=114 WHERE department_id=10; COMMIT; </pre></li> <li> <p>Insert a row into the <code>hr.departments</code> table:</p> <pre xml:space="preserve" class="oac_no_warn"> INSERT INTO hr.departments VALUES(280, 'Bean Counters', 108, 2700); COMMIT; </pre></li> <li> <p>Exit SQL*Plus:</p> <pre xml:space="preserve" class="oac_no_warn"> EXIT; </pre></li> </ol> <div class="helpinfonote"> <p><span class="bold">Note: </span>Usually, Step <a href="#BABCFHIG">1</a> is not required. It is included in this example to ensure that the <code>hr.departments</code> table diverges at the two databases.</p> </div> </li> <li><a id="BABBJGAB" name="BABBJGAB"></a> <p>Create a database link from the <code>ii1.example.com</code> database to the <code>ii2.example.com</code> database.</p> <p>The database link should connect from an administrative user in <code>ii1.example.com</code> to an administrative user schema in <code>ii2.example.com</code>. The administrative user at both databases should have the necessary privileges to access and modify the <code>hr.departments</code> table and the necessary privileges to run subprograms in the <code>DBMS_COMPARISON</code> package. If you are not sure which user has these privileges, then use <code>SYSTEM</code> user. Also, both the name and the service name of the database link must be <code>ii2.example.com</code>. See <a href="tdpii_common_ii006.htm#BGBGIACD">"Tutorial: Creating a Database Link"</a> for instructions.</p> </li> </ol> <div class="helpinfonotealso"> <h2>Related Topics</h2> <p><a href="tdpii_diverge001.htm#BABBAFCB">About Comparing and Converging Data in Different Databases</a></p> <p><a href="tdpii_diverge003.htm#BABCDFGB">Tutorial: Comparing Data in Two Different Databases</a></p> <p><a href="tdpii_diverge004.htm#BABFHACE">Tutorial: Converging Divergent Data</a></p> <p><a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=ARPLS868','newWindow').focus()"><span class="italic">Oracle Database PL/SQL Packages and Types Reference</span></a> for detailed information about the <code>DBMS_COMPARISON</code> package</p> <p><a href="javascript:open('http://www.oracle.com/pls/db112/lookup?id=STREP146','newWindow').focus()"><span class="italic">Oracle Streams Replication Administrator's Guide</span></a> for information about using the advanced features of the <code>DBMS_COMPARISON</code> package</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_diverge001.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_diverge003.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