Preview. The Oracle connector is available as a preview. It was verified against real multitenant Oracle databases (21c Express Edition and 23ai/26ai Free); see What was verified before relying on it for Oracle 19c, RAC or Data Guard.
How It Works
The Oracle connector protects table rows, not files. A small agent (a single container) runs inside your network, reads the tables you choose, and sends every new or changed row to ROOTKey as a versioned record. When a row is deleted in Oracle, its record is marked deleted in ROOTKey — it is not removed at once: the record and its whole version history stay and it can be restored, until ROOTKey purges it permanently 3 years after the delete.api.rootkey.ai. The source is public: github.com/ROOT-Key/rootkey-connectors/tree/main/oracle.
ROOTKey’s cyber resilience guarantee covers recovery — not just detection. A hash alone can tell you a row was tampered with; it cannot give you the row back. Each record therefore carries the row’s column values, and every change becomes a new version of that record.
Choosing a Capture Mode
The agent finds changes in one of two ways. You choose with a single setting,CAPTURE_MODE, and you can run different agents in different modes.
rowscn — read-only, nothing to change
Advantages
- Needs only a read-only user. No database setting is touched, no restart, no extra redo.
- Works on any edition and on databases where you are not allowed to change anything.
- Running in minutes: create the user, start the container.
- The user can read the protected tables and nothing else.
- Every poll reads the whole table. On a table with hundreds of millions of rows this is the wrong mode.
- A deleted row leaves nothing to find, so deletes are detected by elimination on the periodic full scan — with a delay of up to
FULL_SCAN_INTERVAL_MINUTES(24 hours by default).
- Reference data, configuration, contracts, master data: tables up to a few million rows.
- Proofs of concept and first deployments.
- Environments where the security policy forbids log-reading privileges.
- A small table inside a very busy database, where reading all the redo would cost more than reading the table.
logminer — for large and busy tables
Advantages
- The cost of a poll follows what changed, not the size of the table. A 100-million-row table with a few thousand changes per minute is cheap to follow.
- Deletes are read from the log as facts and reach ROOTKey within about two poll intervals.
- The table is read in full only once, on the first run.
- Requires
ARCHIVELOGmode and minimal supplemental logging (most production databases already have both, for Data Guard or GoldenGate). - Requires the
LOGMININGprivilege. That user can read the redo of the whole database — every table, in a multitenant database every PDB — not only the protected tables. See Security and blast radius. - LogMiner runs inside the database and uses its CPU and memory while a window is read.
- The first run still reads and sends every row, and this mode does not make that faster. The initial load is bounded by the ROOTKey API, not by Oracle. ROOTKey stores each request of up to 100 records in a single database transaction. In a local test of the API alone (one stream of 100-record requests against a local PostgreSQL 16, with no agent and no network in between) it stored about 1,100–1,200 new or changed rows per second. At that rate the API alone needs about 15 minutes per million rows and about a day per 100 million rows. This is a measurement on one test machine, not a guarantee for production: real throughput depends on your hardware, your network and the width of your rows, and the time the agent needs to read the rows and the round trip to ROOTKey come on top. We have not yet measured a complete initial load through an agent with this version of the API; the previous figure, measured end to end when ROOTKey stored records one at a time, was 50–90 rows per second per agent. Plan the initial load of a very large table with your account team before starting. After the initial load only changed rows are sent.
- The agent keeps one small entry per protected row on local disk: about 150 bytes per row, roughly 15 GB for 100 million rows.
- A transaction left open for hours holds the read position back; every cycle re-reads the redo since its start (nothing is sent twice).
- Ledgers, transactions, movements, audit tables: large tables that are cheap to follow in this mode once loaded. It does not shorten the first load; see the limit above.
- Any table where a delete must be reflected promptly.
- Databases that already run in
ARCHIVELOGwith supplemental logging.
Quick decision guide
Security and Blast Radius
The agent never writes to your database in either mode. What differs is how much it can read, and what it can cost operationally. This section states both plainly, with the controls for each.What each database user can do
Controls for logminer mode
-
Minimum grants, no write access. The mining user gets
CREATE SESSION,LOGMINING,EXECUTEonDBMS_LOGMNRandSELECTon sixV$views. It gets no table privilege at all. The exact script is in the repository (sql/create-logminer-user.sql). -
Audit it. Put the mining user under a Unified Auditing policy, so that every session and every LogMiner call is recorded and you can show what was read and when:
-
Limit its sessions. Give the mining user a profile that caps its sessions and idle time:
-
Resource Manager does not apply to the mining user in a multitenant database. Its session lives in
CDB$ROOT, where a consumer group cannot be created (ORA-65046). Use Resource Manager for the row-reading user inside the PDB, or in a non-multitenant database; it is not available on Express Edition. - Restrict where it logs in from to the host that runs the agent.
-
Identify it. The agent’s sessions carry
MODULE = 'rootkey-oracle-connector'inV$SESSION. -
CONTAINER_DATAdoes not narrow it. In a multitenant database the mining user can read the redo of every PDB. We tested narrowingCONTAINER_DATAto one PDB: views such asGV$TRANSACTIONthen show only that PDB, butV$LOGMNR_CONTENTSstill returned the changes of another PDB. What limits this user is therefore not a grant but the controls on this page: auditing, the session profile, where it may log in from, and the agent’s closed egress.
Controls that apply to both modes
- The agent runs in your infrastructure. Database credentials never leave it. ROOTKey has no access to your database and never receives a credential.
- Close the egress. The agent needs exactly one outbound destination: the ROOTKey API over HTTPS. With egress limited to it, even a compromised agent has nowhere else to send data.
- Only what you list leaves. Only the rows of the configured tables are sent. Columns named in
excludeColumnsare left out of the query itself, not filtered afterwards. - One API key per table. A Connector API Key can only write records into its own ROOTKey table. It cannot read anything and cannot call any other endpoint.
- Hardened container. The example deployment runs as a non-root user with a read-only filesystem and secrets mounted as files.
- Open source. The agent’s code is public and can be audited before it is deployed.
Deletes
A delete is sent as its own operation and ROOTKey marks the record deleted. The record and its history remain and can be restored; ROOTKey purges a deleted record permanently 3 years after the delete. If the same key is inserted again later, it becomes a new live record next to the deleted one.- In
logminermode, eachDELETEis read from the redo log and sent within about two poll intervals. - In
rowscnmode, deletes are found by the periodic full scan: every row it reads is stamped, and the rows ROOTKey holds that were not stamped are gone. SettingFULL_SCAN_INTERVAL_MINUTES=0disables delete detection in this mode.
Mass-delete safety valve
A table that suddenly lost a large share of its rows is far more often an accident — aTRUNCATE, a failed load, a configuration pointing at the wrong schema — than an intent to delete them, and ROOTKey is the recovery copy for exactly that case.
If a full scan finds more than MAX_DELETE_PERCENT (default 20) of a table’s known rows missing, the agent sends no delete, logs rootkey.oracle.mass_delete_suspected and carries on. To confirm the deletions, set MAX_DELETE_PERCENT=100; they are sent by the next full scan. Tables with fewer than 100 known rows are exempt.
The valve applies to deletions inferred by a full scan. Individual DELETE statements read from the redo log in logminer mode are facts and are always sent.
Prerequisites
- Oracle Database 19c or later (single instance or a PDB of a multitenant database). Verified on 21c XE and 23ai Free; see What was verified.
rowscnmode only uses features available since 12.1.0.2. - A ROOTKey table to receive the records, and one connector per Oracle table, created in the dashboard.
- Network access from the agent to the database listener and, outbound over HTTPS, to the ROOTKey API.
- Docker, or Node.js 22.13 or later to run the agent directly.
- A persistent local disk for the agent’s state (about 150 bytes per protected row). Prefer a local SSD over network storage.
- A primary key on each table, or a set of columns that uniquely identifies a row.
logminer mode, additionally:
ARCHIVELOGmode.- Minimal supplemental logging, database-wide. This is not optional: without it Oracle writes some transactions to the redo log in a form LogMiner does not return, and their changes would be missed silently. The agent checks both at startup and refuses to start if either is missing.
- For every protected table with a
CLOB,NCLOBorBLOBcolumn:ALTER TABLE … ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS. Without it nothing is lost, but each change to a large LOB makes the agent read the whole table again (rootkey.oracle.logminer_resync). - Archived logs kept on disk for longer than the agent may be stopped.
- A user allowed to run LogMiner. In a multitenant database this is a common user in
CDB$ROOT.
Setup
1
Create the ROOTKey table and the connector
In the ROOTKey dashboard, create (or choose) a table for each Oracle table you want to protect, then create an Oracle Database connector that points at it. Copy the Connector API Key — it is shown only once.
2
Create the database user
Edit the password and the table list in
sql/create-connector-user.sql and run it as a DBA, connected to the PDB that holds the tables. It creates a user with CREATE SESSION and READ on those tables.For logminer mode, also work through sql/create-logminer-user.sql with your DBA. Read it before running: unlike the default mode, it changes database-level settings.3
Store the secrets as files
644; the secrets directory stays 700, which is what keeps other users of the host away from them. With 600 the agent stops with EACCES: permission denied unless your own uid happens to be 1000.Then list every file you created under secrets: in docker-compose.example.yml, in both places: the service’s secrets: list and the top-level secrets: block. The example file ships with sample names (key_hr_employees, oracle_password); a secret that is not listed there is not mounted, and the agent refuses to start because it cannot read the key.4
Configure the agent
Copy
.env.example to .env and set at least the connection, the tables and the capture mode:5
Start it
6
Verify
Change a row in a protected table and commit:Within one poll interval (
logminer: two) the agent logs a Synced HR.EMPLOYEES … sent=1 line and a new version of record 1042 appears in ROOTKey.Configuration
ORACLE_TABLES is JSON, one entry per table:
The full reference is in the repository README.
Reliability
- At-least-once, no gaps. If anything fails — database unreachable, API down, agent killed mid-scan — the position stays put and the next poll starts from it again.
- Idempotent. A row re-sent with the same content is a no-op in ROOTKey, and so is a delete of a key that is unknown or already deleted. Replaying a batch changes nothing.
- A request is all-or-nothing. ROOTKey applies the records of a request in one transaction. If it refuses the request (
400for an invalid record, naming its position in the request;429quota;410table deleted or paused;503lock wait), nothing of that request is stored, and the same request can be sent again as it is. Each record still gets its own version and its own audit entries. - A rejected record does not block the table. The agent splits a refused batch in half, again and again, to isolate the record ROOTKey will not take, delivers the rest, and writes the rejected one to a dead-letter file. It is offered again the next time the row is read.
- A redo-log gap is repaired, not ignored (
logminer). If the log files for the next window are gone, the agent logsrootkey.oracle.logminer_gap, reads every table again and resumes mining from there.
Limitations
- Intermediate versions can be skipped. If a row changes three times between two polls, ROOTKey receives the last state only, in both modes. A row inserted and deleted between two polls is never sent. Lower
POLL_INTERVAL_SECONDSfor finer granularity. - Tables only. Views, external tables and tables without a usable key are not supported.
- Limits of a record. A row beyond them is written to the dead-letter file, never truncated:
- at most 100 columns (list the ones to leave out in
excludeColumns); - at most 65,536 bytes in any single value — a
CLOBabove 64 KB, or aBLOBabove about 48 KB; - at most 1 MB for the whole record.
- at most 100 columns (list the ones to leave out in
- Limit of a request. The API refuses a request larger than 5 MB (
413), whatever the number of records in it. The agent keeps its requests below that and splits a batch by itself, so there is nothing to configure; with very wide rows, expect fewer than 100 records per request. - A schema change re-versions the table. Adding or dropping a column changes every row, so every row is sent once more as a new version.
- Do not change the key of a protected table. ROOTKey identifies a record by its key; changing
keyColumnswould make every row a new record. - One agent per state directory.
- Usage and initial load. Every stored version counts towards your plan’s records quota, and every request towards its API quota. The initial load of a large table can take many hours or days, depending on your hardware and network (see the estimate and its limits under Capture modes above), so plan it with your account team before starting.
Columns that are not sent
The agent sends a column only if it can render its value as text in a form that is the same on every machine. In every case below the rest of the row is still protected, and the agent logsrootkey.oracle.column_skipped with the column’s name.
If the content of such a column must be protected, it has to exist in a supported type (for XML or JSON documents, a
CLOB).
Observability
The agent logs to stdout/stderr. Use these stable log markers for alerting:What Was Verified, and What Was Not
Verified against real multitenant Oracle databases — Oracle Database 21c Express Edition and Oracle Database 23ai Free (it reports itself as 26ai Free, 23.26.4) — in both capture modes: the initial load; inserts, updates and deletes with single and composite keys; anUPDATE that changes a primary-key value; LOB columns; a delete followed by a re-insert of the same key; transactions open across several cycles; rollbacks; an API outage in the middle of a cycle; archived logs removed while the agent was down; TRUNCATE and ALTER TABLE … MOVE; delete detection and the mass-delete safety valve in rowscn mode; a table with reserved column names; the example Docker Compose deployment (21c XE); and the mining user under the audit policy and profile shown above (23ai Free).
Not verified — test these in your own environment first:
- Oracle 19c itself, RAC, ASM, and Data Guard (including running LogMiner on a standby instead of the primary). No 19c environment was available to us; 21c XE and 23ai Free are not 19c.
- A non-multitenant database: every test database was a CDB.
logminer mode too (for example FULL_SCAN_INTERVAL_MINUTES=10080 for weekly).
Troubleshooting
Nothing arrives in ROOTKey
Nothing arrives in ROOTKey
Read the agent’s log first: every failure mode has a marker from the table above, with the Oracle or API error in the line.
rootkey.connector.fatal means the key is wrong, belongs to a connector of another type, or the ROOTKey table was deleted or paused.table not found or not readable
table not found or not readable
The
READ grant is missing, or the name’s case does not match. Use the JSON form of ORACLE_TABLES for case-sensitive names.CAPTURE_MODE=logminer cannot be used
CAPTURE_MODE=logminer cannot be used
The database is not in
ARCHIVELOG mode or minimal supplemental logging is off. See sql/create-logminer-user.sql.ORA-01031 or ORA-00942 in logminer mode
ORA-01031 or ORA-00942 in logminer mode
A grant from
create-logminer-user.sql is missing, or (multitenant) ORACLE_LOGMINER_CONNECT_STRING points at the PDB instead of the root container.ORA-01555 during a scan
ORA-01555 during a scan
The scan runs longer than the undo retention allows. Raise
UNDO_RETENTION, or move the table to logminer mode.Deletes do not show up
Deletes do not show up
In
rowscn mode deletes appear after the next full scan (FULL_SCAN_INTERVAL_MINUTES). If the log shows rootkey.oracle.mass_delete_suspected, the safety valve held them back: see Mass-delete safety valve.