Step 3. Configure Rep Server for replication from the primary database

This section describes the following configuration steps required for replication from the primary database:

StepsTo create a Rep Server connection to the primary database

  1. Verify you are at the $SYBASE/MRO-12_6/scripts directory.

  2. Before executing the oracle_create_rs_primary_connection.sql script against your Rep Server, change all occurrences of value {pds}.{pdb} to the name of the Rep Server connection used to connect to Oracle where:

    For example, NY.NYora92.

  3. Change sys and sys_pwd to the user ID and password of the Oracle user who will have permission to apply DML operations against all user tables that will be replicated where:

    NoteWhile not immediately used, this user must be a valid user in the Oracle database.

    The following command creates a Rep Server connection to the primary database example:

    create connection to NY.NYora92set error class rs_sqlserver_error_classset function string class rs_oracle_function_classset username sysset password change_on_installwith log transfer on, dsi_suspendedgo
    
  4. Execute the script in Rep Server:

    isql –Usa –P –SSAMPLE_RS -i oracle_create_rs_primary_connection.sql
    

    A message is displayed that indicates the Rep Server connection to the primary database is created.

StepsTo create the database replication definition

  1. Before executing the oracle_create_rs_db_repdef.sql script, change the value of “{pds}.{pdb}” to the name of the connection string you defined for the primary database, where:

    For example,

    NY.NYora92
    

    The following is a database replication definition example:

    create database replication definition NY_repdef1
    with primary at NY.NYora92
    replicate DDL
    go
    
  2. Connect to the Rep Server and execute the following command:

    isql -Usa -P –SSAMPLE_RS -i oracle_create_rs_db_repdef.sql
    

    A message is displayed that indicates the database replication definition is created.

StepsTo create the database replication subscription

  1. Before executing the oracle_create_rs_db_sub.sql script, change the “{pds}.{pdb}” and “{rds}.{rdb}'”to the appropriate connection name, where:

    The following is a create database replication subscription example:

    create subscription NY_sub1
    for database replication definition NY_repdef1
    with primary at NY.NYora92
    with replicate at DCOServer.oratest2
    without materialization
    go
    
  2. Connect to Rep Server and execute the following command:

    isql -Usa -P –SSAMPLE_RS -i oracle_create_rs_db_sub.sql
    

    A message is displayed that indicates the subscription is in the process of being created.

StepsTo set up sequence replication support

  1. Install the rs_update_sequence stored procedure. Use SQLPLUS to run the oracle_create_replicate_sequence_proc.sql stored procedure at the standby site:

    sqlplus maintuser/password@oracle_create_replicate_sequence_proc.sql 
    

    The following is returned:

    SQL*Plus: Release 9.2.0.1.0 - Production on Tue Jun 20 10:32:03 2006Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production With the Partitioning, OLAP and Oracle Data Mining optionsJServer Release 9.2.0.1.0 - Production Procedure created.Grant succeeded.
    

    Exit sqlplus.

    For more information about sequence replication, see the Mirror Activator for Oracle Administration Guide, Appendix C, “Mirror Replication Agent and Oracle Databases.”

  2. To create a function replication definition for rs_update _sequence, edit the oracle_create_rs_sequence_repdef.sql script, changing all occurrences of the value {pds}.{pdb} to the name of the MRO connection used by your MRO, where:

    The following is the function replication definition for sequence replication after editing:

    create function replication definition REP_UPDATE_SEQUENCE
    with primary at NY.NYora92
    deliver as RS_UPDATE_SEQUENCE
    (
    @"SEQUENCENAME"  varchar(32768),
    @"SEQUENCEVALUE" numeric,
    @"INCREMENT"     numeric
    )
    send standby all parameters
    go
    
  3. Connect to the Rep Server and execute the following command:

    isql -Usa -P –SSAMPLE_RS -i oracle_create_rs_sequence_repdef.sql
    

    A message is displayed that indicates a functional sequence replication definition is created.