Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sequence Generation and Replication
In article <20000517014126.18544.00003223_at_ng-fo1.aol.com>,
sqljames_at_aol.com (Sqljames) wrote:
> I was wondering if there was a way to replication sequences when your
are using
> a multi-master Advanced Replication model.
>
> Thank You In Advance,
>
> James
>
No, its not possible. The problem is that the sequences would end up generating dups *unless you replicate them in real time* which would sort of obviate the advantage of async replication.
The solution is:
o determine the maximum number of sites you'll have in your replicated database (say its 100 for example).
o multiply that by 10 for good luck (so we have 1000 now).
o at site1, create sequence my_seq start with 1 increment by 1000;
at site2, create sequence my_seq start with 2 increment by 1000;
...
at siteN, create sequence my_seq start with N increment by 1000;
Now you have unique sequences that don't need to be replicated, are very fast (and you have the nice side effect that a simple MOD() on the generated number can tell you the site a row was created on)
-- 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 Wed May 17 2000 - 00:00:00 CDT
![]() |
![]() |