Running Replications Outside Replicator Manager

Using PowerShell

You can using PowerShell to run replications and perform other SQDR tasks; refer to the StarQuest tech note Automating SQDR tasks using PowerShell.

Using Stored Procedures to Manage SQDR Subscriptions (Deprecated - local SQL Server control database only)

You can manage SQDR subscriptions by calling the SQL Server extended stored procedure sqdrxp_startreplication. This feature is not available when using a remote SQL Server instance or Db2 for the control database.

Refer to the Microsoft SQL Server documentation for more information about executing stored procedures. The SQL Server service should be running as a user ID that Local Activation permission for the SQDataReplicator class. This security permission can be modified using the Component Services administrative tool.

To run an individual subscription:

USE master
EXEC sqdrxp_startreplication @source = '<source_name>', @subscription = '<subscription_name>', @wait = 'Y'|'N'

The optional argument, @wait, determines whether the replication operation must complete before the stored procedure call returns. The default for the @wait argument is 'No', which causes the call to return before the replication operation completes if the @wait argument is not specified.

To run a group of subscriptions:

EXEC sqdrxp_startreplication @source = ' ', @subscription = '<group_name>',  @force = 'Y'|'N'

See the next section for details about the optional @force parameter.

 

Forcing Baselines for Incremental Subscriptions

When an incremental subscription in a group is in a warning state, that condition may be resolved over time; however, error conditions may require that another baseline replication operation be performed.

You can force a new baseline replication to be run for an incremental subscription with Data Replication Manager by selecting the subscription from the Subscriptions folder of the corresponding source (Sources folder) and executing the Run Subscription command.

If you want to force a baseline to be run for every incremental subscription in a scheduled group that is in a warning or error state, SQDR provides a programmatic method using the optional @force parameter of the sqdrxp_startreplication extended stored procedure (SQL Server control database only). When the @force parameter is specified, a new baseline replication is run for all the incremental subscriptions in the group that have encountered an error or a warning.