Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\online_help\tdpii\tdpii_reppit010.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 Read-Only Data Replication Using Materialized Views</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 Read-Only Data Replication Using Materialized Views" /> <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_reppit009.htm" title="Previous" type="text/html" /> <link rel="next" href="tdpii_reppit011.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_reppit009.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_reppit011.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="BEHEBFJH" name="BEHEBFJH"></a><a id="TDPII055" name="TDPII055"></a></p> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h1>Tutorial: Configuring Read-Only Data Replication Using Materialized Views<a id="sthref428" name="sthref428"></a><a id="sthref429" name="sthref429"></a></h1> <a name="BEGIN" id="BEGIN"></a> <p>The example in this topic configures read-only data replication using materialized views. Specifically, this example creates the following read-only materialized views at a materialized view site:</p> <ul> <li> <p>The <code>mvadmin.employees_mvr</code> materialized view based on the <code>hr.employees</code> table at the master site.</p> </li> <li> <p>The <code>mvadmin.departments_mvr</code> materialized view based on the <code>hr.departments</code> table at the master site.</p> </li> </ul> <p class="orderedlisttitle">To configure these read-only materialized views: </p> <ol> <li> <p>Complete the actions described in the following topics:</p> <ul> <li> <p><a href="tdpii_reppit005.htm#CHDIHIFJ">"Preparing for Materialized View Replication"</a></p> </li> <li> <p><a href="tdpii_reppit006.htm#CHDBCGBG">"Configuring Materialized View Sites"</a></p> </li> <li> <p><a href="tdpii_reppit007.htm#CHDCDIAG">"Configuring Materialized View Logs at the Master Site"</a> if you want to perform a fast refresh of the materialized views. For this example, create a materialized view log for each of the following tables: <code>hr.departments</code> and <code>hr.employees</code>.</p> </li> </ul> </li> <li> <p>In Enterprise Manager, log in to the materialized view site as the materialized view administrator. The materialized view site is the database in which you want to create materialized views. The default user name for the materialized view administrator is <code>mvadmin</code>.</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">Setup</span> in the Advanced Replication section.</p> </li> <li> <p>On the Advanced Replication: Setup page, expand <span class="bold">Read-only Materialized Views</span>.</p> </li> <li> <p>Select <span class="bold">Create Materialized View</span>.</p> </li> <li> <p>Click <img src="shortcut.png" alt="callback" border="0" /><a href="javascript:void(0);" onclick="redirectEMpage('MATERIALIZED_VIEW_CREATE');"><span class="bold">Continue</span></a> to open the Create Materialized View page.</p> </li> <li> <p>Complete the following actions to create the <code>hr.employees_mvr</code> materialized view:</p> <ol> <li> <p>Enter <code>employees_mvr</code> in the Name field.</p> </li> <li> <p>Enter <code>hr</code> in the Schema field.</p> </li> <li> <p>If you have a specific tablespace for the materialized view you are creating, then enter the tablespace name in the Tablespace field. Otherwise, leave <code><Default></code> in the field.</p> </li> <li> <p>Deselect <span class="bold">Enable the materialized view for query rewrite</span>.</p> </li> <li> <p>Ensure that the following are not selected:</p> <ul> <li> <p><span class="bold">Make the materialized view updatable</span></p> </li> <li> <p><span class="bold">Build From Existing Table</span></p> </li> </ul> </li> <li> <p>Enter the following in the Materialized View Query field:</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT employee_id, first_name, last_name, email, phone_number, hire_date, job_id, salary, commission_pct, manager_id, department_id FROM hr.employees@<span class="italic">master_site</span> </pre> <p>Replace <code><span class="codeinlineitalic">master_site</span></code> with the global name of the master site that contains the master table.</p> </li> <li> <p>Deselect <span class="bold">Analyze the materialized view after it is created</span>.</p> </li> <li> <p>If necessary, then set options for the materialized view on the other subpages.</p> </li> <li> <p>Click <span class="bold">OK</span> to create the materialized view.</p> </li> </ol> <p>The <code>hr.employees_mvr</code> materialized view is a complete copy of the master <code>hr.employees</code> table. To create a materialized view that contains a subset of the data, you can include a <code>WHERE</code> clause in your <code>SELECT</code> statement.</p> </li> <li> <p>On the Advanced Replication: Setup page, expand <span class="bold">Read-only Materialized Views</span>.</p> </li> <li> <p>Select <span class="bold">Create Materialized View</span>.</p> </li> <li> <p>Click <img src="shortcut.png" alt="callback" border="0" /><a href="javascript:void(0);" onclick="redirectEMpage('MATERIALIZED_VIEW_CREATE');"><span class="bold">Continue</span></a> to open the Create Materialized View page.</p> </li> <li> <p>Complete the following actions to create the <code>hr.departments_mvr</code> materialized view:</p> <ol> <li> <p>Enter <code>departments_mvr</code> in the Name field.</p> </li> <li> <p>Enter <code>hr</code> in the Schema field.</p> </li> <li> <p>If you have a specific tablespace for the materialized view you are creating, then enter the tablespace name in the Tablespace field. Otherwise, leave <code><Default></code> in the field.</p> </li> <li> <p>Deselect <span class="bold">Enable the materialized view for query rewrite</span>.</p> </li> <li> <p>Ensure that the following are not selected:</p> <ul> <li> <p><span class="bold">Make the materialized view updatable</span></p> </li> <li> <p><span class="bold">Build From Existing Table</span></p> </li> </ul> </li> <li> <p>Enter the following in the Materialized View Query field:</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT department_id, department_name, manager_id, location_id FROM hr.departments@<span class="italic">master_site</span> </pre> <p>Replace <code><span class="codeinlineitalic">master_site</span></code> with the master site that contains the master table.</p> </li> <li> <p>Deselect <span class="bold">Analyze the materialized view after it is created</span>.</p> </li> <li> <p>If necessary, then set options for the materialized view on the other subpages.</p> </li> <li> <p>Click <span class="bold">OK</span> to create the materialized view.</p> </li> </ol> </li> <li> <p>Create a refresh group and add the materialized views to it so that they are consistent with a single point in time when they are refreshed. In this example, add the <code>hr.employees_mvr</code> and <code>hr.departments_mvr</code> materialized views to the refresh group. See <a href="tdpii_reppit017.htm#CHDJEFDH">"Configuring a Refresh Group"</a>.</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=SQLRF01302','newWindow').focus()"><code>CREATE</code> <code>MATERIALIZED</code> <code>VIEW</code></a> SQL statement to create a materialized view.</p> </div> <div class="helpinfonotealso"> <h2>Related Topics</h2> <p><a href="tdpii_intro2ii005.htm#CFHBIEHG">When to Replicate Data with Materialized Views</a></p> <p><a href="tdpii_reppit009.htm#BEHIFAIG">About Replicating Read-Only Data Using Materialized Views</a></p> <p><a href="tdpii_adpit.htm#BABFHCBC">Administering a Materialized View Replication Environment</a></p> </div> </div> <!-- class="sect2" --> <!-- 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_reppit009.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="tdpii_reppit011.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