Skip to content

C2Oracle

Bob Vawter edited this page Aug 28, 2024 · 16 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:
  • 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. Production 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.

Arm Mac notes

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

There are now Oracle Instant Client libraries for Arm-based macs. Copy the shared library files to $HOME/oic/lib and set ORACLE_HOME=$HOME/oic when running Replicator commands or tests. The library files must be in $ORACLE_HOME/lib.

Add TEST_TARGET_CONNECT=oracle://system:[email protected]:1521/XEPDB1 to your environment variables when running tests locally.

Clone this wiki locally