Closed tbw777 closed 5 months ago
I guess that the ora2pg.conf is not at the place it is expected by Ora2Pg, something is wrong in your docker use.
Its correct place, because then i hide PG_VERSION from this config i get a version warning:
WARNING: target PostgreSQL version must be set in PG_VERSION configuration directive. Using default: 11
Ok, then this is because ORACLE_DSN is not set or it is set to ist default value :ORACLE_DSN dbi:Oracle:host=localhost;sid=SIDNAME;port=1521
.
Looking at info message:
INFO: no args provided. Using default: '--debug -c /config/ora2pg.conf --basedir /data/ --source dbi:Oracle:host=localhost;sid=SIDNAME;port=1521 --user system --password
I don't know about the docker run but if you want to run ora2pg directly with your parameters this could be done using;
ora2pg -c=/config/ora2pg.conf -b /data/ -s "dbi:Oracle:host=localhost;sid=THESID;port=1521" -u system -w oracle -d
On windows i cant run without docker there is no any versions on winget or chocolatey or wsl apt
after compile on win platform i get the same error without the docker but on the same config:
ora2pg -c ora2pg.conf -debug [2023-09-28 19:04:14] Ora2Pg version: 24.1 [2023-09-28 19:04:14] Export type: TABLE [2023-09-28 19:04:14] Geometry export type: INTERNAL [2023-09-28 19:04:14] FATAL: you must set ORACLE_DSN in ora2pg.conf or use a DDL input file. Aborting export...
with template and any other value:
ORACLE_DSN dbi:Oracle:host=mydb.mydom.fr;sid=SIDNAME;port=1521
i got the same error
In your ora2pg.conf file the value of ORACLE_DSN must be set with something else than the default, replacing SIDNAME by anything else will work.
the problem was in bad service_name, now error is fixed
[2023-09-28 19:54:31] Trying to connect to database: dbi:Oracle:host=localhost;service_name=some_name;port=1521 install_driver(Oracle) failed: Can't load 'C:/Strawberry/perl/site/lib/auto/DBD/Oracle/Oracle.xs.dll' for module DBD::Oracle: load_file:═х эрщфхэ єърчрээ√щ ьюфєы№ at C:/Strawberry/perl/lib/DynaLoader.pm line 206.
but now i dont know what to do with this on win
on docker something is works
[2023-09-28 17:17:11] [1] Scanning table SOME_TABLE (1 rows)...
there is no any rows
first dump is finished
Then now you know what is the problem with ORACLE_DSN so you can retry to use ora2pg with docker. Otherwise you need to install DBD::Oracle on Windows which could be something not very easy.
I suggest making the message more informative. Errors that the value is not set or set incorrectly is different
I agree.
ora2pg.conf: