Marking a Sequence for Replication

Mark a sequence for replication.

  1. Log in to the Replication Agent instance with the administrator login.
  2. Determine whether or not the sequence is marked in the primary database:
    pdb_setrepseq pdb_seq

    where pdb_seq is the name of the sequence you want to mark for replication.

    • If pdb_setrepseq returns information that the specified sequence is marked, you do not need to continue this procedure.

    • If pdb_setrepseq returns information that the specified sequence is not marked, continue this procedure to mark the sequence for replication.

  3. Mark the sequence for replication.
    pdb_setrepseq allows you to mark the primary sequence to be replicated and specify a different sequence name to use in the replicate database.
    • If the sequence name you want to increment at the replicate site has the same name as at the primary site, use this command to mark the sequence for replication:
      pdb_setrepseq pdb_seq, mark
      Note: Replicating a sequence with a different name than is provided is consistent with other marking commands but is not a typical configuration.
    • To mark the sequence for replication using a different sequence name, use:
      pdb_setrepseq pdb_seq, rep_seq, mark

      where rep_seq is the name of the sequence that you want to increment in the replicate database.

      Note: Replicating sequence values to a sequence with a different name at the replicate site assumes that the replicate site sequence has the same attributes and starting value as the primary site's sequence.
      • If the value of pdb_dflt_object_repl is true, the sequence marked for replication with pdb_setrepseq is ready for replication after you successfully invoke pdb_setrepseq.

      • If the value of pdb_dflt_object_repl is true (the default value), skip step 4.

      • If the value of pdb_dflt_object_repl is false, you must enable replication for the sequence before replication can take place.

  4. Enable replication for the sequence:
    pdb_setrepseq pdb_seq, enable

After replication is enabled for the sequence, you can begin replicating invocations of that sequence in the primary database.

Note: To replicate a sequence, you must also run the oracle_create_replicate_sequence_proc.sql script in the $SYBASE/RAX-15_5/scripts/oracle directory at the replicate site to create a procedure named rs_update_sequence.