First-time initialization

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”.

StepsConfiguring the primary data server and a Replication Agent instance for the first time

  1. Stop the Microsoft SQL Server service.

    1. 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)
      
    2. Stop the service.

  2. 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.

  3. 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_2\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.

  4. If your resource file set start_instance to no, change to the SYBASE directory and start the Replication Agent instance:

    cd  %SYBASE%\RAX-15_2\myra
    

    Execute the RUN file, for example:

    RUN_myra
    
  5. 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:

    1. Open a command window in the SYBASE directory of your Replication Agent installation.

    2. Set the environment variables by executing the SYBASE.bat file.

    3. Log in to Replication Agent:

      isql –Usa –P –Smyra
      

      Here, myra is the name of Replication Agent.

  6. If your resource file set initialize_instance to no, initialize the primary data server and the Replication Agent instance:

    1. Open a command window, and log in to the Replication Agent instance.

    2. Issue the following command:

      pdb_xlog init
      
  7. Stop the Microsoft SQL Server in single-user mode:

    1. 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.

    2. Issue the shutdown command.

  8. Restart Microsoft SQL Server in multiuser mode (normal start):

    1. 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)
      
    2. Start the service.

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”.