First-time primary database initialization

To initialize the primary data server, Mirror Replication Agent for Microsoft SQL Server installs objects at the data server level and at the database level. The data server-level modifications are required only once. Use this procedure if you are initializing the primary data server and a Mirror Replication Agent instance for the first time.

If you have previously initialized the primary data server and a Mirror Replication Agent instance and want to initialize another Mirror Replication Agent instance, skip this procedure, and follow the instructions in “Subsequent primary database initialization”.

StepsTo configure the primary data server and a Mirror 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:

      SQL Server(TEAMSTER)
      
    2. Stop the service.

      NoteIf you have a DirectConnect service attached to the primary data server, make sure that service is stopped.

  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 Mirror Replication Agent instance. In your resource file, if you set start_instance to yes, this step also starts the Mirror 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 Mirror Replication Agent instance.

    Use the ma_admin utility to create the Mirror Replication Agent instance using the -r parameter. For example:

    %SYBASE%\MA-15_1\bin\ma_admin -r myma.rs
    

    Execution results are returned as one of the following:

    • Response-file processing completed

    • Response-file processing completed with errors

    For more information, refer to the Mirror Activator Administration Guide, Chapter 2, “Setup and Configuration,” in the section titled, “Creating a Mirror Replication Agent instance using resource files.”

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

    cd  %SYBASE%\MA-15_1\myma
    

    Execute the RUN file, for example:

    RUN_myma
    
  5. Using the dsedit utility, update the Replication Server sql.ini file with the Mirror Replication Agent location, and verify the connection to the Mirror Replication Agent:

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

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

    3. Use the Sybase isql utility to log in to Mirror Replication Agent:

      isql –Usa –P –Smyma
      

      Here, myma is the name of Mirror Replication Agent.

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

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

    2. Issue the following command:

      pdb_init
      
    3. Shut down the Mirror Replication Agent instance:

      shutdown
      
  7. Stop the Microsoft SQL Server in single-user mode (only one administrator can log in when Microsoft SQL Server is running in single-user mode):

    1. Use the sqlcmd utility to 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 multi-user mode (normal start):

    1. In Control Panel | Administrative Tools | Services, find the service named SQL Server (SERVER) where SERVER is the name of your Microsoft SQL Server data server. For example:

      SQL Server (TEAMSTER)
      
    2. Start the service.

  9. Start the Mirror Replication Agent instance:

    %SYBASE%\MA-15_1\instancename\RUN_instancename
    

    where instancename is the name of the Mirror Replication Agent instance.

The Mirror Replication Agent instance is now running, and the primary data server and the Mirror Replication Agent instance have been initialized. Continue with “Verifying the Mirror Replication Agent REPLICATING state”.