Oracle Articles, Oracle Tools, Oracle Tips, Database Articles and DBA Tips  

The Largest Online Resource for Oracle Articles, Oracle Tips, Oracle Scripts & Oracle Tools!!


Enter your Email:
 
Navigate at FreeMegaZone Home      Articles      Tools      Jobs      Games      Support      Submit Content      Advertise
Advertise at http://www.articles.freemegazone.com

Advertise at FreeMegaZone

Give tremendous boost to your business by advertising at FreeMegaZone. Contact webmaster@freemegazone.com

 


Rating: *****                                             Rate this article:    

 Author: Jason Peter

Page: 1 2

As a database administrator or Oracle developer you have to deal with ORACLE_HOME all the time. An ORACLE_HOME is basically an Oracle variable which defines the environment for Oracle products to run. ORACLE_HOME contains subdirectories for Oracle software executables and network files. In this article we will discuss some amazing tips that will help you solve day to day issues you encounter with ORACLE_HOME.

Finding ORACLE_HOME:

There are a number of options available that will help you check ORACLE_HOME. Some of these are as under. Article Continues below...

Oracle 9i

SELECT SUBSTR(FILE_SPEC,1,INSTR(FILE_SPEC,'LIB')-2) ORACLE_HOME
FROM DBA_LIBRARIES
WHERE LIBRARY_NAME='DBMS_SUMADV_LIB';

or

SELECT NVL(SUBSTR(FILE_SPEC, 1, INSTR(FILE_SPEC, ‘\', -1, 2) -1) , SUBSTR(FILE_SPEC, 1, INSTR(FILE_SPEC, ‘/', -1, 2) -1)) FOLDER
FROM DBA_LIBRARIES
WHERE LIBRARY_NAME = ‘DBMS_SUMADV_LIB'

Oracle 10g

SQL > VAR OHM VARCHAR2(100);
SQL > EXEC DBMS_SYSTEM.GET_ENV('ORACLE_HOME', :OHM) ;
SQL > PRINT OHM

or

DECLARE
FOLDER VARCHAR2(100);
BEGIN
SYS.DBMS_SYSTEM.GET_ENV('ORACLE_HOME', FOLDER);
DBMS_OUTPUT.PUT_LINE(FOLDER);
END;

Linux/Unix

echo $ORACLE_HOME

Windows

  1. Click Start > Run on your PC.
  2. Type "regedit" and press Return/Enter
  3. The registry will now be displayed
  4. Expand the folder as HKEY_LOCAL_MACHINE – SOFTWARE – ORACLE

Finding ORACLE_HOME Used to Start an Instance:

You can find the ORACLE_HOME used to start the instance by running below commands.

SQL> SET AUTOPRI ON
SQL> VAR ORACLE_HOME VARCHAR2(255)
SQL> EXEC DBMS_SYSTEM.GET_ENV('ORACLE_HOME',:ORACLE_HOME)

Finding ORACLE_HOME from Data Dictionary:

You can find ORACLE_HOME from Data Dictionary by running below command.

UNIX

SELECT SUBSTR(FILE_SPEC, 1, INSTR(FILE_SPEC, '/', -1, 2) -1)
FROM DBA_LIBRARIES
WHERE LIBRARY_NAME = 'DBMS_SUMADV_LIB'

Windows

SELECT SUBSTR(FILE_SPEC, 1, INSTR(FILE_SPEC, '\', -1, 2) -1)
FROM DBA_LIBRARIES
WHERE LIBRARY_NAME = 'DBMS_SUMADV_LIB'

Viewing ORACLE_HOME Installed Products and Version:

You can run below command to view everything installed and its version in your $ORACLE_HOME.

cd $ORACLE_HOME/orainst
./inspdver

Viewing ORACLE_HOME Files from Browser:

You follow below steps to view ORACLE_HOME directory structure of UNIX application from browser.

  1. Create a softlink for your ORACLE_HOME in the htdocs directory.
    ln -s $ORACLE_HOME oraclehome
  2. Access Oracle_Home from your browser as follows.
    http://server.oracle.com:7777/oraclehome/

Finding installed patches in $ORACLE_HOME:

In UNIX/Linux machine you can find which pataches are installed in your $ORACLE_HOME by running below command.

$ cd $ORACLE_HOME/OPatch
$ ./opatch lsinventory

Continued...

Page: 1 2

 More Oracle Articles, Database Articles and DBA Tips
   Database Security: Step by step guideline
   DBA Tips for Shrinking Oracle Datafiles!!
   Disk I/O Tuning with Oracle RAID Stripe Size!!
   Best Practice for Multiple Oracle Homes!
   Handling Tricky Oracle Job Scheduling Problem!!


FreeMegaZone Jobs!!

 

 
HOME      ABOUT US      SUPPORT      SITE MAP      PRIVACY POLICY      TERMS OF USE      SUBMIT CONTENT      ADVERTISE
Copyright © 2007 - 2012 Oriole Intellect Inc. All rights reserved.

The name Oracle is a trademark of Oracle Corporation. Any other names used on this website may be trademarks of their respective owners