Read ORACLE_SID and ORACLE_HOME Inside PL/SQL Code

 DECLARE 

   V_ORACLE_HOME  VARCHAR2 (2000); 
   V_ORACLE_SID  VARCHAR2 (256); 

 BEGIN 

   DBMS_SYSTEM.GET_ENV (‘ORACLE_HOME’, V_ORACLE_HOME); 
   DBMS_SYSTEM.GET_ENV (‘ORACLE_SID’, V_ORACLE_SID ); 
  
   –The below line will print Oracle_home
   DBMS_OUTPUT.PUT_LINE (‘ORACLE_HOME :- ‘ || V_ORACLE_HOME); 
  
   — the below line will print Oracle_SID
   DBMS_OUTPUT.PUT_LINE (‘ORACLE_HOME :-‘ || V_ORACLE_SID); 
 END; 

Reference :
1-OTN Forum

Thank you
Osama Mustafa

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.