Take subscriptions offline and online¶
Before a large change to a source table that you don't want replicated row by row (restoring it from a backup, reloading it, dropping and re-creating it, or adding and removing Db2 for i members), take its subscriptions offline: the Capture Agent stops capturing the table for SQDR. Afterwards, take them online, and SQDR copies the table again with a new baseline, without deleting and re-creating the subscriptions.
Take tables offline and back online¶
- On the agent's Subscriptions tab, select the subscriptions and click Offline.
- Make the change to the tables.
- Select the subscriptions again and click Online. SQDR runs a new baseline for each table.
The action works on whole tables, for every group that subscribes to them, not only the rows you selected; the confirmation counts what it touches. Capture pauses briefly meanwhile. Changes made while a table was offline aren't replicated: the new baseline covers them.
If only some tables could be changed, a message says how many (for example "Took offline 2 of 3 tables"); the agent's log on the Diagnostics tab has the reason for the rest.
What offline and online do¶
- Offline acts on the source table, for every SQDR subscriber of it. The Capture Agent stops staging its changes and empties its staging table at once (the staged changes are deleted); SQDR sees no more activity for the table. A new subscription to an offline table fails until the table is online again.
- Online restores journaling or logging on the table if needed, and capture starts again from the agent's latest transaction. SQDR is told that the table needs a baseline, and runs it before applying further changes. A subscription already online isn't changed.
From the IBM i command line (Db2 for i)¶
For a Db2 for i source, you can also take tables offline or online from a command line or a CL program, for example the job that restores the tables, with the VRYSUB (Vary Subscription) command in the agent's library on the IBM i:
ADDLIBLE SQDR
VRYSUB LIBRARY(PRODLIB) NAME(CUSTLIST) STATUS(*OFFLINE) AGENT(SQDR)
| Parameter | Prompt | What it's for |
|---|---|---|
LIBRARY |
LIBRARY | The library of the tables: a name, a generic name (PROD*) or *ALL. |
NAME |
FILE | The file (table): a name, a generic name or *ALL. |
STATUS |
STATUS | *OFFLINE or *ONLINE. |
AGENT |
INSTALL LIBRARY | The agent's library. Default SQDR. |
The command queues the request for the Capture Agent, which carries it out when running. If the command fails, the message is "VRYSUB command completed ABNORMALLY".
Related¶
- Recovery and Startup mode (Force Offline takes all subscriptions offline at the next start)
- Migrations: a restored source; to start every subscription again with a baseline, use Force New Baselines (see Startup mode)
- A few stalled subscriptions hold up all replication