Adding the Primary Database to the Replication Server

Add a primary database to the Replication Server for MSA.

  1. Add the Replication Server to the interfaces file of the data server that hosts the primary database.
    Note: Restart the Adaptive Server if the interfaces file has changed.
  2. Go to $SYBASE/$SYBASE_REP/init/rs.
  3. Make a copy of the setupdb.rs file and rename it as myprimary.rs.
  4. Edit the myprimary.rs file.
    Note: You need to modify the parameters described in the "Sample values for myprimary.rs file" table.
    Sample values for the myprimary.rs file
    Parameter Description Value
    sybinit.release_directory Valid path of the Replication Server software ($SYBASE). /opt/software
    rs.rs_name 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 Name of the data server that hosts the primary database. sunak1502i
    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 whose work is not replicated when logged on the primary database. The user is called maintenance user. USE_DEFAULT

    The default value is databasename_maint.

    Note: If the user ID does not exist the script creates the user ID on the replicate database. Do not use a user ID that has been aliased to another user ID.
    rs.rs_db_maint_password Specifies the password for the maintenance user. USE_DEFAULT

    The default value is databasename_maint.

    rs.rs_db_physical_for_logical Specifies whether this is a warm standby database. no
  5. Save the file.
  6. Go to $SYBASE/$SYBASE_REP/install.
  7. Create the connection from the primary database to the Replication Server by running the resource file:
    ./rs_init -r ../init/rs/myprimary.rs
    If the rs_init command fails, check the log file in $SYBASE/$SYBASE_REP/init/logs, 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 from the command looks similar to:
    Spid   Name    State        Info
    ------ ------- ------------ -----------
    48 DSI EXEC Awaiting Command 102(1)
    sunak1502i.pubs2
    33 DSI Awaiting Message 102 sunak1502i.pubs2
    35 DIST Awaiting Wakeup 102 sunak1502i.pubs2
    36 SQT Awaiting Wakeup 102:1 DIST
    sunak1502i.pubs2
    34 SQM Awaiting Message 102:1
    sunak1502i.pubs2
    32 SQM Awaiting Message 102:0
    sunak1502i.pubs2
    37 REP AGENT Awaiting Command sunak1502i.pubs2
    39 NRM Awaiting Message sunak1502i.pubs2
    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
    21 dSUB Sleeping
    15 dCM Awaiting Message
    18 dAIO Awaiting Message
    23 dREC Sleeping dREC
    49 USER Active sa
    14 dALARM Awaiting Wakeup
    24 dSYSAM Sleeping
  10. Exit the isql session.