This section describes these configuration steps required for replication from the primary database:
Configure Replication Server for replication from the primary database.
Grant create object permission to the Mirror Replication Agent user.
Create the database replication definition.
Create the database replication subscription.
Configuring Replication Server for replication
from the primary database
If needed, add the primary ASE server to the interfaces file of the Replication Server and reboot the Replication Server.
Change to $SYBASE/MA-15_2/scripts/ase.
Make a copy of ase_create_rs_primary_connection.rs:
cp ase_create_rs_primary_connection.rs myma_ase_create_rs_primary_connection.rs
Change these values in the newly created script and save the script:
$SYBASE – enter the path name of the $SYBASE where the Replication Server resides, for example, /software/sybase. ($SYBASE occurs three times in the script).
$SYBASE_REP – enter REP-15_2.
pds – name of the ASE data server where the primary database resides.
pdb – name of the primary database.
If you are not using the SAMPLE_RS, change the SAMPLE_RS to the proper Replication Server name.
The value entered for rs.rs_ds_name and rs.rs_name must exist in the interfaces file used by the Replication Server, and the names are case-sensitive.
In Replication Server, create the connection from the Replication Server to the primary database:
$SYBASE/$SYBASE_REP/install/rs_init -r myma_ase_create_rs_primary_connection.rs
The connection to the primary database is created.
Verify that the connections to the primary and standby servers have been made:
isql -Usa -P -SSAMPLE_RS
admin who
go
Spid Name State Info
---- ---------- ----------------- -------------------------------------
23 DSI EXEC Awaiting Command 101(1)SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
19 DSI Awaiting Message 101 SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
18 SQM Awaiting Message 101:0 SAMPLE_RS_ERSSD.SAMPLE_RS_ERSSD
28 DSI EXEC Awaiting Command 102(1) repit152i2.foo2
27 DSI Awaiting Message 102 repit152i2.foo2
26 SQM Awaiting Message 102:0 repit152i2.foo2
38 DSI EXEC Awaiting Command 103(1) repit152i.foo
33 DSI Awaiting Message 103 repit152i.foo
35 DIST Awaiting Wakeup 103 repit152i.foo
36 SQT Awaiting Wakeup 103:1 DIST repit152i.foo
34 SQM Awaiting Wakeup 103:1 repit152i.foo
32 SQL Awaiting Message 103:0 repit152i.foo
37 REP AGENT Awaiting Command repit152i.foo
20 dSUB Sleeping
15 dCM Awaiting Message
17 dAIO Awaiting Message
21 dREC Sleeping dREC
39 USER Active sa
14 dALARM Awaiting Wakeup
22 dSYSAM Sleeping
In this example, repit152i.foo is the primary database, it has a Mirror Replication Agent thread, and repit152i2.foo2 is the standby database. All threads for the primary and standby databases should have the Awaiting Message or Awaiting Command state.
Granting create object permission
to the Mirror Replication Agent user
Allow the default Mirror Replication Agent user to create replication definitions:
grant create object to SAMPLE_RS_ra
go
Permission is granted to user “SAMPLE_RS_ra.”
Create object permissions must be
granted to the value (located in $SYBASE/MA-15_2/init/ase.rs)
that you use for the rs_username configuration
parameter.
Exit isql.
Creating the database replication definition
Go to the $SYBASE/MA-15_2/scripts/sybase directory:
cd $SYBASE/MA-15_2/scripts/sybase
Make a copy of the create_rs_db_repdef.sql directory:
cp create_rs_db_repdef.sql
myma_create_rs_db_repdef.sql
Before executing the myma_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:
pds is the name of the data server where the primary database resides.
pdb is the name of the primary database.
For example:
repit152i.foo
Here is a database replication definition example:
create database replication definition repit152i_repdef1
with primary at repit152i.foo
replicate DDL
go
Execute the script in Replication Server:
isql -Usa -P –SSAMPLE_RS -imyma_create_rs_db_repdef.sql
A message appears, indicating that the database replication definition has been created.
Creating the database replication subscription
Make a copy of create_rs_db_sub.sql:
cp create_rs_db_sub.sql myma_create_rs_db_sub.sql
Change these values in the copied script and save the changes: {pds} – name of the data server where the primary database resides {pdb} – name of the primary database {rds} – name of the data server where the standby database resides {rdb} – name of the standby database
Here is a create database replication subscription example:
create subscription repit152i_sub1
for database replication definition
repit152i_repdef1
with primary at repit152i.foo
with replicate at repit152i2.foo2
without materialization
Execute the script in Replication Server:
isql -Usa -P -SSAMPLE_RS -imymra_create_rs_db_sub.sql
A message appears, indicating that the subscription is being created.