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

ORA-12505: TNS:listener does not currently know of SID given in connect descriptor #1690

Closed ayb84 closed 10 months ago

ayb84 commented 10 months ago

I try to connect to an oracle cloud database, but i have this error :

$ ora2pg -t SHOW_SCHEMA -c ./config/ora2pg.conf DBI connect('host=10.33.33.333;sid=aaaa.oraclevcn.com;port=1521','test',...) failed: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) at /usr/local/share/perl5/Ora2Pg.pm line 1619. FATAL: 12505 ... ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) Aborting export...

i don't have a SID but a service name.

any ideas ?

Thank you.

darold commented 10 months ago

Looking at the example in the documentation:

        On 18c this could be for example:

                dbi:Oracle:host=192.168.1.29;service_name=pdb1;port=1521

could help you I think.

ayb84 commented 10 months ago

Thank you very much for your help, your proposal works very well and it solves my problem completely.

For more precision, I use Oracle Database 12c EE High Perf Release 12.2.0.1.0 with instantClient and ora2pg-20.0

Thank you so much.