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

The same partition name appears when creating a partitioned table #1677

Closed mihan-22 closed 11 months ago

mihan-22 commented 11 months ago

Oracle allows the same table name and index name, so two records may appear in the query DBA__PART_KEY_COLUMNS, DBA_SUBPART_KEY_COLUMNS and DBA__PART_KEY_COLUMNS, object_type table and index. Causes functions such as _get_partitions, _get_subpartitions, _get_partitioned_table, and so on to log two results, and eventually, two identical partition keys exist for a table

darold commented 11 months ago

Why do you want to avoid exporting partitions, they will be missing in the export? Actually this is a known problem, enable RENAME_PARTITION in ora2pg.conf and Orap2Pg will take care for you of duplicate partition name.

mihan-22 commented 11 months ago

Hello, what we describe may not be the same thing, you can use this RENAME_PARTITION parameter when exporting partition tables. However, when we create a table, when querying the information in the Oracle database, if the table name and index name with the same name appear, then there must be two records in the DBA__PART_KEY_COLUMNS table. After a natural connection to the DBA_PARTTABLES, there are still two records (in the Oracle database). When we look for the partition key through the fetch function, we will query two identical values together as the partition key. As shown in the following `figure. image _`