Add Capture Agent wizard¶
A Capture Agent reads the transaction log of one source database and keeps the committed changes to the tables you replicate in its staging database, where the Replicator Service (SQDR) picks them up. You create one for each source database with the Add Capture Agent wizard of the SQDR Control Center.
This page covers what the wizard does and the steps every source shares. Each source's page (see Select the database type) has its source-specific fields, what the wizard sets up on the source, and how to prepare the database.
When to add a Capture Agent¶
- Once for each source database you replicate incrementally. An agent is identified by the source database, host, port and control schema; a second agent with the same values fails with "Agent: name already exists."
- A second agent for the same source database needs a different Control Schema, for example when two SQDR Plus systems capture from the same database.
Before you start¶
- Prepare the source database: logging, users and permissions, as described in the Prepare the database section of its page.
- Check the network. The Stelo VM must reach the source database's port (see Ports).
- For an encrypted connection, add the certificate of the source's certificate authority on the Certificates tab first (see the SSL/TLS part of your source's page).
Select the database type¶
In the SQDR Control Center, click Add Capture Agent and choose the type of the source database:
| Type to choose | Source databases | Page |
|---|---|---|
| IBM iSeries | Db2 for i (IBM i) | Db2 for i |
| IBM UDB LUW | Db2 for Linux, UNIX and Windows | Db2 for LUW |
| Informix | Informix | Informix |
| Microsoft SQL Server | SQL Server | SQL Server |
| MySQL | MySQL, MariaDB, Aurora MySQL | MySQL, MariaDB and Aurora |
| Oracle | Oracle, including multitenant container databases | Oracle |
| PostgreSQL | PostgreSQL | PostgreSQL |
Step 1: Database¶
The fields depend on the source: see the Add the Capture Agent section of its page (linked in the table above). Next connects to the source with these values and looks at the control schema; some sources run further checks (for example the Oracle and MySQL logging settings). If the connection or a check fails, a message starting with "Request failed." gives the reason: correct the values and click Next again (the Db2 for i wizard closes instead, so you start it again).
Next can already change the source database: for example it enables Change Data Capture on a SQL Server database, or creates the control schema on PostgreSQL and MySQL. Cancelling the wizard afterwards doesn't undo those changes; otherwise Cancel creates nothing on the Stelo VM.
Step 2: Control DB¶
For Db2 for i and Oracle, this step also asks for the users the agent connects as (see the source's page).
An agent's control database is its staging database: the Db2 LUW database on the Stelo VM that holds the captured changes and the agent's control tables.
| Option | What it does | Default | When to change it |
|---|---|---|---|
| Control Database | <New Control DB> creates a new staging database for this agent. The Launch Agent names it SQDRP0, SQDRP1 and so on (the first free name), and the agent's tables go in schema SQDR. Choosing an existing database from the list puts this agent in the same staging database as the agents that already use it, in its own schema (SQDR, or SQDR0, SQDR1 and so on if that name is taken). |
<New Control DB> | To keep several agents in one staging database. |
The Launch Agent connects to the staging database with its own control-database credentials (the Db2 user entered when Stelo Capture was installed).
When you delete an agent, its staging database is dropped only if no other agent uses it; otherwise only the agent's schema is dropped (see Delete).
Step 3: Logging¶
Each field sets an agent property (in brackets) that you can change later on the agent's Configuration tab. See also Email notification.
| Option | What it does | Default | When to change it |
|---|---|---|---|
| Log Level | The agent's log, which you read on its Diagnostics tab (logLevel). |
INFO | Raise it while you diagnose a problem; the FINE levels write much more. |
| Email Notification Level | Emails log entries of this level or more serious to the notification address (notificationLevel). |
OFF | To be told by email when the agent logs errors (SEVERE) or warnings. |
| Use Email Configuration from Replication Manager. | Sends the notifications with the Replicator Service's (SQDR) email settings, set on the Notification tab of the Data Replicator Manager's Service settings (SMTP, Microsoft Graph API or GMail REST API), instead of the three fields below (commonEmailConfig). |
selected | Clear it to give this agent its own mail server and addresses. |
| SMTP Server Name | SmtpServer. The port is 25 unless you set another one in the mailOptions property. |
โ | |
| Email Notification Address | to |
โ | |
| Email Sender Address | from |
โ | |
| Send Error Notifications to Stelo | Also emails SEVERE log entries to Stelo Support (starquestNotification = SEVERE; OFF when cleared). |
cleared | Select it if Stelo Support should hear about agent errors directly. If your network blocks outside mail servers, see Mail notifications fail. |
No email is sent unless a mail server, a recipient and a sender are available, either in these fields or in the shared configuration.
Finish the wizard¶
If you click Finish before the Logging step, its defaults apply. Finish sets up what the agent needs on the source database (see the source's page) and asks the Launch Agent to register the agent. The Launch Agent then:
- names the agent
<database>@<host>, or<database>%<control schema>@<host>when the control schema isn'tSQDR(you can rename it later with thenameproperty on the agent's Configuration tab); - gives it its own port (the next free port above the Launch Agent's port 50005, see Ports) and a home directory for its configuration and logs;
- creates the staging database, or a schema in an existing one, and the agent's control tables there;
- saves the agent's configuration, with the passwords encrypted;
- leaves the agent Stopped: you start it when you're ready (see Start the agent).
Creating the agent can take a while. If something fails, a message starting with "Request failed." gives the reason. For Db2 for i, the wizard stays open so you can correct the values; for the other databases it closes, and you start again with Add Capture Agent. What the wizard already set up on the source (for example the control schema) stays there and is reused on the next attempt.
Start the agent¶
If the source requires publication (Oracle agents do), publish the tables first (see Publish tables). Then select the new agent in the tree and click Start/Restart.
The first start can take several minutes while the agent sets up its tables; check the Summary and Diagnostics tabs. For the other actions, see Start, stop and delete a Capture Agent.
Note
The Launch Agent starts every agent that isn't Disabled when its service starts. An agent you left Stopped starts the next time the SQDR Plus Launch Agent service restarts; disable it if it shouldn't.
Next steps¶
- If the source requires publication (
requirePublication), check that the published tables show Published on the Publications tab. - In the Data Replicator Manager, create or edit the source for this database, tick Allow Incremental Replication from this Source and choose the agent's control schema as the Capture Agent Schema (see Incremental Replication).
- Create an incremental group and its subscriptions (see Incremental groups).
An existing agent in the control schema¶
If Next finds the control tables of an SQDR Plus v3 Capture Agent in the control schema, the wizard asks whether to manage it remotely. Manage remotely registers the existing agent with this SQDR Control Center and closes the wizard.