Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Querying environment variables
> On Dec 4, 12:40 pm, "stever" <steve.rainb..._at_mssint.com> wrote:
>> Is it possible from inside a pl/sql block to query the environment
>> variables that were set when the database was started?
>>
>> I don' t beleive I am the only person who has asked this, but cannot
>> find the answer anywhere.
[...]
"stever" <steve.rainbird_at_mssint.com> wrote in message
news:1165239654.317628.43510_at_73g2000cwn.googlegroups.com...
> Thanks to Laurnet in the oracle forums I have the following solution
>
> SQL> var f varchar2(40)
> SQL> set autop on
> SQL> exec dbms_system.get_env('PWD',:f)
[...]
That's your client env, not the server env:
$ . oraenv
ORACLE_SID = [oracle] ? ora1022
$ /usr/ucb/ps auxwwe | sed -n
'/[o]ra_smon_ora1022/s/\(.*\)\(TZ=...\)\(.*\)/\2/p'
TZ=MET
$ export TZ=GMT
$ printf "%s\n" "set lines 10" "var f varchar2(40)" "set autop on" \
> "exec dbms_system.get_env('TZ',:f)" |
> sqlplus -s / as sysdba
PL/SQL procedure successfully completed.
F