Skip to content

C2Oracle

Bob Vawter edited this page May 14, 2024 · 14 revisions

CockroachDB to Oracle

Replicator can replicate a CockroachDB changefeed into an Oracle Database. The discussion in C2C applies, with the following notes:

  • A separate CockroachDB instance must be used for staging, since Replicator relies on CockroachDB's transaction model for correctness when staging and applying mutations in transactionally-consistent modes.
  • The identifier case-mismatch between CockroachDB schemas (lower-cased names) and Oracle DB schemas (upper-cased names) is accounted for by Replicator's case-insensitive, but preserving behavior.
  • Not all CockroachDB datatypes have a direct analog in Oracle Database.
  • The replicator start flags would include two database connection strings:
    • --stagingConn 'postgres://staging.db:26257/....'
    • --targetConn 'oracle://user:pass@127.0.0.1:1521/XEPDB1' (say, if using an Express Edition container)
  • The destination changefeed URL would have only a single path element, webhook-https://replicator.service/TARGET_SCHEMA?insecure_tls_skip_verify=true

Operational notes

  • Support for Oracle Database requires the native Oracle Instant Client libraries. Note also that the native libraries depend upon libaio1, which is available from most distribution's package managers.
  • A Docker image with native library support is available via docker pull cockroachdb/replicator:oracle-master

Development notes

Pass -tags target_oracle to any go commands used. Support is currently limited to linux/amd64 builds. Arm native libraries are available if the need arises and the CI system would need to be updated to support cross-compilation.

The Oracle Database docker images require a 64-bit CPU op-mode. This isn't currently supported by Docker Desktop on M-series processors. Instead, use colima as your virtualization frontend and qemu as the backend.

brew install colima
colima start --arch x86_64 --cpu 6 --memory 8 --vm-type=qemu
docker run -it --rm --platform=linux/amd64 opensuse/leap:15.4
# lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit

Add TEST_TARGET_CONNECT=oracle://system:SoupOrSecret@127.0.0.1:1521/XEPDB1 to your environment variables when running tests locally.

Clone this wiki locally