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
1.01k stars 342 forks source link

An option to unset "check_function_bodies = false;" when not using the .conf file? #1541

Closed markeuzebio closed 1 year ago

markeuzebio commented 1 year ago

Hey! I hope you are fine.

Well... I have been making some tests getting the objects' DDL from the Oracle database and trying to convert these through the terminal straightforward, without needing the .conf file.

I've got a .sh script which makes this whole conversion for me. It gets everything from a certain type of object (e.g: PROCEDURE) on the Oracle database and converts it to the PostgreSQL equivalent using Ora2Pg.

The exact point it happens (the conversion) is: ora2pg -i /tmp/oracle_script.sql -b /tmp/user/PROCEDURE -o NAME_OF_PROCEDURE.sql -t PROCEDURE

It turns out that everytime the equivalent in created, the option SET check_function_bodies = false; is added right at the top of the file generated. I looked for something on the documentation that'd possibly turn this statement off, but I found nothing related to this but disabling the FUNCTION_CHECK directive in .conf file.

It could be easily gotten around by using replacement that sed Linux command provides. But I wonder if there is something inside the Ora2Pg options that could turn that statement off.

Thanks for your time and all the work done until now!

darold commented 1 year ago

Hi, you should use a default configuration file, there are already a lot of command line options. If you don't want to use a default config file then as you said sed can help.