Adding the Primary Database to Replication Server

Add the primary Adaptive Server database to Replication Server.

  1. Add the Replication Server instance to the interfaces file of the data server that hosts the primary database.
    Note: Restart the Adaptive Server instance 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: Modify the parameters described in this 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. SAMPLE_RS
    rs.rs_rs_sa_user User ID that has “sa” privileges on Replication Server. sa
    rs.rs_rs_sa_pass Password of the “sa” user. sa_pass
    rs.rs_ds_name Name of the data server that hosts the primary database. sunak1502i
    rs.rs_ds_sa_user User ID that has “sa” privileges on data server. sa
    rs.rs_ds_sa_password Password of the “sa” user for the data server. password
    rs.rs_db_name Name of the primary database. pubs2
    rs.rs_needs_repagent Whether you plan to replicate from the specified primary database. yes
    rs.rs_db_maint_user ID for the user whose work is not replicated when logged in to the primary database (the maintenance user.) <database>_maint

    If the user ID does not exist, the script creates the user ID on the database. The user ID cannot be the name of an alias

    rs.rs_db_maint_password Password for the maintenance user. <database>_maint_ps
    rs.rs_ltm_rs_user User that the Replication Agent uses to log in to the Replication Server. The name must exist, and typically comes from values that were set up during Replication Server creation. SAMPLE_RS_ra
    rs.rs_ltm_rs_pass Password of the rs.rs_ltm_rs_user. sa_pass
    rs.rs_db_physical_for_logical 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.

  8. Validate the primary connection:
    isql -Usa -Psa_pass -SSAMPLE_RS
  9. Enter:
    admin who
    go
    The output from the command looks similar to:
    Spid  Name  State       Info
    ----  ----- ------      --------
    32 DSI EXEC Awaiting Command 101(1) SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
    
    18 DSI       Awaiting Message 101 SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
    23 DIST      Awaiting Wakeup  101 SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
    
    29 SQT       Awaiting Wakeup  101:1 DIST SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
    
    11 SQM    Awaiting Message 101:1 SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
    9   SQM   Awaiting Message 101:0 SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
    36  REP AGENT Awaiting Command SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
    156 DSI EXEC  Awaiting Command 270(1) sunak1502i.pubs2
    140 DSI       Awaiting Message 270 sunak1502i.pubs2
    136 DIST      Awaiting Wakeup  270 sunak1502i.pubs2
    134 SQT       Awaiting Wakeup  270:1  DIST sunak1502i.pubs2
    142 SQM       Awaiting Message 270:1 sunak1502i.pubs2
    155 SQM       Awaiting Message 270:0 sunak1502i.pubs2
    135 REP AGENT Awaiting Command sunak1502i.pubs2
    162 DSI EXEC  Awaiting Command 268(1) rds.rdb
    157 DSI       Awaiting Message 268 rds.rdb
    133 SQM       Awaiting Message 268:0 rds.rdb
    21  dSUB      Sleeping
    6   dCM       Awaiting Message
    7   dAIO      Awaiting Message
    26  dREC      Sleeping         dREC
    8   dDELSEG   Awaiting Message
    163 USER      Active           sa
    5   dALARM    Awaiting Wakeup
    27  dSYSAM    Sleeping
  10. Exit the isql session.