StarQuest Technical Documents

How to Automatically Pause and Resume an SQDR Incremental Replication Group

Last Update: 17 November 2006
Product: StarQuest Data Replicator
Version: 3.3 or later
Article ID: SQV00DR015

Abstract

It may be desirable to automatically pause and resume a SQDR Incremental Replication (IR) Group if the source or destination database server is expected to be unavailable for a given length of time, such as during a nightly/weekly backup or during operating system updates. Pausing an IR Group while the source or destination database server is unavailable will prevent the IR subscriptions from being flagged with warnings, and will ultimately result in fewer unnecessary email notifications and Windows Event Viewer messages. 

The SQDR software provides a Windows Script called PauseResumeIRGroup.vbs that can be used to both pause and resume an IR Group. This script can be found in the \Program Files\StarQuest\SQDR directory.

This document explains how to schedule this script to run using the Windows Scheduled Tasks facility.

System Requirements

  • This example uses the Windows Script Host which cannot be disabled or blocked on the SQDR system.
  • The Task Scheduler service on the SQDR system must be running in order to create Scheduled Tasks. Set the Startup Type of the Task Scheduler service to Automatic to allow the service to start when the operating system is started. 

Solution

In the following steps you create two Windows Scheduled Tasks, one to pause an IR Group, and one to resume the Group.

Create a Windows Scheduled Task for the PAUSE Operation

  1. Launch the Windows Scheduled Tasks from Start-->(All) Programs-->Accessories-->System Tools-->Scheduled Tasks. 
  2. Double-click Add Scheduled Task to launch the Scheduled Task Wizard.
  3. Click Next on the first dialog of the Scheduled Task Wizard.
  4. Click the Browse button and browse to the location of the wscript.exe file (typically in C:\Windows\system32). Click Next.
  5. Provide a name for the task, such as PauseIRGroup, and select when to perform this task. Click Next.
  6. Define a schedule for the task or provide a Windows user name and password, depending on when the task is to be executed. Click Next.
  7. Enter a Windows user name and password, if prompted, and click Next.
  8. Check the box "Open advanced properties for this task..." and click Finish.
  9. In the Run field, append the command with the following text, replacing <IRGroupName> with the actual name of the IR Group you wish to pause:

    "C:\Program Files\StarQuest\SQDR\PauseResumeIRGroup.vbs" "<IRGroupName>" "0"

    The resulting command should look like the following:

    C:\WINDOWS\system32\wscript.exe "C:\Program Files\StarQuest\SQDR\PauseResumeIRGroup.vbs" "<IRGroupName>" "0"

  10. Click OK.

Create a Windows Scheduled Task for the RESUME Operation

  1. Launch the Windows Scheduled Tasks from Start-->(All) Programs-->Accessories-->System Tools-->Scheduled Tasks. 
  2. Double-click Add Scheduled Task to launch the Scheduled Task Wizard.
  3. Click Next on the first dialog of the Scheduled Task Wizard.
  4. Click the Browse button and browse to the location of the wscript.exe file (typically in C:\Windows\system32). Click Next.
  5. Provide a name for the Task such as ResumeIRGroup and select when to perform this task. Click Next.
  6. Define a schedule for the task or provide a Windows user name and password, depending on when the task is to be executed. The schedule of the task to Resume the Group should Click Next.
  7. Enter a Windows user name and password, if prompted. Click Next.
  8. Check the box "Open advanced properties for this task..." and click Finish.
  9. In the Run field, append the command with the following text, replacing <IRGroupName> with the actual name of the IR Group you wish to pause:

    "C:\Program Files\StarQuest\SQDR\PauseResumeIRGroup.vbs" "<IRGroupName>" "1"

    The resulting command should look like the following:

    C:\WINDOWS\system32\wscript.exe "C:\Program Files\StarQuest\SQDR\PauseResumeIRGroup.vbs" "<IRGroupName>" "1"

  10. Click OK.

Notes

  • The properties of the Schedule Tasks can be accessed and modified at any time using Scheduled Tasks. Right-click on the desired Task and select Properties.
  • The Windows script can be executed on demand from a Windows command prompt or from Start-->Run using the commands below, where <IRGroupName>is the actual name of the IR Group to be paused or resumed.

    To Pause an IR Group:

    C:\WINDOWS\system32\wscript.exe "C:\Program Files\StarQuest\SQDR\PauseResumeIRGroup.vbs" "<IRGroupName>" "0"

    To Resume an IR Group:

    C:\WINDOWS\system32\wscript.exe "C:\Program Files\StarQuest\SQDR\PauseResumeIRGroup.vbs" "<IRGroupName>" "1"


DISCLAIMER

The information in technical documents comes without any warranty or applicability for a specific purpose. The author(s) or distributor(s) will not accept responsibility for any damage incurred directly or indirectly through use of the information contained in these documents. The instructions may need to be modified to be appropriate for the hardware and software that has been installed and configured within a particular organization.  The information in technical documents should be considered only as an example and may include information from various sources, including IBM, Microsoft, and other organizations.