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

Foreign server always generated with default port #1795

Closed aymanadou closed 1 day ago

aymanadou commented 3 weeks ago

Hello, the foreign server declared when copying the data using oracle FDW is always declared with 1521 port even the configuration is using another port.

select * from pg_catalog.pg_foreign_server ; oid | srvname | srvowner | srvfdw | srvtype | srvversion | srvacl | srvoptions --------+---------+----------+--------+---------+------------+--------+----------------------------------------------------------- 413232 | orcl | 16397 | 413231 | | | | {dbserver=//xxxxx.fr:1521/XXX} (1 row)

so to avoid the copy problem i should update the server option before the TNS error triggers :

alter server orcl options (SET dbserver '//xxx:20300/XXX');

darold commented 3 weeks ago

Hi,

The FDW server port is base on the ORACLE_DSN configuration value, what is this value? You should anonymize it but with respect to the syntax.

aymanadou commented 3 weeks ago

Hello, ora2pg versions : 24.1 and 24.3 ORACLE_DSN dbi:Oracle:host=xxx;sid=PXXOR1;port=20300

darold commented 3 weeks ago

My bad, commit ece3b01 might fix this issue.