Configuring Replication Server for replication from the primary database

This section describes the configuration steps required for replication from the primary database. It includes:

StepsCreating a Replication Server connection to the primary database

  1. Go to the $SYBASE/MA-15_2/scripts/oracle directory.

  2. Make a copy of the oracle_create_rs_primary_connection.sql script:

    cp oracle_create_rs_primary_connection.sql
    my_oracle_create_rs_primary_connection.sql
    
  3. Before executing the my_oracle_create_rs_primary_connection.sql script against your Replication Server, change all occurrences of value {pds}.{pdb} to the name of the Replication Server connection used for the connection from Mirror Replication Agent for Oracle, where:

    • pds is rs_source_ds (located in $SYBASE/MA-15_2/init/oracle.rs).

    • pdb is rs_source_db (located in $SYBASE/MA-15_2/init/oracle.rs).

    For example, NY.NYora92.

    NoteSave the defined values to be used for the Mirror Replication Agent oracle.rs file later in the process.

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

    • sys is the user ID of the Oracle user (sys).

    • sys_pwd is the password of the Oracle user (change_on_install).

    NoteThis user must be a valid user in the Oracle database.

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

    create connection to NY.NYora92
    
    set error class rs_sqlserver_error_class
    
    set function string class rs_oracle_function_class
    
    set username sys
    
    set password change_on_install
    
    with log transfer on, dsi_suspended
    
    go
    
  5. Execute the script in Replication Server:

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

    A message appears that indicates the Replication Server connection to the primary database has been created.

StepsCreating the database replication definition

  1. Navigate to the $SYBASE/MA-15_2/scripts/sybase directory.

  2. Make a copy of the rs_create_db_repdef.sql script:

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

    • pds is rs_source_ds (located in $SYBASE/MA-15_2/init/oracle.rs).

    • pdb is rs_source_db (located in $SYBASE/MA-15_2/init/oracle.rs).

    For example, NY.NYora92.

    This is a database replication definition example:

    create database replication definition NY_repdef1
    
    with primary at NY.NYora92
    
    replicate DDL
    
    go
    
  4. Execute the script in Replication Server:

    isql -Usa -P –SSAMPLE_RS -imy_rs_create_db_repdef.sql
    

    A message appears that indicates the database replication definition has been created.

StepsCreating the database replication subscription

  1. Make a copy of the rs_create_db_sub.sql script:

    cp rs_create_db_sub.sql
    my_rs_create_db_sub.sql
    
  2. Before executing the my_rs_create_db_sub.sql script, change the “{pds}.{pdb}” and “{rds}.{rdb}” to the appropriate connection name, where:

    • pds is rs_source_ds (located in $SYBASE/MA-15_2/init/oracle.rs).

    • pdb is rs_source_db (located in $SYBASE/MA-15_2/init/oracle.rs).

    • rds is the DirectConnect server name.

    • rdb is any valid identifier. Sybase recommends that you use the Oracle SID name.

    Here is an example of create database replication subscription:

    create subscription NY_sub1
    
    for database replication definition NY_repdef1
    
    with primary at NY.NYora92
    
    with replicate at DCOServer.oratest2
    
    without materialization
    
    go
    
  3. Execute the script in Replication Server:

    isql -Usa -P –SSAMPLE_RS -imy_rs_create_db_sub.sql
    

    A message appears that indicates the subscription is being created.

  4. Use isql to log in to the Replication Server:

    isql -Usa -P -SSAMPLE_RS
    
  5. Replication Server comes with users who have the permissions necessary for Mirror Replication Agents. However, because Mirror Activator has the capability to create replication definitions, you must grant CREATE OBJECT permission to the Mirror Replication Agent user:

    grant create object to SAMPLE_RS_ra
    
    go
    

    Permission is granted to user SAMPLE_RS_ra.

    NoteThis user will be entered in the rs_username parameter when building the Mirror Replication Agent for Oracle instance. If you want a user other than the default Mirror Replication Agent user, make sure that the user is granted CONNECT SOURCE and CREATE OBJECT permission.