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

Issues with SHOW_TABLE not showing all tables in oracle #1641

Closed mirec84 closed 1 year ago

mirec84 commented 1 year ago

hi,

I am using v23.2 and trying to migrate an Oracle DB to PostgreSQL and SHOW_TABLE is missing one table (the last one), all other 90 tables are shown correctly, but the one named 'V_STOFF_ZEUS_NEU' is missing.

image

Although, when I execute this command on the Oracle, it is part of the list:

image

Can someone help? (USER_GRANTS = 1)

darold commented 1 year ago

Hi,

Does this table is listed in ALL_OBJECTS and what is its type in this catalog table?

SELECT A.OWNER, A.OBJECT_NAME, A.OBJECT_TYPE FROM ALL_OBJECTS A WHERE A.OBJECT_NAME = 'V_STOFF_ZEUS_NEU';

It might not be a real table but related to materialized view, in this case the OBJECT_TYPE will not be TABLE.

mirec84 commented 1 year ago
image
mirec84 commented 1 year ago

There is materialized view with the same name. Maybe that is the reason?

darold commented 1 year ago

yes this is the reason

mirec84 commented 1 year ago

but the table should be exported despite the existence of a materialized view right?

darold commented 1 year ago

right, give me few minutes.

darold commented 1 year ago

@mirec84 please give a try to latest development code, commit fc5c67c should fix this issue.

darold commented 1 year ago

Well I introduced a regression in the previous commit that is fixed with commit 6f3ffc1, please give it a try.

mirec84 commented 1 year ago

I still do not see the V_STOFF_ZEUS_NEU table :( Nothing seem to be changed in the output

darold commented 1 year ago

Ok, I have reverted the lasts commits. What you are seeing is an Oracle internal table related to the materialized view, not a real table.

You can try to create a materialized view and execute query SELECT A.OWNER, A.OBJECT_NAME, A.OBJECT_TYPE FROM ALL_OBJECTS A WHERE A.OBJECT_NAME = '<MVIEW_NAME>'; you will see the two entries. Previous behavior of Ora2Pg was the right one. I should have recall that you can not create a table and a mview with the same name in Oracle.

mirec84 commented 1 year ago

You are correct

mirec84 commented 1 year ago

this is not an issue