to find oracle home

Posted on 2011-05-08
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


I could not fine home..
Question by:nobleit
    LVL 23

    Expert Comment

    - 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.
    LVL 23

    Expert Comment

    - if you run this as other user, you need to grant execute on sys.dbms_system to that user
    LVL 40

    Expert Comment

    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.
    LVL 76

    Expert Comment

    by:slightwv (䄆 Netminder)
    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?
    LVL 4

    Accepted Solution

    Hi: check out following code and login as sysdba like : $ sqlplus / as sysdba

    set serveroutput on
     ora_home VARCHAR2(100);
      dbms_system.get_env('ORACLE_HOME', ora_home);

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
    This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now