Re: Custom env variable in Oracle
Date: Tue, 21 Apr 2009 21:22:55 +0100
sys.dbms_system.get_env(’ORACLE_HOME’, folder); dbms_output.put_line(folder);
END; SQL> connect sys/pwd as sysdba
SQL> grant execute on dbms_system to testuser 2 /
SQL> connect testuser/testuser
SQL> set serverout on size 2000
2 folder VARCHAR2(100);
4 sys.dbms_system.get_env('ORACLE_HOME', folder); 5 dbms_output.put_line(folder);
PL/SQL procedure successfully completed.
Note of course that this will only tell you the environment of the oracle shadow process, not the environment of the calling user.
If sqlplus is the only client you are worried about, and if your users are well behaved, you could simply use a login.sql or glogin.sql which itself calls DBMS_APPLICATION_INFO.SET_CLIENT_INFO.
2009/4/21 Herring Dave - dherri <Dave.Herring_at_acxiom.com>
> I’ve got a need to somehow capture information about a session at the OS
> level and alter an Oracle’s session based on that previously found info.
> Something to the effect of checking an env. variable and setting
> DBMS_APPLICATION_INFO.SET_CLIENT_INFO accordingly. I think my only option
> is to create an external procedure that is called from a logon trigger, but
> maybe I’m missing something.