Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 E-mail Us
 Oracle Articles
New Oracle Articles

 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog

 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Oracle Support

 SQL Tuning

 Oracle UNIX
 Oracle Linux
 Remote s
 Remote plans
 Application Server

 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S


 Consulting Staff
 Consulting Prices
 Help Wanted!


 Oracle Posters
 Oracle Books

 Oracle Scripts

Don Burleson Blog 







Display OS variables with dbms_system.get_env

Oracle Database Tips by Donald BurlesonApril 7,  2015

Question:  I want to display OS variables from within my PL/SQL for Oracle applications environment variables.  Is it possible to shell out of PL/SQL and see the current value of OS environment variables?

Answer:  Yes!  Oracle can indeed go out to the OS and gather environmental settings!

We have several procedures and packages within Oracle that allow us to get out of the OS:

  • dbms_system.get_env - Gets OS variables
  • sys_context - Gets the IP address from within PL/SQL
  • utl_inaddr.get_host_address - Gets the hostname from  inside PL/SQL

For complete details, see the great book "Advanced Oracle Utilities", with lots of working examples of using the Oracle utilities inside PL/SQL.

Below, we see dbms_system,get_env used to gather the value of the APPL_TOP environment variable:

var APPL_TOP varchar2(255)
exec dbms_system.get_env('APPL_TOP',:APPL_TOP);

Here is another example of using dbms_system.get_env to display the ORACLE_HOME OS environment variable (for this session):

create or replace procedure getvar(envar in varchar2) as
buffer varchar2(300);
dbms_system.get_env(ENVAR, BUFFER);
Procedure created.
SQL> exec getvar('ORACLE_HOME');
PL/SQL procedure successfully completed.

As you can see, Oracle has several utilities for displaying external information.

For complete details, see the book "Advanced Oracle Utilities".



Oracle Training at Sea
oracle dba poster

Follow us on Twitter 
Oracle performance tuning software 
Oracle Linux poster


Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.