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.
I have 5 problems with TABLESPACE export type.
All errors are related to PARTITIONED (and SUBPARTITIONED) tables.
Ora2Pg skiped SUBPARTITIONED table. It just lost such type of tables in scripts of tablespace export.
Syntax
Ora2Pg generated script with syntax error. Word "PARTITION" shouldn't be in query:
Syntax
As I know, if I want to select tablespace for PARTITIONED table, in PostgreSQL I shoud indicate tablespace for each partition of this table. Ora2Pg generates queries WITHOUT NAMES OF PARTITIONS, it puts name of table instead:
Quantity of queries for partitions
Ora2Pg generates queries not only for each partition, but another quantity.
For example I have table in Oracle with 6 partitions, but Ora2Pg generated 49 equal lines of queries.
So even if they had the correct syntax, it's too much for 6 partitions.
Also I noticed an interesting fact: number of lines generated by Ora2Pg for partitioned tables always is a square number (4 partitions - 16 lines, 6 partiitons - 49 lines).
Oracle:
Ora2Pg generated code (not all lines):
Partitioned index
Listed above problems cover this situation, but I want to highlight it too.
I have partitioned index on partitioned table and I specified different tablespaces for different partitions of index.
Ora2Pg generated wrong queries (wrong syntax and wrong number of lines) for index tablespaces too.
I have 5 problems with TABLESPACE export type. All errors are related to PARTITIONED (and SUBPARTITIONED) tables.
Ora2Pg skiped SUBPARTITIONED table. It just lost such type of tables in scripts of tablespace export.
Syntax Ora2Pg generated script with syntax error. Word "PARTITION" shouldn't be in query:![image](https://user-images.githubusercontent.com/14944095/207372078-0d4ae0d1-318a-4261-ab92-9b5f3ead8774.png)
Syntax As I know, if I want to select tablespace for PARTITIONED table, in PostgreSQL I shoud indicate tablespace for each partition of this table. Ora2Pg generates queries WITHOUT NAMES OF PARTITIONS, it puts name of table instead:![image](https://user-images.githubusercontent.com/14944095/207375879-1926fda7-37da-436f-940a-ea457b922f35.png)
Quantity of queries for partitions Ora2Pg generates queries not only for each partition, but another quantity. For example I have table in Oracle with 6 partitions, but Ora2Pg generated 49 equal lines of queries. So even if they had the correct syntax, it's too much for 6 partitions. Also I noticed an interesting fact: number of lines generated by Ora2Pg for partitioned tables always is a square number (4 partitions - 16 lines, 6 partiitons - 49 lines).
Oracle:![image](https://user-images.githubusercontent.com/14944095/207377760-0cd03ac8-a117-4426-9005-439fa77609bb.png)
Ora2Pg generated code (not all lines):![image](https://user-images.githubusercontent.com/14944095/207377928-5029cd1c-e11c-477c-a89d-a2036848ca74.png)
Oracle:![image](https://user-images.githubusercontent.com/14944095/207380675-459aa2ca-210e-4733-b61b-dda5e92d2976.png)
Ora2Pg generated code:![image](https://user-images.githubusercontent.com/14944095/207380924-321d5d1e-138c-4a09-9820-ba9b9c96a35e.png)