Skip to Main Content
  • Questions
  • Strange Behaviour with Oracle_Home and trailing slash

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Mickael.

Asked: May 20, 2020 - 6:20 am UTC

Answered by: Connor McDonald - Last updated: May 22, 2020 - 12:51 am UTC

Category: Database Administration - Version: 19.3

Viewed 100+ times

You Asked

Hi,

I have a server hosting several instances based on the same oracle engine 19.3 (19.0.0.0).
As an example, let's consider DB1 and DB2.
We connect to the server with a user account member of dba group.
In the same user session :
export ORACLE_HOME=/oracle/product/19.3.0.0
sqlplus system/*******@DB1 ==> works
sqlplus system/*******@DB2 ==> TNS Lost contact error

# Changing ORACLE_HOME value :

export ORACLE_HOME=/oracle/product/19.3.0.0/ (with a / at the end)
sqlplus system/*******@DB1 ==> TNS Lost contact error
sqlplus system/*******@DB2 ==> works

I work in the same user user. The only context value modified is ORACLE_HOME.
ORACLE_HOME is the mount point of a filesystem (not a symlink etc... )

Both DBs are declared correctly in the tnsnames.ora:
DB1 =
  (DESCRIPTION =
    (ADDRESS = (HOST = dbserver)(PROTOCOL = TCP)(PORT = 1587))
    (CONNECT_DATA =
      (SID = DB1)
      (SERVICE_NAME = DB1)
      (SERVER = DEDICATED)
    )
  )

DB2 =
  (DESCRIPTION =
    (ADDRESS = (HOST = dbserver)(PROTOCOL = TCP)(PORT = 1587))
    (CONNECT_DATA =
      (SID = DB2)
      (SERVICE_NAME = DB2)
      (SERVER = DEDICATED)
    )
  )

I don't have any issue to connect remotly these 2 instances.

Do you have any where this can come from ?

Best regards,

and we said...

Trailing slashes are something you don't want to have :-)

In the instance above, it is likely that one of the databases (DB2) was *started* with ORACLE_HOME set to the trailing slash, and the other one (DB1) was not.

- Stop DB2
- Correct the ORACLE_HOME
- Start DB2

and hopefully things should sort themselves out


More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database