# cybertec-postgresql/ora_migrator architecture

> Architecture diagram of the GitHub repository cybertec-postgresql/ora_migrator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cybertec-postgresql/ora_migrator
- Repository: https://github.com/cybertec-postgresql/ora_migrator

## Overview

ora_migrator is a PostgreSQL extension that adds Oracle-specific migration support to db_migrator, using oracle_fdw to access Oracle. The principal workflow is to prepare migration stages, create Oracle metadata foreign tables, check and clean problematic source data, then migrate tables; replication supports near-zero-downtime migration. The README documents these capabilities, but no source excerpts were provided, so implementation nodes share the extension SQL file and relationships are limited to those explicitly described in the README.

Main entry points: [`ora_migrator--1.1.0.sql`](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql) (Metadata views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_migration["Migration support"]
  node_callbacks["Migration callbacks"]
  node_migration_stages["Migration stages"]
end

subgraph group_metadata["Oracle metadata"]
  node_metadata_views["Metadata views"]
  node_package_source["Package source"]
  node_segment_info["Segment information"]
  node_cost_estimate["Cost estimates"]
  node_table_comments["Table comments"]
  node_column_comments["Column comments"]
end

subgraph group_validation["Data validation"]
  node_table_test["Table data test"]
  node_bulk_test["Migration data test"]
  node_test_errors[("Test error records")]
  node_error_stats[("Error summaries")]
end

subgraph group_replication["Replication"]
  node_replication_start["Replication setup"]
  node_replication_objects[("Replication objects")]
end

node_operator(("Migration operator"))
node_dbm["db_migrator"]
node_fdw["oracle_fdw"]
node_oracle[("Oracle database")]
node_postgres[("PostgreSQL database")]

node_operator -->|"runs migration"| node_dbm
node_dbm -->|"requests callbacks"| node_callbacks
node_dbm -->|"prepares and migrates"| node_migration_stages
node_operator -->|"creates views"| node_metadata_views
node_metadata_views -->|"creates foreign tables"| node_fdw
node_fdw -->|"accesses"| node_oracle
node_metadata_views -->|"exposes"| node_package_source
node_metadata_views -->|"exposes"| node_segment_info
node_metadata_views -->|"exposes"| node_cost_estimate
node_metadata_views -->|"exposes"| node_table_comments
node_metadata_views -->|"exposes"| node_column_comments
node_operator -->|"tests after preparation"| node_table_test
node_table_test -->|"tests Oracle rows"| node_fdw
node_operator -->|"runs data checks"| node_bulk_test
node_bulk_test -->|"checks each table"| node_table_test
node_bulk_test -->|"records results"| node_test_errors
node_bulk_test -->|"records summary"| node_error_stats
node_test_errors -->|"stored in FDW stage"| node_fdw
node_error_stats -->|"stored in FDW stage"| node_fdw
node_operator -->|"starts replication"| node_replication_start
node_replication_start -->|"creates Oracle objects"| node_oracle
node_replication_start -->|"creates PostgreSQL objects"| node_postgres
node_replication_start -->|"creates"| node_replication_objects
node_replication_objects -->|"supports table migration"| node_migration_stages

click node_callbacks "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_migration_stages "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_metadata_views "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_package_source "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_segment_info "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_cost_estimate "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_table_comments "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_column_comments "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_table_test "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_bulk_test "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_test_errors "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_error_stats "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_replication_start "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"
click node_replication_objects "https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_callbacks,node_migration_stages toneBlue
class node_metadata_views,node_package_source,node_segment_info,node_cost_estimate,node_table_comments,node_column_comments,node_oracle,node_postgres toneAmber
class node_table_test,node_bulk_test,node_test_errors,node_error_stats toneMint
class node_replication_start,node_replication_objects toneRose
class node_operator,node_dbm,node_fdw toneIndigo
```

## Components

### Migration support

- [Migration callbacks](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Migration stages](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`

### Oracle metadata

- [Metadata views](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Package source](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Segment information](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Cost estimates](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Table comments](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Column comments](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`

### Data validation

- [Table data test](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Migration data test](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Test error records](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Error summaries](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`

### Replication

- [Replication setup](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`
- [Replication objects](https://github.com/cybertec-postgresql/ora_migrator/blob/master/ora_migrator--1.1.0.sql): `ora_migrator--1.1.0.sql`

### Other components

- **Migration operator**
- **db_migrator**
- **oracle_fdw**
- **Oracle database**
- **PostgreSQL database**

## Connections

- Migration operator → db_migrator: runs migration
- db_migrator → Migration callbacks: requests callbacks
- db_migrator → Migration stages: prepares and migrates
- Migration operator → Metadata views: creates views
- Metadata views → oracle_fdw: creates foreign tables
- oracle_fdw → Oracle database: accesses
- Metadata views → Package source: exposes
- Metadata views → Segment information: exposes
- Metadata views → Cost estimates: exposes
- Metadata views → Table comments: exposes
- Metadata views → Column comments: exposes
- Migration operator → Table data test: tests after preparation
- Table data test → oracle_fdw: tests Oracle rows
- Migration operator → Migration data test: runs data checks
- Migration data test → Table data test: checks each table
- Migration data test → Test error records: records results
- Migration data test → Error summaries: records summary
- Test error records → oracle_fdw: stored in FDW stage
- Error summaries → oracle_fdw: stored in FDW stage
- Migration operator → Replication setup: starts replication
- Replication setup → Oracle database: creates Oracle objects
- Replication setup → PostgreSQL database: creates PostgreSQL objects
- Replication setup → Replication objects: creates
- Replication objects → Migration stages: supports table migration
