Prerequisites
Standby databases
An Oracle database can be configured with either a physical or a logical standby database for recovery after a production failure. At this time, Streamkap does not support them.- Oracle 12c or above, Standard or Enterprise Edition
- Hostname and Port
- (single-tenant architecture): Database name
- (multi-tenant architecture): Container database name (CDB) and pluggable database name (PDB)
- The Oracle database master user credentials or equivalent
Oracle Setup
For the Connector to ingest changes from your database it is dependent on Oracle’s redo logs and archive logs. It is important that these redo logs are large enough and, the archive logs are retained for long enough to ensure all changes are captured.1. Enable Archive Logs
Reboot required
WhenARCHIVELOG
mode is enabled, your Oracle database will be taken offline.Retention periods and database storage
Archive logs are retained on your database instance using up its storage capacity. It is important to make sure it has enough space, otherwise, performance issues and outages can occur.In general, the more tables (and columns) there are, the more capacity is required. For the Connector, additional capacity is essential because it depends on Oracle’s supplemental logging.To estimate what storage capacity you might need and assuming your Oracle database has supplemental logging enabled, you can look at the last 1 hour of log storage usage and multiply that by the retention period (at least 24 hours) you choose. Here’s an example script for that:SQL
ARCHIVELOG
mode, run this script:
ARCHIVELOG
mode has been enabled, run this query:
Database log mode
is Archive Mode
then it is enabled.
2. Enable LogMiner
For the Connector to query the redo and archive logs, it is dependent on the Oracle LogMiner utility. To enable that, supplemental logging must be enabled.SUPPLEMENTAL_LOG_DATA_MIN
is YES
it is enabled.
2.1) Resize redo logs
An Oracle instance typically starts with three, online redo log files, 50MB each. That is too small and too few; more log files are necessary, and the logs should be resized to at least 1024MB or more, especially for production databases. Before making any changes, run this query to check the current log file sizes:GROUP# | SIZE_MB | STATUS |
---|---|---|
1 | 50 | INACTIVE |
2 | 50 | INACTIVE |
3 | 50 | CURRENT |
GROUP# | LOCATION | STATUS |
---|---|---|
1 | /opt/oracle/oradata/ORCLCDB/redo01.log | ACTIVE |
2 | /opt/oracle/oradata/ORCLCDB/redo02.log | INACTIVE |
3 | /opt/oracle/oradata/ORCLCDB/redo03.log | UNUSED |
INACTIVE
and UNUSED
groups can be dropped and recreated.
Log multiplexing
Oracle does support the notion of multiple log files per group known as ‘log multiplexing’. If your database uses this, use a comma-delimited list of filenames to register each log file.ACTIVE
log so we can drop it.
ACTIVE
group to INACTIVE
. The switch could take several minutes, so be patient and recheck the size periodically. Once the status reaches INACTIVE
, replace the last, old log file and confirm all logs are resized:
GROUP# | SIZE_MB | STATUS |
---|---|---|
1 | 1024 | CURRENT |
2 | 1024 | UNUSED |
3 | 1024 | ACTIVE |
… | … | … |
Group numbering and log file sizing
The{group_number}
should follow sequentially. There is no benefit to organising log groups in sequences such as 10,20,30
or mixed sizing such as 128MB, 1024MB, 512MB
.For example, if the highest group number is 3
and log file /opt/oracle/oradata/ORCLCDB/redo03.log
of size 1024MB
, the next log file added should be group 4
and log file /opt/oracle/oradata/ORCLCDB/redo04.log
of size 1024MB
.GROUP# | SIZE_MB | STATUS |
---|---|---|
1 | 1024 | CURRENT |
2 | 1024 | UNUSED |
3 | 1024 | ACTIVE |
4 | 1024 | INACTIVE |
5 | 1024 | INACTIVE |
… | … | … |
3. Create Database User
Depending on your database architecture, choose the correct script below to create a database user with privileges for the Connector.4. Enable Snapshots
To backfill your data, the Connector needs to be able to perform Snapshots (See Snapshots & Backfilling for more information). To enable this process, a table must be created for the Connector to use. Depending on your database architecture, choose the correct script below.Please create the signal table with the name
STREAMKAP_SIGNAL
. It will not be recognised if given another name.Streamkap Setup
- Go to Sources and choose Oracle
-
Input the following information:
- Name - A unique and memorable name for this Connector
- Hostname - The database endpoint
- Port (optional) - The database port
- Username (case sensitive) -
STREAMKAP_USER
or the username you chose - Password - The database user’s password
- Signal Table Schema - Streamkap will use a collection in this schema to manage snapshots e.g.
public
. See Enable Snapshots for more information - Heartbeat - Essential for low volume, pluggable databases. See Oracle Heartbeats (CDB Multi-Tenant)
- Heartbeat Table Schema - Streamkap will use a table in this schema to manage heartbeats. Usually this is the same as the Signal Table Schema
- Database - The database name (single-tenant architecture) or container database name (multi-tenant architecture)
- Pluggable Database (optional, multi-tenant architecture only) - The pluggable database name
- Connect via SSH Tunnel. See SSH Tunnel
- Advanced Parameters
- Represent Binary Data As (Default
bytes
)
- Represent Binary Data As (Default
- Add Schemas/Tables. Can also bulk upload here. The format is a simple list of each schema or table per row saved in csv format without a header.
- Click Save
Frequently Asked Questions
Why does the Connector need CREATE TABLE
privileges?
Oracle has a background process called the “Log Writer” or LGWR for short. Logs are written to an in-memory buffer first, and then the LGWR writes them to disk.
The Connector needs to keep track of the last recorded system change number (SCN) that the LGWR process records for each committed transaction.
It’s best to persist that SCN somewhere outside of the Connector so it creates a very small, 1 column table named LOG_MINING_TABLE
. If the Connector fails, it can use the last recorded value from that table to recover.
Do I need to resize my redo logs for a database with low data volume and traffic?
We recommend it because the supplemental logging configuration from earlier in this guide will increase the amount of data in the redo logs, data that’s required for tracking changes to your data, including it’s schema. We would also recommend for databases with low traffic to also enable the heartbeats feature explained here: Oracle HeartbeatsMulti-tenant Architecture
How do I find the Container and pluggable database names?
Connect to the database and run this script to list the available container (CDB) and pluggable database (PDB) names.CDB
column should show YES
.
Can I create an Oracle local user instead?
At this time, no. The Connector makes calls to LogMiner APIs from within the root database. Additionally, it consults severalV$
tables which are not available from within a PDB.