0

I am currently participating in a project where my task is to configure a connection from an Ubuntu 22.04x86_64 server to an internal Oracle DB server called myOracleDB.

First of all, a ping myOracleDB works fine, so the servers see each other. To rule out network problems we have also allowed all further connections on all ports in the meantime. So the next step was to install the oracle client. For this, I followed the installation on an older Ubuntu 16.04x86_64 server, where I can run sqlplus User@dbConn without any problems and everything works fine.

So, I first downloaded

  • oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm
  • oracle-instantclient19.6-devel-19.6.0.0.0-1.x86_64.rpm
  • oracle-instantclient19.6-odbc-19.6.0.0.0-1.x86_64.rpm
  • oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm.

After that I converted them to debian packages using sudo alien --scripts --target="x86_64" and installed them sucessfully via sudo gdebi. With dpkg --list I now see

ii  oracle-instantcli 19.6.0.0.0-2  amd64         Oracle Instant Client Basic package
ii  oracle-instantcli 19.6.0.0.0-2  amd64         Development header files for Oracle Ins
ii  oracle-instantcli 19.6.0.0.0-2  amd64         Oracle Instant Client ODBC
ii  oracle-instantcli 19.6.0.0.0-2  amd64         Oracle Instant Client SQL*Plus package

Then I have configured the following:

  • cat /etc/ld.so.conf.d/oracle.conf gives /usr/lib/oracle/19.6/client64/lib/. (running sudo ldconfig as well)
  • export TNS_ADMIN=$ORACLE_PATH/network/admin with ORACLE_PATH=/usr/lib/oracle/19.6/client64/lib
  • Under $ORACLE_PATH/network/admin there is a tnsnames.ora containing

tnsnames.ora:

dbConn =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =  myOracleDB)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = MYSN)
    )
  )

Finally I exported some variables: export

LD_LIBRARY_PATH=/usr/lib/oracle/$ORACLE_VER/client64/lib/${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export ORACLE_HOME=$ORACLE_PATH
export ORACLE_SID=MYSN
export PATH=$PATH:$ORACLE_HOME/bin

With these settings, on my older server (Ubuntu 16.04) the connection works fine. However, when I'm using sqlplus User@dbConn on the current machine I get

ERROR:
ORA-12541: TNS:no listener

I may add the information that the old and current Ubuntu server are running in different subnets. Any ideas what may cause this problem? Again, the configuration files are definitely identical on both Ubuntu machines. Despite that, I also get the same error with instantclient versions other than 19.6 (e.g.: 21.7).

6
  • If I understand what you did. You built it on 16.04 a long gone EOL version of Ubuntu and then converted it to Debian an off topic non Ubuntu OS and then installed the apps you built onto a Ubuntu 22.04 machine.
    – David
    Oct 14, 2022 at 11:12
  • I just mentioned the 16.04 server to show that the oracle database is listening and is working. On the Ubuntu 22.04 I built everything from scratch. However, I took the same version of the oracle instantclient (19.6) for the 22.04 installation that also seem to work with the "older" machine
    – Ai4l2s
    Oct 14, 2022 at 11:29
  • Maybe need a newer client?
    – David
    Oct 14, 2022 at 11:32
  • also tried the newst 21.7 oracle instantclient. same error
    – Ai4l2s
    Oct 14, 2022 at 11:42
  • unset ORACLE_SID. This variable is used for IPC towards local Oracle Database processes. Make sure this one is successful: nc -vz myOracleDB 1521. Trace client syscalls (is tnsnames.ora picked up?): strace sqlplus u/p@TNSALIAS Oct 14, 2022 at 12:25

0

You must log in to answer this question.

Browse other questions tagged .