Re: Replication and sequences

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1999/11/24
Message-ID: <f5on3ssdd60vc8mhkbhj3fkmg5c5d0cevm_at_4ax.com>#1/1


A copy of this was sent to "Michael Chan" <MikeChan_at_pacbell.net> (if that email address didn't require changing) On Wed, 24 Nov 1999 00:57:18 -0800, you wrote:

>Does anyone know how to keep sequences in synch between a replicator and a
>replicatee?
>
>I would like to set up two servers: one that receives modifications and
>another that is read only. The server that receives data modifications from
>clients will replicate data over to the second server. The second server
>functions as a read only database allowing clients to search for data for
>load balancing and as a hot stand by for the first server in case of
>failure.
>
>The problem is that the first server will be generating unique identifiers
>using sequences. That data gets pushed to the second database fine. There
>will be sequences in the second server as well. How does Oracle handle
>keeping sequences for both publisher and subscriber?
>
>I'd like to be able to have the second database server allow data
>modifications and generate identifiers should the first (publisher) server
>fail. Clients will be able to connect to the second database upon detecting
>that the first server failed. The second server would allow updates at that
>point and serve as the primary update server and clients will need to
>connect to that second server in case of failure on the first server.
>
>Is this possible? If so, how is this done? Thanks!
>

1 - determine maximum number of servers you will have in your environment. say 100.

2 - multiply that number by 10. You have 1,000

3 - at 'site 1' you will "create sequence your_seq start with 1 increment by 1000".

    at 'site 2' you will "create sequence your_seq start with 2 increment by 1000"

    at 'site N' you will "create sequence your_seq start with N increment by 1000"

that will ensure each site generates it's own set of unique sequence numbers. Sequences cannot be replicated per-say (you would have a single point of failure otherwise -- the master sequence generator)

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Wed Nov 24 1999 - 00:00:00 CET

Original text of this message