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.
| # | Phase | Notes |
|---|---|---|
| 01 | Schemas + roles + grants | Empty containers and authorization in advance of any object. |
| 02 | Sequences | Created before tables that depend on them. |
| 03 | Types + composite types | Including OBJECT and TABLE OF mappings. |
| 04 | Tables (DDL only) | Without FK constraints (added in Phase 14). |
| 05 | Compatibility extensions | orafce, plus Trekport-bundled adapters. |
| 06 | Standalone functions and procedures | Resolved in dependency order via call-graph analysis. |
| 07 | Package signatures | Header-only first, so cross-package refs resolve. |
| 08 | Package bodies | Implementations attached after all signatures exist. |
| 09 | Views (with retry pass) | Multi-pass to resolve view-on-view chains. |
| 10 | Materialized views | After views, since MVs commonly depend on them. |
| 11 | Triggers (statement, row, compound) | After all callable objects exist. |
| 12 | Indexes | Including functional and partial indexes. |
| 13 | Synonyms (public + private) | Implemented as views or search_path entries. |
| 14 | Foreign keys + check constraints | Final 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 type | PostgreSQL target | Notes |
|---|---|---|
| NUMBER | numeric / int / bigint / boolean | Precision 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 |
| DATE | timestamp | Oracle DATE includes time |
| TIMESTAMP | timestamp / timestamptz | WITH TIME ZONE preserved |
| INTERVAL YEAR TO MONTH / DAY TO SECOND | interval | Native PG interval |
| CLOB | text | PG text is unbounded |
| NCLOB | text | UTF-8 in PG |
| BLOB | bytea | Binary preserved |
| RAW(n) | bytea | Length informational only in PG |
| XMLTYPE | xml | Native PG xml type with parsing |
| ROWID / UROWID | ctid + sequence-backed PK | Application-level pattern preserved |
| SDO_GEOMETRY | geometry (PostGIS) | PostGIS install required at target |
| BFILE | text + filesystem ref | External-LOB pattern |
| REF / OBJECT / TABLE OF | composite type / array | Mapped 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.
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.