Skip to main content

Oracle 11g Adapter

1. config.toml Explanation

1.1 Example of configs/config.toml

[gravity]
domain = "default"
host = "0.0.0.0"
port = 4222
pingInterval = 10
maxPingsOutstanding = 3
maxReconnects = -1
accessToken = ""
publishBatchSize = 1000
rateLimit = 0

[source]
config = "./settings/sources.json"

[store]
enabled = false
path = "./statestore"

1.2 Parameters

ParameterDescription
gravity.domainSets the Gravity domain
gravity.hostSets the Gravity NATS IP address
gravity.portSets the Gravity NATS port
gravity.pingIntervalSets the Gravity ping interval
gravity.maxPingsOutstandingSets the maximum outstanding pings
gravity.maxReconnectsSets the maximum number of reconnections
gravity.accessTokenSets the Gravity access token (for authentication)
gravity.publishBatchSizeSets the batch size for events sent to NATS
gravity.rateLimitSets the maximum rate (per second) for events sent to NATS (0 = no limit)
source.configPath to the source configuration file
store.enabledEnables persistent volume mounting (for state storage)
store.pathPath for mounting the persistent volume

INFO

The config.toml settings can also be provided via environment variables. The naming convention is as follows:

GRAVITY_ADAPTER_ORACLE_[SECTION]_[KEY]

All letters are uppercase, and underscores (_) separate the sections and keys.
Example for gravity.host:

env:
- name: GRAVITY_ADAPTER_ORACLE_GRAVITY_HOST
value: 192.168.0.1

2. settings.json Explanation

2.1 Example of settings/sources.json

{
"sources": {
"myoracle11g": {
"disabled": false,
"host": "172.17.0.1",
"port": 1521,
"username": "logminer",
"password": "logminer",
"dbname": "XE",
"mode": "logminer",
"initialLoad": true,
"initialLoadBatchSize": 100000,
"interval": 1,
"tables": {
"gravity.account": {
"events": {
"snapshot": "accountInitialized",
"create": "accountCreated",
"update": "accountUpdated",
"delete": "accountDeleted"
}
}
}
}
}
}

2.2 Parameters

ParameterDescription
sources.SOURCE_NAME.disabledWhether to disable this source
sources.SOURCE_NAME.hostSets the Oracle server IP address
sources.SOURCE_NAME.portSets the Oracle server port
sources.SOURCE_NAME.usernameSets the Oracle login username
sources.SOURCE_NAME.passwordSets the Oracle login password
sources.SOURCE_NAME.dbnameSets the Oracle database name
sources.SOURCE_NAME.pdbNameSets the Oracle PDB name (not required for 11g)
sources.SOURCE_NAME.modeSets the mode (logminer or batch)
sources.SOURCE_NAME.initialLoadWhether to synchronize existing records during initialization
sources.SOURCE_NAME.initialLoadBatchSizeNumber of records per batch during initial load
sources.SOURCE_NAME.intervalSynchronization interval for initial load events (in seconds)
sources.SOURCE_NAME.tables.TABLE_NAME.event.createEvent name for record creation
sources.SOURCE_NAME.tables.TABLE_NAME.event.updateEvent name for record updates
sources.SOURCE_NAME.tables.TABLE_NAME.event.deleteEvent name for record deletion

INFO

The database password can be provided via environment variables using AES encryption.
Environment variable format:

[SOURCE_NAME]_PASSWORD

If both the environment variable and settings.json specify a password, the environment variable takes precedence.
Example:

env:
- name: MYORACLE_PASSWORD
value: f737540b75550a17af98cd3e640f61fd

3. Build

To build the adapter image, use the following command:

podman buildx build --platform linux/amd64 --build-arg="AES_KEY=**********" -t hb.k8sbridge.com/gravity/gravity-adapter-oracle:v4.0.21 -f build/docker/Dockerfile .