Home » SQL & PL/SQL » SQL & PL/SQL » How to find Oracle path
icon14.gif  How to find Oracle path [message #209180] Wed, 13 December 2006 11:07 Go to next message
nagsindhu
Messages: 14
Registered: August 2006
Location: Newjersey
Junior Member

Hi,
How do we find Oracle Path (ORACLE_HOME) directory at the SQL prompt in wondows???

Thanks,
SindhuReddy
Re: How to find Oracle path [message #209184 is a reply to message #209180] Wed, 13 December 2006 11:35 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
On Windows:

SQL> host echo %ORACLE_HOME%
E:\oracle\app\oracle\product\10.2


On 10g as SYS:

SQL> var v_value char(70);
SQL> exec dbms_system.get_env('ORACLE_HOME', :v_value);
SQL> print v_value;

V_VALUE
--------
E:\oracle\app\oracle\product\10.2

icon14.gif  Re: How to find Oracle path [message #209198 is a reply to message #209180] Wed, 13 December 2006 13:41 Go to previous messageGo to next message
nagsindhu
Messages: 14
Registered: August 2006
Location: Newjersey
Junior Member

Hi,
Thanx for ur quick reply..But It does't work .Im using 9.2 version & windowa XP.
so pls do let me know the alternate way.

Thanks,

[Updated on: Wed, 13 December 2006 13:42]

Report message to a moderator

Re: How to find Oracle path [message #209200 is a reply to message #209198] Wed, 13 December 2006 13:51 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
If SQL> host echo %oracle_home% didn't produce any results, then you probably don't have it specificially defined in your environement variable.

You could also use:

select substr(file_spec, 1, instr(file_spec, '\', -1, 2) -1) ORACLE_HOME
	from dba_libraries
	where library_name = 'DBMS_SUMADV_LIB';

[Updated on: Wed, 13 December 2006 13:56]

Report message to a moderator

Re: How to find Oracle path [message #209256 is a reply to message #209200] Thu, 14 December 2006 00:14 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Your last query will not work on 10g XE. It returns a non-existing directory (maybe the ORACLE_HOME of the original developer?)
Re: How to find Oracle path [message #209320 is a reply to message #209256] Thu, 14 December 2006 04:48 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
The query should work on 8i-10g. I tested it on 10gR2, but don't have all the other versions to test on.
Previous Topic: Dynamic columns in crosstab output
Next Topic: Invalid Record Count in Oracle query while using dblink
Goto Forum:
  


Current Time: Sat Dec 03 17:58:26 CST 2016

Total time taken to generate the page: 0.25637 seconds