If necessary you can change the distribution database used by a publication server. The technique you use to change the distribution database depends on whether or not you need to retain existing publications:
Except where otherwise noted, the following steps assume the use of SQL Enterprise Manager.
Information on publications can be obtained using sp_helppublication and sp_helparticle. Information on subscriptions can be obtained using sp_helpsubscription.
Information on subscription servers can be obtained using sp_helpserver and sp_helpsubscriberinfo.
With SQL Enterprise Manager, this list is accessed using the Replication Configuration/Publishing command from the Server menu.
Note Removing a published database from the Publishing Databases list drops all of its publications, and all subscriptions associated with each publication.
This list is also accessed using the Replication Configuration/Publishing command from the Server menu.
sp_serveroption servername, 'dist', false
If the publication server is configured as its own distributor, servername is the name of the local server. If the publication server is configured to use a remote distribution server, servername is the name of that remote distribution server.
Select the publication server; from the Server menu, choose Replication Configuration; choose Install Publishing; and complete the Install Replication Publishing dialog box that appears.
If you need to retain existing publications, the procedure is slightly different. You do not remove published databases from the Publishing Databases list, which allows you to retain the server's publications.
Information on publications can be obtained using sp_helppublication and sp_helparticle. Information on subscriptions can be obtained using sp_helpsubscription.
Information on subscription servers can be obtained using sp_helpserver and sp_helpsubscriberinfo.
With SQL Enterprise Manager, this list is accessed from the Replication Configuration/Publishing command from the Server menu.
Important Do not clear the check boxes for published databases in the Publishing Databases list. If you do so, all publications for those databases will be dropped. If that occurs, to reestablish replication you will need to re-create all publications.
sp_serveroption servername, 'dist', false
If the publication server is configured as its own distributor, servername is the name of the local server. If the publication server is configured to use a remote distribution server, servername is the name of that remote distribution server.
Select the publication server; from the Server menu, choose Replication Configuration; choose Install Publishing; and complete the Install Replication Publishing dialog box that appears.
In the Replication Publishing dialog box, add subscription servers to the Enable Publishing to These Servers list. For each subscriber, if it does not already exist, this adds a new entry in the sysservers table. The server status is set to "sub" (subscription server) and an associated entry for the server is placed in the MSsubscriber_info table of the distribution database. Finally, this creates a cleanup task for the server.
If this dialog box does not appear after you install or select a distribution database, open it by selecting the server and choosing Replication Configuration/Publishing from the Server menu.
To add a scheduled task, select the server from the Server Manager window; from the Tools menu, choose task scheduling; in the Task Scheduling dialog box, choose the New Task button; and complete the New Task dialog box that appears.
For information about creating replication tasks, see Chapter 16, Scheduling Tasks.
The first subscription for each destination database will create a distribution task.