You can configure replication by using SQL Enterprise Manager, or you can set up replication manually by using the instructions that follow. You will also find the following information useful if you want to create a replication setup script.
DISK INIT NAME = 'distdata', PHYSNAME = 'c:\sql60\data\distrib.dat', VDEVNO = 5, SIZE = 15360 go DISK INIT NAME = 'distlog', PHYSNAME = 'c:\sql60\data\dislog.dat', SIZE = 7680 VDEVNO = 6 go
CREATE DATABASE distribution on distdata = 30 LOG ON distlog = 15 go
This script is located in the \SQL60\INSTALL directory. It adds tables, indexes, and stored procedures to the distribution database.
For example, if on a server named WOLFHOUND you have created a distribution database named distribution and will use a working directory of D:\SQL60\REPLDATA, you could set the key values as follows:
xp_regwrite 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\MSSQLServer\Replication', 'DistributionDB', 'REG_SZ', 'distribution' go exec("xp_regwrite 'HKEY_LOCAL_MACHINE', 'SOFTWARE\Microsoft\MSSQLServer\Replication', 'WorkingDirectory', 'REG_SZ', '\\"@@servername+"\D$\SQL60\REPLDATA'") go
sp_serveroption 'WOLFHOUND', 'dist', 'true' go
sp_serveroption 'WOLFHOUND', 'pub', 'true' go
You can check results with sp_helpserver.
sp_addsubscriber BLOODHOUND go sp_addsubscriber AIREDALE go
You can check results with sp_helpserver.
sp_addpublisher WOLFHOUND
use master go sp_dboption pubs,subscribed,true go
use master go sp_dboption pubs,published,true go
use msdb go sp_addtask 'auth_table_sync','Sync','WOLFHOUND','sa','pubs', 1,4,1,8,1,0,0,19940926,19991231,090000,230000,00000000,160000,0, '',2,1,'',2,2
This adds a task "auth_table_sync" that will be run in the Sync Subsystem every hour from 9 A.M. to 11 P.M. It is scheduled to run after September 26, 1994. The task will start at 4:00 P.M. the first day.
You can check the results by using sp_helptask. For example:
use msdb go sp_helptask auth_table_sync, @mode = 'full' go
use pubs go exec sp_addpublication authors_publication,n,@status = active, @description = 'full authors table' go
where "n" is the task ID for the task created using sp_addtask.
You can check the results by using sp_helppublication. For example:
sp_helppublication go
The remaining steps in this procedure assume that you have created a script named AUTHORS.SCH. A example of such a script is provided in A Sample Schema Script, next in this chapter.
exec sp_addarticle authors_publication, authors, authors, @creation_script = 'c:\sql60\repldata\authors.sch', @description = 'Authors Table Article' go
You can check the results by using sp_helparticle and sp_helparticlecolumns. For example:
sp_helparticle go sp_helparticlecolumns @publication=authors_publication, @article=authors go
sp_addsubscription authors_publication, authors, AIREDALE go
use msdb go sp_helptask @subsystem='Distribution' go sp_helptask @subsystem='LogReader' go