0

I have server that has had Oracle installed by someone else. I am able to connect to it using SQL developer and do all the operations, but I want to know the location where Oracle is installed.

I need this details to execute exp, imp, expdp, impdp, etc. commands using putty to perform import/export and data dumps.

Is there any way I can get the Oracle installation directory details using SQL command? Does Oracle store the installation path in a database?

migrated from stackoverflow.com Mar 28 at 10:22

This question came from our site for professional and enthusiast programmers.

1

I am sure there is a even smarter way, but if you use the default trace file directories, which is usually the case, you will in most cases find both ORACLE_BASE and ORACLE_HOME via

SELECT VALUE FROM V$DIAG_INFO WHERE NAME = 'Diag Trace';

This gives you the absolute path to the trace files and they are inside ORACLE_BASE and ORACLE_HOME respectively.

HTH KR Peter

Edit: Have a look here for a more straight forward approach: https://dba.stackexchange.com/questions/97390/query-to-get-oracle-home-path-in-oracle-11g

-1

On the database server (VM), use the provided oraenv script to set up your working environment. This reads the entries in /etc/oratab and sets not only the PATH environment variable, but also the Library Include Paths as well.

$ source oraenv 
ORACLE_SID = [grid] ? MYSID
The Oracle base remains unchanged with value /u01/app/oracle_homes/product/dbhome_1

Of course, for this to work, you have to have the Oracle binaries in your PATH already, so that the shell can find oraenv! To set this up by default, copy part of the entry from /etc/oratab into your .bash_profile:

[/etc/oratab]
MYSID:/u01/app/oracle_homes/product/dbhome_1:N

[~/.bash_profile]
export PATH=${PATH}:/u01/app/oracle_homes/product/dbhome_1/bin
  • yes, the OP can do what he needs by using oraenv, but no he does not have to know where the binaries are to put them in the path. By default, the installation of oracle will put oraenv into /usr/local/bin, which is already in the PATH. – EdStevens Mar 28 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.