Read OS environment variables using DBMS_SYSTEM.GET_ENV()

Check out this article by Vikram Das about how to read OS environment variables using PL/SQL.

I did not know that!

This entry was posted in Cool stuff, Oracle and tagged . Bookmark the permalink.

5 Responses to Read OS environment variables using DBMS_SYSTEM.GET_ENV()

  1. Tanel Poder says:

    Note that Oracle 9.2 doesn’t have this procedure, 10.2 has (and I didn’t test 10.1)

  2. Maxim says:

    It depends, what the environment is referred to – in my quick test, it seems to return the actual environment for beq connections and the environment, oracle instance was started with – for Net 8 connections.

    Best regards

    Maxim

  3. Tanel Poder says:

    Yes, because the BEQ connections are spawned by your user shell, but Net8 connections by the listener.

    For some troubleshooting purposes I’ve used such technique in past that I’ve created another “debug” listener which I started with LD_PRELOAD pointing to a custom library (which did some function call tracing) and only the users connecting through the debug listener would have the tracing enabled…

  4. Chris Poole says:

    This API was introduced in 10.1, as I noted two years ago…!

  5. Mark Brady says:

    A search of Oracle documentation for 10.2 and 11.1 returns no results in the PL/SQL supplied packages reference, what gives?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>