First-time initialization

You must initialize the primary Microsoft SQL Server data server so that Replication Agent can open the supplemental log of a table or procedure that is marked for replication. Do this only once for a given primary data server.

StepsInitializing the primary data server and Replication Agent for the first time

  1. Stop the Microsoft SQL Server Analysis Service. From the Microsoft Windows Control Panel, choose Administrative Tools | Services, and find the service named SQL Server Analysis Service(SERVER), where SERVER is the name of your Microsoft SQL Server data server. Stop this service.

  2. Make sure Microsoft SQL Server is configured to allow a remote dedicated administrative connection (DAC). Use the Microsoft SQL Server Surface Area Configuration tool to enable a remote DAC:

    1. From the Windows Start menu, choose Microsoft SQL Server | Surface Area Configuration | Configuration Tools | SQL Server Surface Area Configuration | Surface Area Configuration for Features.

    2. In the Surface Area Configuration for Features window, choose DAC under MSSQLSERVER/Database Engine, and make sure the Enable remote DAC check box is selected.

  3. Determine the primary Microsoft SQL Server DAC port number.

    1. Open the ERRORLOG file in a text editor. This file is located in the log directory of your Microsoft SQL Server. For example,

      C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG

    2. Search for the string “Dedicated admin” to find an entry similar to the following:

      2007-11-09 13:40:02.40 Server Dedicated admin connection support was established for listening locally on port 1348.
      
    3. Record the port number specified in this entry.

  4. Log in to your Replication Agent, and set the pds_dac_port_number configuration parameter:

    ra_config pds_dac_port_number, port
    

    Here, port is the DAC port number you recorded.

  5. Also configure the following Replication Agent connectivity parameters for the Microsoft SQL Server primary database:

    • pds_server_name

    • pds_database_name

    • pds_username

    • pds_password

    • pds_port_number

    For information about these configuration parameters, see the Replication Agent Installation Guide and Replication Agent Reference Manual.

  6. Stop the Microsoft SQL Server service.

    1. From the Windows Control Panel, go to Administrative Tools | Services, and find the service named SQL Server (SERVER). Here SERVER is the name of your Microsoft SQL Server data server.

    2. Stop this service.

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

  8. Make sure that there are no other connections to the primary database, and verify that Replication Agent can connect to the primary database.

    1. Use isql to log in to the Replication Agent instance:

      isql -Uusername -Ppassword -SinstanceName 
      

      Here, username, password, and instanceName are your user ID, password, and Replication Agent instance name.

    2. Issue the following command.

      test_connection PDS
      
  9. Initialize the Microsoft SQL Server data server and Replication Agent:

    pdb_xlog init
    

    In the primary database, Replication Agent creates all the tables, procedures, and triggers described in “Replication Agent objects in the Microsoft SQL Server primary database”. The sp_SybSetLogforReplTable and sp_SybSetLogforReplProc procedures are created in the mssqlsystemresource database with execute permission granted to Public.

  10. Stop the Microsoft SQL Server in single-user mode in either of the following ways:

  11. Restart Microsoft SQL Server in multi-user mode (normal start).

    1. From Windows Control Panel, go to Administrative Tools | Services, and find the service named SQL Server (SERVER). Here SERVER is the name of your Microsoft SQL Server data server.

    2. Start this service.

      If you want to start other Microsoft SQL Server services, such as Microsoft SQL Server Agent service or the Microsoft SQL Server Analysis Service, you can start these services now.