Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle Replication using Triggers

Re: Oracle Replication using Triggers

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 2000/04/22
Message-ID: <8dqqtn$gi4$1@nnrp1.deja.com>#1/1

In article <8dqh7j$6cq$1_at_nnrp1.deja.com>,   malamut77_at_hotmail.com wrote:
> I am trying to figure out a replication problem using Oracle triggers.
> We are using Oracle 7.3.
> The trigger is an AFTER DELETE trigger that INSERTS data into one
 table
> locally,i.e. on the same server, at a row level. Which means we are
> using the "for each row" option. My question is, if you are going to
> replicate would it be better to do a BEFORE DELETE. This, to me, means
> that you are replicating data BEFORE you commit to a delete. Is seems
> risky to commit to a DELETE after you want to replicate data to
 another
> table. I'm not very experience with triggers, so I am hoping someone
> with more experience can answer my question or confirm my theory.
 Thanks
> for any help.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

the triggers are all atomic. the are all transactional. the before triggers do not happen any more "before" the commit then the after triggers.

a BEFORE trigger fires before the delete does anything, right after the client issues the delete and loses control -- this trigger will fire.

a BEFORE for each row trigger fires right before we delete the row from the table.

the AFTER for each row trigger fires right after we delete the row from the table

the AFTER trigger fires right after the delete statement executes, before the client gets control back.

You want to use the AFTER for each row trigger.

You could think about using the built in replication that does it all for you as well.

--
Thomas Kyte                              tkyte_at_us.oracle.com
Oracle Service Industries
http://osi.oracle.com/~tkyte/index.html
--
Opinions are mine and do not necessarily reflect those of Oracle Corp


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Sat Apr 22 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US