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.03k stars 341 forks source link

EXCLUDE does not exclude SEQUENCE and TYPE objects #1839

Open taneraruk opened 2 weeks ago

taneraruk commented 2 weeks ago

Hi,

I am running a test count with this command,

ora2pg -t TEST --count_rows -c ora2pg_test.conf

In config file I exclude a couple of sequences and types like this,

ALLOW   ABC_.*,  DEF_.*
EXCLUDE SEQUENCE GHI_.*
EXCLUDE TYPE JKL, MNL

ALLOW works properly for tables but EXCLUDE does not filter SEQUENCE and TYPE objects.

Environment,

ora2pg Version: 24.1
PostgreSQL Version: 15
Oracle Client Version: 12.2
OS: Openshift Linux
darold commented 2 weeks ago

If ALLOW is set, EXCLUDE is not taken in account.

About sequences and types, how about:

EXCLUDE SEQUENCE[GHI_.*];TYPE [JKL MNL]
taneraruk commented 2 weeks ago

I have removed ALLOW and kept only EXCLUDE but none of the combination below worked, seems EXCLUDE only filters tables, neither sequences nor types.

EXCLUDE SEQUENCE[GHI_.*];TYPE [JKL MNL]
EXCLUDE SEQUENCE[GHI_.*],TYPE [JKL MNL]
EXCLUDE SEQUENCE[GHI_.*] TYPE [JKL MNL]
EXCLUDE SEQUENCE[GHI_.*]
EXCLUDE TYPE [JKL MNL]
darold commented 1 week ago

This work just perfectly with me:

EXCLUDE         TYPE[LANGUAGE_T LANGUAGES_T];SEQUENCE[ADDRESS.* FILM.*]

On your setting there is an extra space after TYPE this can be the cause of the problem.

taneraruk commented 6 days ago

this is what exactly my configuration, without ALLOW, and space. Only table is being filtered but sequence and type not.

EXCLUDE TABLE[GDW_.*];SEQUENCE[MDRS_.*];TYPE[ENTITY_VALUE_LIST_TYPE ATTRIBUTE_LIST_TYPE]

This worked for table and type but not sequence

EXCLUDE TABLE[GDW_.*]
EXCLUDE SEQUENCE[MDRS_.*]
EXCLUDE TYPE[ENTITY_VALUE_LIST_TYPE ATTRIBUTE_LIST_TYPE]

During the test count, it does not count the sequence values as well. The problem is with sequences.

The sequence names starts with MDRS_, contains $ sign (MDRS_9A9FC$, MDRS_9AFD$), that might cause the problem? *Btw tested with EXPORT_INVALID parameters with enabled and disabled status.