How To Get ORACLE_HOME From SQL

In many occasions we need to know the ORACLE_HOME of a database. To get this value we usually go to the operating system and look at the environment variable ($ORACLE_HOME for unix environments,%ORACLE_HOME% in Windows environments or ORACLE_HOME logic in VMS environments). Now from the database we can get this value (if I’m not wrong from version 12c) with the following query;

SELECT SYS_CONTEXT (‘USERENV’,’ORACLE_HOME’) FROM DUAL;

HTH – Antonio NAVARRO

Advertisements

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