Creating a schedule v7

A schedule establishes recurring times for replication.

Note

(For MMR only): Be sure an initial snapshot replication was performed from the primary definition node to every other primary node in the multi-master replication system. If a newly added primary node didn't undergo an initial snapshot, any subsequent synchronization replication started by a schedule might fail to apply the transactions to that primary node. You can take the initial snapshot when you first add the primary node (see Creating more primary nodes) or by performing an on-demand snapshot (see Performing snapshot replication).

In a single-master replication system, once a schedule is created, the subscription server starts replications according to the schedule until you either change or remove the schedule. In a multi-master replication system, the publication server handles this process.

See Managing a schedule for changing or removing a schedule.

When a scheduled replication occurs, all components of the replication system must be running:

  • Publication database server
  • Subscription database server (applies only to single-master replication systems)
  • Publication server
  • Subscription server (applies only to single-master replication systems)

If any of these components isn't running at the time of a scheduled replication, then the scheduled replication doesn't occur. The replication occurs at the next scheduled replication time when all required replication system components are running.

For synchronization replications with the trigger-based method, changes that occurred on the source tables that weren't replicated due to a skipped scheduled replication are maintained as pending transactions in the shadow tables of the source database.

For synchronization replications with the log-based method, changes that were extracted from the WAL files to in-memory structures but weren't applied are persisted using Java object serialization to files on the host running the publication server.

All changes since the last successful replication are applied whenever the next scheduled replication occurs. Thus, accumulated changes are never lost due to a missed replication.

For snapshot replications, skipped scheduled replications present no problem since a snapshot replication replaces all of the data in the target tables with the current source data.

  1. For SMR: Select the Subscription node of the subscription for which you want to create a schedule.

    For MMR: Select the Publication Database node designated as the controller database. (The Controller database field in the Property window is set to Yes for the controller database.)

  2. For SMR: Select Subscription > Schedule > Configure Schedule.

    For MMR: On the Publication Database node and select Configure Schedule from the context menu.

  3. In the Scheduled Task Wizard dialog box, select either synchronization replication or snapshot replication.

    Note

    If the publication associated with this subscription is a snapshot-only publication, then you can select only Snapshot. In a multi-master replication system, you can select only Synchronize.

  4. Select the scheduled replication frequency, or select Cron Expression to write your own cron expression. The frequency choices have the following meanings:

    • Continuously. Schedules replication to run continuously at an interval in seconds that you specify. Select this option if the source tables change frequently during the day and the target tables must be kept up to date throughout the course of the day.
    • Daily. Schedules replication to run once a day at the time you choose. Select this option if the target tables need to be refreshed daily.
    • Weekly. Schedules replication to run once a day at the time you choose, but only on the specific days of the week you choose. Select this option if you need more flexibility than a daily schedule, and the target tables don't have to be refreshed every day.
    • Monthly. Schedules replication to run one day per month on the day of the month and time you choose, but only in the months you choose. Select this option if updates to the source tables aren't very frequent, and the target tables can be out of date by a month or more. The Monthly option allows you to schedule replication for as often as once a month or as infrequently as once a year.
    • Cron Expression. Provides additional flexibility for specifying a schedule. See Writing a cron expression for details.
  5. Select Next.

  6. Review the schedule and select Finish to accept it.

Select Refresh to see the schedule properties in the General tab.