Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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).

share|improve this question
    
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? –  Justin Cave May 21 '13 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.. :) –  Midhun Purathoot May 22 '13 at 10:03
add comment

migrated from stackoverflow.com May 21 '13 at 8:09

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

2 Answers

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 ~]$
share|improve this answer
    
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.. :) –  Midhun Purathoot May 22 '13 at 9:20
add comment

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';
share|improve this answer
    
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.. :) –  Midhun Purathoot May 22 '13 at 9:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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