1

I am searching for a query to get the Oracle Home for a particular instance name, say Eagle (if there are more than one instance on the host).

2
  • When you say "Oracle query", are you talking about a SQL statement? Or are you talking about a script that runs at the operating system level? The latter would seem much more reasonable. Are you assuming that the DBA didn't follow any sort of logical process in setting up the server? Or can we assume that things were configured logically? Commented May 21, 2013 at 8:18
  • Thank you all for ur reply :)... I got the query for that.. sorry for late reply... Actually i am a beginner in Oracle. so my question was not so clear.. But in the end, I solved my problem.. Thank you once again.. :) Commented May 22, 2013 at 10:03

2 Answers 2

3

You can do this from a Unix shell, like so:

[oracle@node1 ~]$ grep "^YOURSID:" /etc/oratab | cut -d: -f 2
/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@node1 ~]$
1
  • Thank you all for ur reply :)... I got the query for that.. sorry for late reply... Actually i am a beginner in Oracle. so my question was not so clear.. But in the end, I solved my problem.. Thank you once again.. :) Commented May 22, 2013 at 9:20
0

You can also do this by utilizing the v$parameter view. Assuming your spfile is saved under the oracle_home in the dbs/ folder, this is a rough query using functions within functions to get the oracle_home.

select substr(value, 1, length(value) - length(substr(value, instr(value,'dbs')))) 
from v$parameter
where name = 'spfile';
1
  • Thank you all for ur reply :)... I got the query for that.. sorry for late reply... Actually i am a beginner in Oracle. so my question was not so clear.. But in the end, I got solved my problem.. Thank you once again.. :) Commented May 22, 2013 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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