Edit D:\app\Administrator\product\11.2.0\dbhome_1\oc4j\j2ee\oc4j_applications\applications\em\em\online_help\advrp\configure011.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>Create a Timestamp Trigger: Step 2</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1" /> <meta name="date" content="2009-04-23T10:13:6Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Create a Timestamp Trigger: Step 2" /> <meta name="relnum" content="11g Release 1 (11.1)" /> <meta name="partnum" content="A12345-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="configure010.htm" title="Previous" type="text/html" /> <link rel="next" href="configure012.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> <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="configure010.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="configure012.htm"><img src="./dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="CFHJDABB" name="CFHJDABB"></a><a id="ADVRP298" name="ADVRP298"></a></p> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h1>Create a Timestamp Trigger: Step 2</h1> <p>After the timestamp column has been created, create a trigger that records the timestamp when a row is either inserted or updated. This recorded value is used in the resolution of conflicts based on the timestamp method.</p> <p>The Execute DDL feature enables you to create a database object from within the replication interface. After you have created the object, add the object to your master group, to ensure that the object is created at all master sites.</p> <p>Complete the following steps to create a timestamp trigger:</p> <ol> <li> <p>Complete the steps in <a href="configure008.htm#CACIECGJ">Before Configuring Conflict Resolution</a>.</p> </li> <li> <p>Complete the steps in <a href="configure009.htm#CACCFCFH">Configuring Timestamp Resolution</a>.</p> </li> <li> <p>Return to the Master Groups page.</p> </li> <li> <p>Select the target master group that contains the object for which you want to add the timestamp trigger.</p> </li> <li> <p>Click the number in the Administrative Request column.</p> <p>The Administrative Requests page appears.</p> </li> <li> <p>Click <span class="bold">Advanced</span> to display, if required, the Enter DDL Text field.</p> </li> <li> <p>Enter the DDL text in the Enter DDL Text field to create the timestamp trigger.</p> <p>For example, suppose you had the following conditions for the trigger:</p> <ul> <li> <p>You want to call the trigger <code>ORD_TRIG</code>.</p> </li> <li> <p>The trigger is in the <code>OE</code> schema on the <code>ORDERS</code> table.</p> </li> <li> <p>The timestamp column name is <code>TIME_STAMP</code>.</p> </li> </ul> <p>Given these conditions, enter the following to create the trigger:</p> <pre xml:space="preserve" class="oac_no_warn"> CREATE TRIGGER oe.ord_trig BEFORE INSERT OR UPDATE ON oe.orders FOR EACH ROW BEGIN IF DBMS_REPUTIL.FROM_REMOTE = FALSE THEN :NEW.TIME_STAMP := SYSDATE; END IF; END; </pre> <div class="helpinfonote"> <p><span class="bold">Note: </span>In case of timestamp replication for materialized views, you must ensure that the trigger calls <code>DBMS_MVIEW.I_AM_A_REFRESH</code> so that the trigger does not fire as a result of a refresh operation.</p> </div> </li> <li> <p>From the Execute At list, select the master sites where you want to create the object.</p> <p>Because you are replicating this trigger, you can simply select the master definition site. When you add this trigger to your master group, it is created automatically at all master sites participating in the master group.</p> </li> <li> <p>Click <span class="bold">Execute</span>.</p> </li> <li> <p>Return to Master Groups page.</p> </li> <li> <p>Click <span class="bold">Edit</span>.</p> <p>The Edit Master Group page appears.</p> </li> <li> <p>Click <span class="bold">Objects</span>.</p> <p>The Objects subpage of the Edit Master Group page appears.</p> </li> <li> <p>Click <span class="bold">Add</span>.</p> <p>The Add Objects page appears.</p> </li> <li> <p>Select <span class="bold">Trigger</span> from the Object Types list and select the schema in which you created your trigger from the Schema list.</p> </li> <li> <p>Click <span class="bold">OK</span>.</p> <p>The Objects subpage of the Edit Master Group page reappears.</p> </li> <li> <p>Locate and select the trigger that you just created from the <span class="bold">Name</span> list.</p> </li> <li> <p>Select <span class="bold">Use Existing Object</span> for the new trigger if the trigger exists at the other master sites. In this case, the existing trigger is used at the other master sites.</p> <p>If a trigger of the same name exists but is not exactly the same and the Use Existing Object box is enabled, you receive an error when adding the trigger to your master group.</p> <p>If the trigger does not exist at the other master sites, the trigger is created at the other sites regardless of this box setting.</p> </li> <li> <p>Select <span class="bold">Copy Row Data</span> for the new trigger.</p> </li> <li> <p>Click <span class="bold">Apply</span>.</p> </li> </ol> <div class="helpinfonotealso"> <h2>Related Topics</h2> <p><a href="configure001.htm#CACJABIJ">About Conflict Resolution Methods</a></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 © 2005, 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="configure010.htm"><img src="./dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="configure012.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