Skip to Main Content
  • Questions
  • Oracle home and connecting to the database

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Tony.

Asked: July 26, 2016 - 4:26 am UTC

Last updated: July 27, 2016 - 1:23 pm UTC

Version: 11g

Viewed 1000+ times

You Asked

Sir im a beginer to oracle database my query is,How we can connect to a database if we do not know the ORACLE_HOME.
eg: if we have 5 databases running in a server and there are 5 different ORACLE_HOME ( ie, ORACLE_HOME is
different for each database ) how we can connect to the database without using an explicit export command.

and Chris said...

You don't need to know the ORACLE_HOME to connect to a database!

You just need to know:

- The server
- The port
- The service name or SID

With these in hand you can:

Use EZConnect:
sqlplus user/pwd@//<server>:<port>/<service>

Configure tnsnames and use that

-- in tnsnames.ora
<alias> =
 (DESCRIPTION =
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(Host = <hostname>)(Port = <port>))
   )
 (CONNECT_DATA =
   (SERVICE_NAME = <service_name>)
 )
)

-- connect
sqlplus user/pwd@alias


http://www.orafaq.com/wiki/Tnsnames.ora


Connect with SQL Developer:
http://www.oracle.com/technetwork/issue-archive/2008/08-may/o38sql-102034.html

etc.!

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thanks a lot chris

Tony Shaji, July 27, 2016 - 11:03 am UTC

Thanks a lot for your timely feedback
Connor McDonald
July 27, 2016 - 1:23 pm UTC

glad we could help