Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

to find oracle home

Posted on 2011-05-08
5
Medium Priority
?
994 Views
Last Modified: 2012-08-14
SQL> set autopri on
SQL> var oracle_home varchar2(255)
SQL> exec dbms_system.get_env('ORACLE_HOME',:ORACLE_HOME)
BEGIN dbms_system.get_env('ORACLE_HOME',:ORACLE_HOME); END;

      *
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_SYSTEM.GET_ENV' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored



ORACLE_HOME                                                                    
--------------------------------------------------------------------------------
             

I could not fine home..
0
Comment
Question by:nobleit
5 Comments
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35717665
- run this statement using user SYS as SYSDBA

- OR check the environment variables in My Computer properties. you should see the Oracle_Home entry in the system section.
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35717685
- if you run this as other user, you need to grant execute on sys.dbms_system to that user
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 35717738
You will likely _not_ find ORACLE_HOME as a System environment variable on Windows. It comes from the registry on Windows. DBMS_SYSTEM.GET_ENV() will return it correctly on Windows or UNIX, but how it gets there differs.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35719736
I would also like to point out that a machine can have multiple ORACLE_HOME's set.

What exactly are you wanting to do with this once you get it?
0
 
LVL 4

Accepted Solution

by:
Thankxx earned 2000 total points
ID: 35721788
Hi: check out following code and login as sysdba like : $ sqlplus / as sysdba
then,

set serveroutput on
DECLARE
 ora_home VARCHAR2(100);
BEGIN
  dbms_system.get_env('ORACLE_HOME', ora_home);
  dbms_output.put_line(ora_home);
END;
/
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to recover a database from a user managed backup
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question