darold / ora2pg

Ora2Pg is a free tool used to migrate an Oracle database to a PostgreSQL compatible schema. It connects your Oracle database, scan it automatically and extracts its structure or data, it then generates SQL scripts that you can load into PostgreSQL.
http://www.ora2pg.com/
GNU General Public License v3.0
978 stars 341 forks source link

COPY sql file does not reference content sql file #1659

Closed leutenmayr closed 11 months ago

leutenmayr commented 11 months ago

Hi,

I am trying to tune ora2pg for speed, so I am looking into parameters like jobs, parallel_tables, oracle_copies. First, I worked with parallel_tables = 30, for utilizing all cpus. This worked well and created separate files for each table. Conveniently, the files were all referenced in the COPY_ora2pgoutput.sql file. When using oracle_copies = 30, each table is split into parts which are then extracted in parallel. The output is then written to a single file ora2pgoutput.sql. However, this file is not referenced in the COPY_ora2pgoutput.sql. There the content is BEGIN;

SET client_encoding TO 'UTF8'; SET synchronous_commit TO off;

COMMIT;

and thus nothing gets imported. How would I need to reference the file?

Thanks in advance!

Stephan

darold commented 11 months ago

I'm not sure to understand the problem. You should have FILE_PER_TABLE enabled then each table data will go to a dedicated file. For a better speed you should import everything in PostgreSQL directly using the PG_DSN configuration directive.

leutenmayr commented 11 months ago

Thanks for your response. I activated FILE_PER_TABLE and now separate files are generated which are referenced in the main COPY file. So this should work then. I will also look into the PG_DSN for direct migration to PostgreSQL. Thanks for the tip!