Read OS environment variables using DBMS_SYSTEM.GET_ENV()

March 27th, 2009

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

I did not know that!

  • Share/Bookmark

Tanel Poder
Cool stuff, Oracle, PL/SQL

  1. Trackbacks

  2. No trackbacks yet.
  1. Comments

  2. March 27th, 2009 at 12:39 | #1

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

  3. Maxim
    March 27th, 2009 at 14:38 | #2

    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

  4. March 27th, 2009 at 14:41 | #3

    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…

  5. March 27th, 2009 at 17:46 | #4

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