Adding the Active Database to the Replication Server

Add the active database.

  1. Add the Replication Server to the interfaces file of the data server that hosts the primary or active database.
    Note: Restart the Adaptive Server if the interfaces file has changed.
  2. Go to $SYBASE/REP-15_5/init/rs.
  3. Make a copy of the setupdb.rs file and rename it as myactive.rs.
  4. Edit the myactive.rs file.
    Sample values for the myactive.rs file
    Parameter Description Value
    sybinit.release_directory Specifies the valid path of the Replication Server software ($SYBASE). /opt/software
    rs.rs_name Specifies the name of the Replication Server PRS
    rs.rs_rs_sa_user Specifies the user ID that has “sa” privileges on Replication Server. sa
    rs.rs_rs_sa_pass Specifies the password of the “sa” user. password
    Note: Leave blank if you have a null password.
    rs.rs_ds_name The name of the data server that hosts the primary database. sunak1505i
    rs.rs_ds_sa_user Specifies the user ID that has “sa” privileges on data server. sa
    rs.rs_ds_sa_password Specifies the password of the “sa” user for the data server. password
    Note: Leave blank if you have a null password.
    rs.rs_db_name Specifies the name of the primary database pubs2
    rs.rs_needs_repagent Specifies whether you plan to replicate from specified primary database. yes
    rs.rs_db_maint_user Specifies the user ID that performs insert, update, delete, and truncate table commands to the replicate database. The user ID must have permissions to perform DML commands at the replicate database. The user is called maintenance user.
    Note: Do not use a user ID that has been aliased to another user ID.
    USE_DEFAULT

    The default value is databasename_maint.

    rs.rs_db_maint_password Specifies the password for the maintenance user. USE_DEFAULT

    The default value is databasename_maint_ps.

    rs.rs_db_physical_for_logical Specifies whether this is a warm standby database. yes
    rs.rs_db_active_or_standby Specifies whether the configuration is for active or standby database. active
    rs.rs_db_logical_ds_name Specifies the data server portion of the logical connection name. pubs2a
    rs.rs_db_logical_db_name Specifies the database portion of the logical connection name. pubs2s
    rs.rs_db_active_ds_name Specifies the server that hosts the active database. sunak1505i
    rs.rs_db_active_db_name Specifies the name of the active database. pubs2
    rs.rs_db_active_sa Specifies the user ID that has “sa” privileges on the active database. sa
    rs.rs_db_active_sa_pw Specifies the password of the “sa” user. password
    Note: Leave blank if you have a null password.
  5. Save the file.
  6. Go to $SYBASE/REP-15_5/install.
  7. Create the connection from the active database to the Replication Server by running the resource file:
    ./rs_init -r ../init/rs/myactive.rs

    If the rs_init command fails, correct the issue, then disable the RepAgent as follows:

    1. Log in to the primary Adaptive Server using an “sa” user role and access the primary database
    2. Disable the RepAgent thread in the primary database:sp_config_rep_agent pubs2,'disable' go

    Re-run rs_init command

  8. Validate the primary connection:
    isql -Usa -P -SPRS
  9. Enter:
    admin who
    go
    The output generated from admin who is similar to
    Spid   Name    State        Info
    ------ ------- ------------ -----------------
    36 DIST Awaiting Wakeup 102 pubs2a.pubs2s
    37 SQT Awaiting Wakeup 102:1 DIST
    pubs2a.pubs2s
    31 SQM Awaiting Message 102:1 pubs2a.pubs2s
    30 SQM Awaiting Message 102:0 pubs2a.pubs2s
    27 DSI EXEC Awaiting Command 101(1)
    sunak1505i.PRS_RSSD
    20 DSI Awaiting Message 101
    sunak1505i.PRS_RSSD
    26 SQM Awaiting Message 101:0
    sunak1505i.PRS_RSSD
    49 DSI EXEC Awaiting Command 103(1)
    sunak1505i.pubs2
    35 DSI Awaiting Message 103 sunak1505i.pubs2
    38 REP AGENT Awaiting Command sunak1505i.pubs2
    39 NRM AwaitingMessage sunak1505i.pubs2
    21 dSUB Sleeping
    15 dCM Awaiting Message
    18 dAIO Awaiting Message
    23 dREC Sleeping dREC
    29 USER Active sa
    14 dALARM Awaiting Wakeup
    24 dSYSAM Sleeping
    Note: The RepAgent for the active database must be available.
  10. Validate the status of the active database connection:
    admin logical_status
    go

    The output generated from admin logical_status is similar to:

    Logical Connection Name Active Connection Name Active Conn State Standby Connection Name Standby Conn State
    [102] pubs2a.pubs2s [103] sunak1505i.pubs2 Active/ None None
    Controller RS Operation in Progress State of Operation in Progress Spid
    [16777317] PRS None None