You must initialize the primary Microsoft SQL Server data server so that Mirror Replication Agent can open the supplemental log of a table or procedure that is marked for replication. You need to do this only once for a given primary data server.
To initialize the primary data server and Mirror
Replication Agent for the first time
Make sure Microsoft SQL Server is configured to allow a remote DAC by logging in to the Microsoft SQL Server as sysadmin and executing the following SQL commands:
sp_configure ’remote admin connections’,1
go
RECONFIGURE
go
Alternately, you can use the Microsoft SQL Server Surface Area Configuration tool to enable a remote DAC:
From the Windows Start menu, choose Microsoft SQL Server | Surface Area Configuration | Configuration Tools | SQL Server Surface Area Configuration | Surface Area Configuration for Features.
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.
Determine the primary Microsoft SQL Server DAC port number.
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
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.
Record the port number specified in this entry.
Log in to your Mirror 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.
Also configure the following Mirror 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 Mirror Replication Agent Installation Guide and Reference Manual.
Stop the Microsoft SQL Server service.
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.
Stop this 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.
Make sure that there are no other connections to the primary database, and verify that Mirror Replication Agent can connect to the primary database:
test_connection PDS
Initialize the Microsoft SQL Server data server and Mirror Replication Agent:
pdb_init
In the primary database, Mirror Replication Agent creates all the tables, procedures, and triggers described in “Mirror Replication Agent objects in the Microsoft SQL Server primary database”. The sp_SybSetLogforReplTable, sp_SybSetLogforReplProc, sp_SybSetLogforLOBCol procedures are created in the mssqlsystemresource database with execute permission granted to Public.
Stop the Microsoft SQL Server in single-user mode in either of the following ways:
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, your password, and the name of the Microsoft SQL Server.
After you have logged in to the Microsoft SQL Server, use the shutdown command.
In the Microsoft SQL Server server Start window, type Ctrl+C.
Restart Microsoft SQL Server in multi-user mode (normal start).
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.
Start this service.
If you want to start other services, such as the Microsoft SQL Server Agent service, the Microsoft SQL Server Analysis Services, or the Microsoft SQL Server Reporting Services, you can start these services now.