Replication Server requires a few database objects (procedures and tables) in the primary and standby databases, so that it can:
Place markers in the database transaction log
Manage the secondary truncation point in the database
Keep track of successfully replicated transactions
You need not set up Replication Server objects in the standby database, because when you materialize the standby database, Replication Server objects in the primary database are copied to the standby database.
To set up Replication Server objects in the primary database, use the Replication Server primary database installation script. The primary database installation script is a SQL script named:
rsinspri.sql on Microsoft Windows platforms
rs_install_primary.sql on UNIX platforms
The primary database installation script resides in the Replication Server scripts directory (for example, %SYBASE%\REP-12_6\scripts on Microsoft Windows platforms).
You must have a System Administrator user role in the
primary Adaptive Server to perform this procedure.
To set up Replication server objects in the primary
database
Open an operating system command prompt window on the primary data server host machine.
At the operating system command prompt, invoke the isql utility to execute the primary database installation script in the primary database.
On Microsoft Windows platforms, enter:
isql –Usa –Ppwd –Spds –Dpdb –i rsinspri.sql
where:
sa is the System Administrator user login on the primary data server.
pwd is the password for the System Administrator user login.
pds is the name of the primary data server.
pdb is the name of the primary database.
On UNIX platforms, enter:
isql –Usa –Ppwd –Spds –Dpdb –i rs_install_primary.sql
where:
sa is the System Administrator user login on the primary data server.
pwd is the password for the System Administrator user login.
pds is the name of the primary data server.
pdb is the name of the primary database.
Log in to the primary Adaptive Server with a System Administrator user role.
Grant permissions on the Replication Server objects in the primary database:
use pdb grant all on rs_lastcommit to mra_maint grant execute on rs_get_lastcommit to mra_maint grant execute on rs_update_lastcommit to public grant execute on rs_check_repl_stat to public grant execute on rs_marker to public
where:
pdb is the name of the primary database.
mra_maint is the name of the Maintenance User in the primary database.
Disable replication for the rs_lastcommit table in the primary database:
use pdb sp_setreplicate rs_lastcommit, false
where pdb is the name of the primary database.
Mark the rs_update_lastcommit procedure for replication:
use pdb sp_setrepproc rs_update_lastcommit, "function"
where pdb is the name of the primary database.
Set the primary data server to ignore the secondary truncation point in the primary database log:
use pdb dbcc settrunc("ltm", "ignore")
where pdb is the name of the primary database.