Multi Site Availiability setup

From SybaseWiki
Revision as of 21:32, 21 March 2007 by Psap (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Most warm standby applications are used in a High Availability environment: when one server is down, the data should be available on a second server. When Multi Site Availability is used, replication can be performed to a third server. This server can then be used for e.g. a separate reporting environment. Below you will find the commands to create such an environment. Warning: it cannot be used when there is activity on the logical connection.

Create a maintenance user on the ASE

When you want to materialize the database with dump and load you have to make sure that the suid of the new login matches the suid of the maintenance user on the other servers.

sp_addlogin "<maintenance_user>","<maintenance_user_password>"
go
grant role replication_role to "<maintenance_user>"
go
-- check the value of the suid
select suser_id("<maintenance_user>")
go
use <database>
go
sp_addalias "<maintenance_user>","dbo"
go

Create a database replication definition

create database replication definition <rep_def>
with primary at <active_server>.<database>

Prepare the database

Load the script rs_install_replicate located in the $SYBASE/$SYBASE_REP/scripts directory into the database.

Create a connection to the database

create connection to <server>.<database>
set error class to rs_sqlserver_error_class
set function string class to rs_sqlserver_function_class
set username to <maintenance_user>
set password to <maintenance_user_password>

Subscribe to the replication definition

When you create the subscription, the new database should be in sync (materialized) with the database on the logical connection.

create subscription <subscription_name>
for database replication definition <rep_def>
with primary at <active_server>.<database>
with replicate at <server>.<database>
without materialization

That's all.