I am trying my best to migrate a spatial database from Oracle to Postgresql and failing miserably.
I have tried many different avenues as you can see from my previo
The accepted solution didn't work for me.
Install GDAL/OGR using OSGeo4W, and in Advanced Install mode select gdal-oracle10g.
Then execute this command:
ogr2ogr
-a_srs {{SRS}}
-overwrite -f
"PostgreSQL"
-nln {{POSTGIS SCHEMA}}.{{POSTGIS TABLE}}
PG:"
host='{{POSTGIS HOST}}'
port='{{POSTGIS PORT}}'
user='{{POSTGIS USER}}'
password='{{POSTGIS PASSWORD}}'
dbname='{{POSTGIS DATABASE}}'"
OCI:"{{ORACLE USER}}/{{ORACLE PASSWORD}}
@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = {{ORACLE HOST}})
(PORT = {{ORACLE PORT}})))
(CONNECT_DATA = (SID = {{ORACLE SID}})))
:{{ORACLE SCHEMA}}.{{ORACLE TABLE}}"
replace {{ }} items with your values!
You need to do this for each table. There is an spreadsheet that can generate these commands for you:
http://gis-expert.com/wp/2018/09/12/how-to-migrate-spatial-data-from-oracle-to-postgis/