Docs

The technical reference for
Trekport Studio.

Architecture, the 14-phase deployment, PL/SQL to PL/pgSQL coverage, data-type mappings, and the orafce compatibility layer. Built so a DBA can audit every conversion choice.

Architecture

Trekport Studio is a Tauri desktop app that embeds a Python conversion engine. The engine extracts your Oracle catalog, parses every DDL and PL/SQL object into an abstract syntax tree, transforms the tree, and emits PostgreSQL DDL plus PL/pgSQL. A separate deployer applies the output to your target database in 14 dependency-ordered phases. Validation runs after each phase.

Engine (Python)

Catalog extractor, AST converter, dependency analyzer, output writer. Runs locally. No network calls beyond the Oracle source and Postgres target.

Deployer (Python)

14-phase orchestrator with retry logic, transaction management, and per-phase validation. Idempotent: failed phases can be re-run without manual cleanup.

Data transfer (Python + Postgres COPY)

Parallel COPY for non-temporal tables, batched INSERT for temporal columns, backpressure-aware channel pipeline. Scales to multi-terabyte estates.

Validator

Row counts, type checks, constraint checks, function smoke tests. Exportable to HTML and PDF migration reports for sign-off.

The 14-phase deployment

Most migration tools deploy objects in catalog order and fail on the first dependency loop. Trekport resolves dependencies upfront and deploys in this exact sequence. Each phase is transactional and retryable.

#PhaseNotes
01Schemas + roles + grantsEmpty containers and authorization in advance of any object.
02SequencesCreated before tables that depend on them.
03Types + composite typesIncluding OBJECT and TABLE OF mappings.
04Tables (DDL only)Without FK constraints (added in Phase 14).
05Compatibility extensionsorafce, plus Trekport-bundled adapters.
06Standalone functions and proceduresResolved in dependency order via call-graph analysis.
07Package signaturesHeader-only first, so cross-package refs resolve.
08Package bodiesImplementations attached after all signatures exist.
09Views (with retry pass)Multi-pass to resolve view-on-view chains.
10Materialized viewsAfter views, since MVs commonly depend on them.
11Triggers (statement, row, compound)After all callable objects exist.
12IndexesIncluding functional and partial indexes.
13Synonyms (public + private)Implemented as views or search_path entries.
14Foreign keys + check constraintsFinal pass to enable referential integrity.

Oracle data-type mappings

Every Oracle scalar, LOB, and complex type Trekport supports, with the chosen Postgres target. Mappings are configurable via per-column overrides on the Enterprise tier.

Oracle typePostgreSQL targetNotes
NUMBERnumeric / int / bigint / booleanPrecision and scale drive the target type
VARCHAR2(n)varchar(n)Char-semantics preserved
NVARCHAR2(n)varchar(n)UTF-8 in PG
CHAR(n)char(n)Padding behavior preserved
DATEtimestampOracle DATE includes time
TIMESTAMPtimestamp / timestamptzWITH TIME ZONE preserved
INTERVAL YEAR TO MONTH / DAY TO SECONDintervalNative PG interval
CLOBtextPG text is unbounded
NCLOBtextUTF-8 in PG
BLOBbyteaBinary preserved
RAW(n)byteaLength informational only in PG
XMLTYPExmlNative PG xml type with parsing
ROWID / UROWIDctid + sequence-backed PKApplication-level pattern preserved
SDO_GEOMETRYgeometry (PostGIS)PostGIS install required at target
BFILEtext + filesystem refExternal-LOB pattern
REF / OBJECT / TABLE OFcomposite type / arrayMapped via PG composite type system

PL/SQL coverage

What Trekport translates from PL/SQL to PL/pgSQL. Items marked partial may be flagged in the migration report for human review.

PROCEDURE / FUNCTION (standalone)Supported
PACKAGE SPEC + BODYSupported
Compound triggers (BEFORE/AFTER STATEMENT)Supported
Row-level + statement-level triggersSupported
Cursors (implicit + explicit)Supported
Cursor variables (REF CURSOR)Supported
Exception handling (named + WHEN OTHERS)Supported
RAISE_APPLICATION_ERRORSupported
FORALL + BULK COLLECTSupported
Pipelined functionsSupported
MERGE / UPSERTSupported
Autonomous transactions (PRAGMA AUTONOMOUS_TRANSACTION)Partial
DBMS_OUTPUT, DBMS_LOB, DBMS_SQLSupported
UTL_FILE, UTL_HTTPPartial
Object types + methodsSupported
Records + collections (associative arrays)Supported
Hierarchical queries (CONNECT BY)Supported
Analytic / window functionsSupported
Hints (/*+ ... */)Partial
DBLINKPartial

Compatibility extensions

Where PostgreSQL does not natively support an Oracle construct, Trekport ships verified extensions so converted code runs unmodified.

orafce

The standard open-source Oracle compatibility layer. Provides DECODE, NVL, NVL2, NULLIF, SYSDATE, MONTHS_BETWEEN, ADD_MONTHS, INSTR, TO_CHAR/TO_NUMBER/TO_DATE oddities, plus DBMS_OUTPUT, DBMS_LOB, DBMS_SQL, DBMS_PIPE, UTL_FILE wrappers, and Oracle-style date arithmetic.

trekport-oracle-compat (bundled)

A Trekport-maintained extension covering Oracle constructs orafce omits or partially handles: SYS_GUID, USERENV, DBMS_RANDOM, CONNECT_BY_ROOT path semantics, REGEXP_SUBSTR with custom flags, and a few enterprise-specific wrappers we have generalized.

postgis (when SDO_GEOMETRY present)

Trekport detects SDO_GEOMETRY columns at extraction, requires PostGIS at the target, and converts geometry columns plus spatial indexes.

pg_trgm + btree_gin (when applicable)

Installed when Trekport detects function-based or trigram indexes at the source, so search behavior matches post-migration.

A typical session, end to end

# 1. Open Trekport Studio. Create a project. Connect Oracle source.
# 2. Run extraction. The local catalog mirror appears under ./catalog/.
trekport extract \
  --source oracle://hr@oracle.internal:1521/HR \
  --output ./catalog

# 3. Run conversion. Output appears under ./converted/, mirroring ./catalog/ 1:1.
trekport convert \
  --input ./catalog \
  --output ./converted \
  --report ./reports/conversion.html

# 4. Deploy to PostgreSQL target. 14 phases, dependency-ordered.
trekport deploy \
  --converted ./converted \
  --target postgres://hr@pg.internal:5432/hr_target \
  --phases all \
  --extensions orafce,trekport-oracle-compat

# 5. Transfer data. Parallel COPY, backpressure-aware.
trekport transfer-data \
  --source oracle://hr@oracle.internal:1521/HR \
  --target postgres://hr@pg.internal:5432/hr_target \
  --parallelism 8 \
  --validate

# 6. Final validation report. Row counts, type checks, constraint checks.
trekport validate \
  --source oracle://hr@oracle.internal:1521/HR \
  --target postgres://hr@pg.internal:5432/hr_target \
  --output ./reports/validation.html

Need deeper docs?

The full reference, including configuration options, hooks for custom type overrides, and per-extension setup, lives on GitHub. Talk to us if your estate has unusual constructs.