1) How to find Oracle Home ?
Connected to Oracle Database 12c Enterprise Edition Release 12.1.0.2.0
Connected as NZDCU1
SQL> select SYS_CONTEXT ('USERENV','ORACLE_HOME') from dual;
SYS_CONTEXT('USERENV','ORACLE_
--------------------------------------------------------------------------------
/scratch/oracle/app/ora12c/product/12.1.0/dbhome_1
Above Query will work only from 12c Onwards
and 10g and 11g , you can use below one( Login as SYSDBA)
SQL> var Ora_Home Varchar2(1000);
SQL> exec dbms_system.get_env('ORACLE_HOME', :Ora_Home) ;
PL/SQL procedure successfully completed
Ora_Home
---------
C:\app\Venky\product\11.2.0\dbhome_1
SQL> Print ORA_HOME;
Ora_Home
---------
C:\app\Venky\product\11.2.0\dbhome_1
In Unix , after setting Variable, we can use below one (By the way to set variable we need Oracle_Home :) so get oracle_home from developer tool).
$ echo $ORACLE_HOME
Connected to Oracle Database 12c Enterprise Edition Release 12.1.0.2.0
Connected as NZDCU1
SQL> select SYS_CONTEXT ('USERENV','ORACLE_HOME') from dual;
SYS_CONTEXT('USERENV','ORACLE_
--------------------------------------------------------------------------------
/scratch/oracle/app/ora12c/product/12.1.0/dbhome_1
Above Query will work only from 12c Onwards
and 10g and 11g , you can use below one( Login as SYSDBA)
SQL> var Ora_Home Varchar2(1000);
SQL> exec dbms_system.get_env('ORACLE_HOME', :Ora_Home) ;
PL/SQL procedure successfully completed
Ora_Home
---------
C:\app\Venky\product\11.2.0\dbhome_1
SQL> Print ORA_HOME;
Ora_Home
---------
C:\app\Venky\product\11.2.0\dbhome_1
In Unix , after setting Variable, we can use below one (By the way to set variable we need Oracle_Home :) so get oracle_home from developer tool).
$ echo $ORACLE_HOME
No comments:
Post a Comment