Skip to content

Instantly share code, notes, and snippets.

@fortran01
Last active October 3, 2023 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fortran01/e34a2dfe6961fdb0f6884135d4dba051 to your computer and use it in GitHub Desktop.
Save fortran01/e34a2dfe6961fdb0f6884135d4dba051 to your computer and use it in GitHub Desktop.
Sample CSV report from `docker run --name ora2pg -it --rm -v /home/ubuntu/ora2pg/config:/config -v /home/ubuntu/ora2pg/data:/data ora2pg ora2pg -t SHOW_REPORT --estimate_cost --cost_unit_value 10 --dump_as_csv -c /config/ora2pg.conf`
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 1 column, instead of 6. in line 4.
Object;Number;Invalid;Estimated cost;Comments
DATABASE LINK;0;0;0.00;Database links will be exported as SQL/MED PostgreSQL's Foreign Data Wrapper (FDW) extensions using oracle_fdw.
FUNCTION;5;0;54.60;Total size of function code: 8853 bytes.
GLOBAL TEMPORARY TABLE;0;0;0.00;Global temporary table are not supported by PostgreSQL and will not be exported. You will have to rewrite some application code to match the PostgreSQL temporary table behavior.
INDEX;8;0;1.00;0 index(es) are concerned by the export, others are automatically generated and will do so on PostgreSQL. Bitmap will be exported as btree_gin index(es). Domain index are exported as b-tree but commented to be edited to mainly use FTS. Cluster, bitmap join and IOT indexes will not be exported at all. Reverse indexes are not exported too, you may use a trigram-based index (see pg_trgm) or a reverse() function based index and search. Use 'varchar_pattern_ops', 'text_pattern_ops' or 'bpchar_pattern_ops' operators in your indexes to improve search with the LIKE operator respectively into varchar, text or char columns.
JOB;0;0;0.00;Job are not exported. You may set external cron job with them.
PACKAGE BODY;19;0;114.00;Total size of package code: 46323 bytes. Number of procedures and functions found inside those packages: 0.
PROCEDURE;14;0;56.00;Total size of procedure code: 0 bytes.
SYNONYM;1;0;1.00;SYNONYMs will be exported as views. SYNONYMs do not exists with PostgreSQL but a common workaround is to use views or set the PostgreSQL search_path in your session to access object outside the current schema.
TABLE;15;0;2.30;1 external table(s) will be exported as file_fdw foreign table. See EXTERNAL_TO_FDW configuration directive to export as standard table or use COPY in your code if you just want to load data from external files. 8 check constraint(s).
TRIGGER;6;0;15.00;Total size of trigger code: 0 bytes.
TYPE;5;0;5.00;5 type(s) are concerned by the export, others are not supported. Note that Type inherited and Subtype are converted as table, type inheritance is not supported.
VIEW;1;0;1.00;Views are fully supported but can use specific functions.
@fortran01
Copy link
Author

docker run --name ora2pg -it --rm -v /home/ubuntu/ora2pg/config:/config -v /home/ubuntu/ora2pg/data:/data ora2pg ora2pg -t SHOW_REPORT --estimate_cost --cost_unit_value 10 --dump_as_csv -c /config/ora2pg.conf

@fortran01
Copy link
Author

Dockerfile is here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment