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
1.03k stars 343 forks source link

ORA-03134: Connections to this server version are no longer supported. (DBD ERROR: OCISessionBegin) #1416

Closed rksengee closed 2 years ago

rksengee commented 2 years ago

Hi All,

I'm getting below while migrating oracle 9i database. Please suggest.

Error:- FATAL: 3134 ... ORA-03134: Connections to this server version are no longer supported. (DBD ERROR: OCISessionBegin)

Oracle Database:- Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production PL/SQL Release 9.2.0.3.0 - Production "CORE 9.2.0.3.0 Production" TNS for IBM/AIX RISC System/6000: Version 9.2.0.3.0 - Production NLSRTL Version 9.2.0.3.0 - Production

gilles-migops commented 2 years ago

I think you should downgrade your Oracle client/library to 10 or perhaps 11 is also working, more recent version do not support Oracle 8i or 9i.

aymanadou commented 2 years ago

use 10.2 instant client oracle

gilles-migops commented 2 years ago

I think you should use Instant Client 10.1 not 10.2, please confirm if it solves the issue.

rksengee commented 2 years ago

Sorry for late reply ...

I have installed instant-client 10.1 with SDK and SQLplus packages. Earlier, It was oracle client 12.1. I have changed environment variables as well but still getting below.

install_driver(Oracle) failed: Can't load '/csapps/ora2pg/perl5lib/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 200. at (eval 13) line 3 Compilation failed in require at (eval 13) line 3. Perhaps a required shared library or dll isn't installed where expected at /csapps/ora2pg/perl5lib/usr/local/share/perl5/Ora2Pg.pm line 1619

Client Location :- ]$ ls -ltr /csapps/ora2pg/db-migration/xpr_db/instantclient10_1

-r--r--r-- 1 o2padmin o2pgrp 1378315 Dec 7 2005 ojdbc14.jar -rwxr-xr-x 1 o2padmin o2pgrp 122861 Dec 7 2005 libocijdbc10.so -rwxr-xr-x 1 o2padmin o2pgrp 66423996 Dec 7 2005 libociei.so -rwxr-xr-x 1 o2padmin o2pgrp 958670 Dec 7 2005 libocci.so.10.1 -rwxr-xr-x 1 o2padmin o2pgrp 1773518 Dec 7 2005 libnnz10.so -rwxr-xr-x 1 o2padmin o2pgrp 15306239 Dec 7 2005 libclntsh.so.10.1 -r--r--r-- 1 o2padmin o2pgrp 1442415 Dec 7 2005 classes12.jar -rwxr-xr-x 1 o2padmin o2pgrp 34326 Dec 7 2005 libheteroxa10.so -rwxr-xr-x 1 o2padmin o2pgrp 14114 Dec 7 2005 sqlplus -r--r--r-- 1 o2padmin o2pgrp 22334 Dec 7 2005 README_IC.htm -r--r--r-- 1 o2padmin o2pgrp 5110736 Dec 7 2005 orai18n.jar -r--r--r-- 1 o2padmin o2pgrp 55433 Dec 7 2005 ocrs12.jar -rwxr-xr-x 1 o2padmin o2pgrp 814479 Dec 7 2005 libsqlplus.so -r--r--r-- 1 o2padmin o2pgrp 1353 Dec 7 2005 glogin.sql drwxr-xr-x 4 o2padmin o2pgrp 4096 Dec 7 2005 sdk lrwxrwxrwx 1 o2padmin o2pgrp 17 May 11 06:37 libclntsh.so -> libclntsh.so.10.1 lrwxrwxrwx 1 o2padmin o2pgrp 15 May 11 06:38 libocci.so -> libocci.so.10.1

Environment Variables:- export PGDATA=/csapps/ora2pg/pgsql/data export PG_HOME=/usr/pgsql-12 export ORACLE_HOME=/csapps/ora2pg/db-migration/xpr_db/instantclient10_1 export PATH=$ORACLE_HOME:$PATH:$PG_HOME/bin export PG_LOG=/csapps/ora2pg/pgsql/pgstartup.log export LD_LIBRARY_PATH=/csapps/ora2pg/db-migration/xpr_db/instantclient10_1 export PERL5LIB=/csapps/ora2pg/perl5lib/usr/local/share/perl5:/csapps/ora2pg/perl5lib/lib64/perl5 export ORA2PG_WS_PATH=/csapps/ora2pg/db-migration export PY_VENV_PATH=/csapps/ora2pg/python3-venv export PY_DATA_COMP=/csapps/ora2pg/data-comparison

rksengee commented 2 years ago

Seems like it is still looking for "DBD::Oracle: libclntsh.so.12.1". See in error .

darold commented 2 years ago

I guess that you have executed a make clean and run perl Makefile.PL before compiling again DBD::Oracle so you probably have en entry in the ldconfig path that point to the instant client 12 installation.

You should add/change a ldconfig configuration file as follow:

$ cat /etc/ld.so.conf.d/oracle.conf 
/csapps/ora2pg/db-migration/xpr_db/instantclient10_1

then execute sudo ldconfig

sudo ldconfig -v | grep libclntsh.so might give you the right library version in cache.

darold commented 2 years ago

I guess that the issue is solved, closing.

rksengee commented 2 years ago

Sorry Darold, I was on leave. This is still going on ... we are not able to download 10g because this is not available for download.

darold commented 2 years ago

You can download the InstantClient 10.1 at this address: https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html your have to go at bottom of the HTML page to see download for 10.1

rksengee commented 2 years ago

Still getting below:

install_driver(Oracle) failed: Can't load '/csapps/ora2pg/perl5lib/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.12.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 200. at (eval 13) line 3 Compilation failed in require at (eval 13) line 3. Perhaps a required shared library or dll isn't installed where expected at /csapps/ora2pg/perl5lib/usr/local/share/perl5/Ora2Pg.pm line 1619

darold commented 2 years ago

You must reinstall DBD::Oracle using the ORACLE_HOME and LD_LIBRARY_PATH env variables set to the 10.1 instant client.

rksengee commented 2 years ago

We have more then 100 databases only few are running on Oracle 9i. At this time ora2pg is configured with 12c client. That's means we would require to switch between 10g & 12c client frequently in future. Two questions ..first, Is it safe means will not break anything ? second what are steps for this. I'm new with ora2pg and this is a client system I don't want any escalation :) Thanks for your support!

rksengee commented 2 years ago

Hey Please respond someone

darold commented 2 years ago

I'm pretty sure that Perl allow you to install both version of DBD::Oracle compiled with the two different Instant Clients in separate location. Then you just have to pick the right DBD::Oracle install directory when running ora2pg using perl -I ... /usr/local/bin/ora2pg. Saying that I have never tested, usually I just recompiile DBD::Oracle with the Install Client I want and reinstall it then proceed to migration.