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

TEST_DATA : ERROR: ORA-00911: caractère non valide #1841

Open did16 opened 1 week ago

did16 commented 1 week ago

Hi After completing the migration from Oracle 19 to PostgreSQL 15, I want to compare the data between the source Oracle database and the target PostgreSQL database. For this, I specified "TYPE TEST_DATA" in the ora2pg.conf file. I get the following error message :

ERROR: ORA-00911: caractère non valide (DBD ERROR: error possibly near <> indicator at char 211 in 'SELECT "CODE_PARAM_TRAIT_CAT","CODE_TYP_PARAM","CODE_TRAIT_CAT","CODE_ENTR_CAT","CODE_SORT_CAT","NUM_LOI","ID_MATRICE_CAT","ORDRE_PARAM","LIB_PARAM_TRAIT_CAT","DESC_PARAM" FROM "CTR"."PARAM_TRAIT_CAT" a WHERE (1<>=1 # Apply to all tables) ORDER BY 1 FETCH FIRST 10000 ROWS ONLY') Can't call method "execute" on an undefined value at /usr/local/share/perl5/Ora2Pg.pm line 21376. Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Oracle::db handle (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=XXXXXX))(CONNECT_DATA=(SID=CTRNAT))) at /usr/local/share/perl5/Ora2Pg.pm line 21376. Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Oracle::db handle (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=XXXXXXX))(CONNECT_DATA=(SID=CTRNAT))) at /usr/local/share/perl5/Ora2Pg.pm line 21376. is this a bug ?

Ora2Pg v24.1 <<

darold commented 1 week ago

Please upgrade to latest development code this have been fixed normally.

did16 commented 1 week ago

Hi Ora2Pg v24.3

nohup ora2pg -c config/ora2pg.conf > rapport_TEST_DATA

[postgres@dcgyy5eo DEVPATOU2]$ tail -f rapport_TEST_DATA [2024-11-20 08:31:21] [=========> ] 121/293 tables (41.3%) scanning table PARAM_TRAIT_C[2024-11-20 08:31:21] [==========> ] 131/293 tables (44.7%) scanning table PRELEVEMENT [2024-11-20 08:31:21] [============> ] 151/293 tables (51.5%) scanning table SERIE_EXPLICA[2024-11-20 08:31:21] [=============> ] 161/293 tables (54.9%) scanning table SESS_TRAV_TRA[2024-11-20 08:31:21] [==============> ] 171/293 tables (58.4%) scanning table SYNO_TYP_LIEU[2024-11-20 08:31:21] [=================> ] 211/293 tables (72.0%) scanning table TYP_ETALONNAG[2024-11-20 08:31:21] [==================> ] 221/293 tables (75.4%) scanning table TYP_SCENAR [2024-11-20 08:31:21] [======================> ] 271/293 tables (92.5%) scanning table UTIL_GROUPE_P[2024-11-20 08:31:21] [=======================> ] 281/293 tables (95.9%) scanning table VUE_BASS [2024-11-20 08:31:21] [========================>] 293/293 tables (100.0%) end of scanning. Result will be written to file data_validation.log ERROR: ORA-00911: caractère non valide (DBD ERROR: error possibly near <> indicator at char 91 in 'SELECT a."CODE_GROUPE",a."CODE_TYP_ACCES",a."CODE_SITE" FROM "CTR"."GROUPE_SITE" a WHERE (1<>=1 # Apply to all tables) ORDER BY 1,2,3 FETCH FIRST 10000 ROWS ONLY') Can't call method "execute" on an undefined value at /usr/local/share/perl5/Ora2Pg.pm line 21798. Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Oracle::db handle (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=pc2yy047.pcy.edf.fr))(CONNECT_DATA=(SID=CTRNAT))) at /usr/local/share/perl5/Ora2Pg.pm line 21798. Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Oracle::db handle (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(PORT=1521)(HOST=pc2yy047.pcy.edf.fr))(CONNECT_DATA=(SID=CTRNAT))) at /usr/local/share/perl5/Ora2Pg.pm line 21798. << Despite the migration to the latest version (24.3), the issue still persists.

did16 commented 1 week ago

Hi I have found the following lead: SELECT a."CODE_GROUPE",a."CODE_TYP_ACCES",a."CODE_SITE" FROM "CTR"."GROUPE_SITE" a WHERE (1=1 # Apply to all tables) ORDER BY 1,2,3 FETCH FIRST 5 ROWS ONLY; If I remove the comment "# Apply to all tables" in the SQL query, it works. ora2pg add the comment in the SQL query code ...

did16 commented 5 days ago

Hi Is it possible to know if a fix is planned for ora2pg regarding the bug I reported about TEST_DATA? Thanks in advance

darold commented 5 days ago

No fix are planned, avoid adding comments in the ora2pg.conf setting value is the solution. I know this is default ora2pg.conf but this is just not allowed.