check_orapg
check_orapg · Validate Oracle-to-PostgreSQL or EDB migrations by comparing database objects, privileges, attributes, comments, and row counts.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100525 | check_orapg | check_orapg | 3.0 | ETL | Unknown | SQL |
PostgreSQL · 11, 12, 13
| Relationships | |
|---|---|
| Requires | oracle_fdw plpgsql |
Usage
Sources:
check_orapg 3.0 helps validate an Oracle-to-PostgreSQL or Oracle-to-EDB migration. It copies selected Oracle catalog information through oracle_fdw, counts objects, privileges, attributes, comments, and table rows on both sides, and emits two text reports for external comparison. It reports migration coverage; it does not convert schemas or prove application-level equivalence.
Core Workflow
The control file requires oracle_fdw, marks installation as superuser-only, and records testing only on PostgreSQL 11–13 and EDB Postgres 11–13. Install Oracle client libraries and configure oracle_fdw before creating check_orapg.
After importing the Oracle catalogs, refresh them with check_orapg.update_all_oracle_tables, register both snapshots with check_orapg.register_postgres_validation and check_orapg.register_oracle_validation, then compare the rows returned by check_orapg.postgres_file and check_orapg.oracle_file. The generate_postgres_file and generate_oracle_file variants write those reports to the database server filesystem.
Important Objects
- Server and mapping helpers:
create_oracle_server,update_server,show_servers,create_user,update_user_password, andshow_users. - Oracle catalog refresh:
create_oracle_tables,update_all_oracle_tables,update_oracle_table, andupdate_oracle_tables_rows. - Comparisons:
cluster_postgres,cluster_oracle, privilege reports, schema object reports, and row-count reports. - Persistent results: 31 imported Oracle catalog tables plus
postgres_validationandoracle_validationin schemacheck_orapg.
Security and Accuracy Boundaries
create_user creates a user mapping for PUBLIC, not just the caller, and the password is supplied as function text and stored in foreign-server metadata. The SQL also constructs dynamic DDL from identifiers and credentials without robust quoting. Restrict all management functions to a tightly controlled administrative role and use a read-only Oracle account.
The file generators use server-side COPY and can write only where the PostgreSQL operating-system account has permission. Output paths are server paths. Counts can differ legitimately because PostgreSQL does not implement Oracle packages or synonyms and because object definitions, data values, constraints, and behavior are not compared. Review the generated reports as migration evidence, not as a pass/fail proof.