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/
. (runningsudo ldconfig
as well)export TNS_ADMIN=$ORACLE_PATH/network/admin
withORACLE_PATH=/usr/lib/oracle/19.6/client64/lib
- Under
$ORACLE_PATH/network/admin
there is atnsnames.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
).