To initialize the primary data server, Replication Agent for Microsoft SQL Server installs objects at the data-server level and at the database level. Data-server level modifications are required only once. Use this procedure if you are initializing the primary data server and a Replication Agent instance for the first time.
If you have previously initialized the primary data server and a Replication Agent instance and want to initialize another Replication Agent instance, skip to “Subsequent initialization”.
Configuring the primary data server and a Replication
Agent instance for the first time
Stop the Microsoft SQL Server service.
In Control Panel | Administrative Tools | Services, find the service named Microsoft SQL Server (SERVER), where SERVER is the name of your Microsoft SQL Server data server. For example:
Microsoft SQL Server(TEAMSTER)
Stop the service.
Open a command window, and restart Microsoft SQL Server in single-user mode:
"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe” -m -s instanceName
Here, instanceName is the name of the Microsoft SQL Server instance.
Execute the resource file to create the Replication Agent instance. In your resource file, if you set start_instance to yes, this step also starts the Replication Agent instance. In your resource file, if you also configured initialize_instance to yes, this step also initializes the Microsoft SQL Server and the Replication Agent instance.
After the resource file has been validated, use the ra_admin utility to create the Replication Agent instance using the -r parameter. For example:
%SYBASE%\RAX-15_5\bin\ra_admin -r myra.rs
Execution results are returned as one of the following:
Response-file processing
completed
Response-file processing completed
with errors
See the Replication Agent Administration Guide.
If your resource file set start_instance to no, change to the SYBASE directory and start the Replication Agent instance:
cd %SYBASE%\RAX-15_5\myra
Execute the RUN file, for example:
RUN_myra
Use the dsedit utility to update the Replication Server sql.ini file with the Replication Agent location, and verify the connection to the Replication Agent:
Open a command window in the SYBASE directory of your Replication Agent installation.
Set the environment variables by executing the SYBASE.bat file.
Log in to Replication Agent:
isql –Usa –P –Smyra
Here, myra is the name of Replication Agent.
If your resource file has initialize_instance set to no, initialize the primary data server and the Replication Agent instance:
Open a command window, and log in to the Replication Agent instance.
Issue the following command to create server xlog objects:
server_xlog init
Issue the following command to shutdown Replication Agent:
shutdown
Stop the Microsoft SQL Server in single-user mode:
Log in to the server:
"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE" -U username -P password -S serverName
Here, username, password, and serverName are your user ID, password, and Microsoft SQL Server name.
Issue the shutdown command.
Restart Microsoft SQL Server in multiuser mode (normal start):
In Control Panel | Administrative Tools | Services, find the service named Microsoft SQL Server (SERVER) where SERVER is the name of your Microsoft SQL Server data server. For example:
Microsoft SQL Server (TEAMSTER)
Start the service.
Restart Replication Agent.
Change to the SYBASE directory and start the Replication Agent instance:
cd %SYBASE%\RAX-15_5\myra
Execute the RUN file, for example:
Run_myra
Initialize Replication Agent.
Log in to Replication Agent using isql:
isql –Usa –P –Smyra
where, myra is the name of Replication Agent.
Issue the following command:
pdb_xlog init
The Replication Agent instance is now running, and the primary data server and the Replication Agent instance have been initialized. Continue with “Verifying the Replication Agent replicating state”.