739
Chapter 28: Replicating Data
28
- Click Next to advance to the Subscribers dialog. All subscribers currently enabled
appear in this dialog. If your subscriber does not appear, click the Add Subscriber
button. This button is a drop-down button that enables you to create SQL Server
and Non-SQL Server Subscribers. You can create subscriptions to SQL Servers as well
as Oracle and DB2 subscribers using this wizard.
For more information on how to replicate to Oracle and DB2 subscribers, refer to this link: http://
msdn.microsoft.com/en-us/library/ms151864.aspx
- After clicking the Add Subscriber button, you are prompted to connect to your
Subscriber. This dialog looks similar to the Connect to SQL Server dialogs you are
familiar with from connecting to SQL Server. After you add the subscriber, you can
select the subscription database. Select it in the drop-down box, and then click
Next. - The Distribution Agent Security dialog appears. This is similar to the Snapshot
Agent Security dialog. Enter the account under which you want the distribution
agent to run. You can also specify the accounts you want to use to connect to the
distributor and subscriber here. - Click OK when you have completed the setup of these accounts.
- Click Next to advance to the Synchronization Schedule dialog. From here, you can
set a schedule. The default is Run Continuously, which means that the agent always
runs in the case of transactional replication. (This setting has no effect on snap-
shot publications.) If you want to run your distribution agent on a schedule, click
the drop-down button and defi ne a schedule, or have the agent run on demand. If
you select the option to run the agent on demand, you must run the agent either
through the Replication Monitor, by running the job for the distribution agent, or
by expanding the publication, locating the subscriber, right-clicking it, and select-
ing View Synchronization Status and then clicking the Start button. - Click Next to advance to the Initialize Subscriptions dialog. The options are to
initialize, which means the snapshot will be applied at the subscriber, or not to
initialize, which means that you need to put all the required objects in place. This
includes all tables, the data, stored procedures, functions, and views, as well as
replication stored procedures.
a. To create the replication stored procedures, use the command sp_
scriptpublicationcustomprocs 'PublicationName' in your publica-
tion database. The stored procedures appear in the results pane. Copy them into
the query window, and run them in your subscription database. Under most
circumstances the best choice is to select the initialize option.
b. If you do select the initialize option, two selections are available in the drop-
down list: At First Synchronization and Immediately. At First Synchronization
means the snapshot will be generated when the distribution agent runs.
Immediately means the snapshot will be generated and applied on the sub-
scriber when you complete the dialog.
c28.indd 739c28.indd 739 7/31/2012 9:51:13 AM7/31/2012 9:51:13 AM
http://www.it-ebooks.info