STOP,REPL command
You can use the STOP,REPL command to stop replication activity for a single subscription or for all subscriptions.
Stopping replication
This command ends replication activity for the specified subscription.
Parameters
- subscription name
- The name of the subscription to stop. You can specify the subscription name as a quoted or an unquoted identifier.
- ALL
- Stops all subscriptions. The capture service examines the state of each subscription and processes the request if all subscriptions are in an appropriate state.
- CONTROLLED (default)
- The source server completes sending any UOR that it started sending to the target server and then stops sending UORs. The target server applies all UORs in the apply cache before replication stops. After a controlled stop, the subscription is placed in inactive state. The capture service continues to read log data for the subscription in anticipation of a subsequent START command for the subscription.
- IMMEDIATE
- The source server stops sending UORs immediately. The target server discards any partially received UORs and rolls back any UORs that are currently being applied to the target data source. UORs that are already in the apply cache remain cached in anticipation of a subsequent START command for the subscription. After an immediate stop, the subscription is placed in inactive state. The capture service continues to read log data for the subscription in anticipation of a subsequent START command for the subscription.
- SCHED
- Stops replicating transactions at the scheduled end time. This option can only be used on
subscriptions that are replicating with the CONTINUOUS option. You can reissue the SCHED option as
desired to change a previously set scheduled end time. Replication is stopped when the source server
encounters the first unit of recovery (UOR) that occurs after the user-specified scheduled end time.
The UOR that triggers the scheduled end process is not replicated because it occurs after the
specified scheduled end time. The SCHED keyword must be followed by one of the following parameters:
- NOW
- Stops replicating transactions at the current time.
- GMTTIME
- Stops replicating transactions at the specified GMT time. Specify the time in the format YYYY-MM-DD-hh.mm.ss.thmiju where: YYYY-MM-DD is the calendar date hh.mm.ss.thmiju is the time of day You must specify the time up to and including the ss (seconds) value.
- SERVERTIME
- Stops replicating transactions at the specified Classic server local time. Specify the time in the format YYYY-MM-DD-hh.mm.ss.thmiju where: YYYY-MM-DD is the calendar date hh.mm.ss.thmiju is the time of day You must specify the time up to and including the ss (seconds) value.
- CAPTURE
- Stops data capture and discards the capture cache for one or more
subscriptions.
You can only stop data capture for a subscription that is in an inactive state. When you issue the STOP,REPL command with the CAPTURE keyword, the subscription remains in an inactive state and the capture service stops reading data for the subscription.
- RESET
- Places a subscription in an INACTIVE state. Use the RESET command under these conditions:
- The subscription is not responding and is in a state where an IMMEDIATE command is not accepted. For instance, the subscription is in STARTING state.
- An IMMEDIATE command is entered but the subscription is not stopping. One reason for this kind of behavior is that TCP/IP is preventing messages being sent to the target which means replication does not end for the subscription.
Examples
The CAPTURE keyword is useful when you change the definition of a subscription and the cached data will no longer match the new definition. The CAPTURE keyword is also useful in situations when you want to reduce the amount of storage that the capture cache uses.
- To stop data capture and discard any currently cached data for all inactive
subscriptions:
STOP,REPL,ALL,CAPTURE - To put subscription sub1 into an inactive state and then stop data capture
and discard any currently cached associated with the sub1 subscription, issue the
following sequence of
commands:
STOP,REPL,SUBSCR=sub1,IMMEDIATESTOP,REPL,SUBSCR=sub1,CAPTURE - To put all eligible subscriptions into an inactive state and then stop data capture and discard
any currently cached associated with the subscriptions, issue the following sequence of
commands:
STOP,REPL,ALL,IMMEDIATE
You can only stop data capture for a subscription that is in an inactive state. When you issue the STOP,REPL command with the CAPTURE keyword, the subscription remains in an inactive state and the capture service stops reading data for the subscription and clears out any cached data. The SCHED keyword is used to stop continuous replication at a specified point in time.STOP,REPL,ALL,CAPTURE - To stop replicating transactions for all continuously replicating subscriptions at the current
time:
STOP,REPL,ALL,SCHED,NOW - To stop replicating transactions for continuously replicating subscription sub1 at a specific
GMT
time:
STOP,REPL,SUBSCR=sub1,SCHED,GMTTIME=2019-12-10-09.15.21 - To stop replicating transactions for continuously replicating subscription sub1 at a specific
Classic server local
time:
STOP,REPL,SUBSCR=sub1,SCHED,SERVERTIME=2019-12-10-09.15.21.000000
