Marking a Sequence for Replication

Mark an Oracle sequence for replication.

  1. Log in to the Replication Agent instance with the administrator login.
  2. Determine if replication is enabled for the sequence:
    pdb_setrepseq pdb_seq

    where pdb_seq is the name of the sequence that 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.
    • To mark the sequence for replication when the sequence name you want to increment at the replicate site has a different name, use:
      pdb_setrepseq pdb_seq, mark
      Note: Replicating a sequence with a different name than the provided name 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 in the replicate database

      Note: Replicating sequence values to a sequence with a different name at the replicate database assumes that the replicate database 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 default) – The sequence marked for replication with pdb_setrepseq is ready for replication after you invoke pdb_setrepseq successfully. You can skip step 4 in this procedure.

      • 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.