To complete the primary Adaptive Server configuration for ASE Replicator, you must create the Distribution Database. ASE Replicator uses the Distribution Database to maintain its stable queue and metadata objects.
To create the Distribution Database
Log in to the primary Adaptive Server with a System Administrator user role.
Create database devices for the Distribution Database and its log, using the disk init command to initialize database devices. For example:
use master disk init name = "DDB_dev", physname = "/devices/ddb_dev.dat", size = "100M" dsync = true
where DDB_dev is the database device name of the Distribution Database device, and ddb_dev.dat is the name of the operating system file mapped to the database device name.
Sybase recommends that you create separate database devices for the Distribution Database and its log.
See the System Administration Guide for more information on creating database devices and using the disk init command.
Create the Distribution Database, using the create database command. For example:
create database DDB_name on DDB_dev = "100M" log on DDBlog_dev = "100M"
where DDB_name is the name of the Distribution Database, DDB_dev is the database device name of the Distribution Database device, and DDBlog_dev is the database device name of the Distribution Database log device.
After you create the Distribution Database, dump the master database to facilitate recovery if the master database is damaged.
Add the ASE Replicator system user to the Distribution Database:
use DDB_name
sp_adduser rep_login, rep_user
where DDB_name is the name of the Distribution Database, rep_login is the user login ID of the ASE Replicator system user, and rep_user is the user name of the ASE Replicator system user in the Distribution Database.
Grant create table and create procedure permissions to the ASE Replicator system user in the Distribution Database:
grant create table, create procedure to rep_user
where rep_user is the user name of the ASE Replicator system user.
Set the following database options for the Distribution Database:
Turn off the ddl in tran option:
use master sp_dboption DDB_name, "ddl in tran", false
where DDB_name is the name of the Distribution Database.
Turn on the select into/bulkcopy/pllsort option:
sp_dboption DDB_name, "select into/bulkcopy/pllsort", true
where DDB_name is the name of the Distribution Database.
Run the checkpoint command in the Distribution Database.