onstat -g env Show Environment
The onstat -g env command displays the starting environment for engine, and
the command onstat -g env sid displays the environment for the session
Server start-up environment:
Variable Value [values-list]
CLIENT_LOCALE en_US.8859-1
DBDATE DMY4
DBDELIMITER |
DBPATH .
DBPRINT lp -s
DBTEMP /tmp
INFORMIXDIR /usr/local/informix
[/usr/local/informix]
[/usr/informix]
INFORMIXSERVER oninit_net
INFORMIXTERM termcap
LC_COLLATE en_US.819
LC_CTYPE en_US.819
LC_MONETARY en_US.819
LC_NUMERIC en_US.819
LC_TIME en_US.819
LD_LIBRARY_PATH :/usr/local/informix/lib:/usr/local/informix/lib/esql:/usr/
local/informix/lib/tools
LKNOTIFY yes
LOCKDOWN no
NODEFDAC no
ONCONFIG onconfig.strider
PATH /usr/sbin:/usr/bin:/usr/local/bin:/usr/ccs/bin:/usr/local/i
nformix/bin
SERVER_LOCALE en_US.819
SHELL /bin/ksh
TERM vt100
[vt100]
[dumb]
TERMCAP /etc/termcap
TZ GB
</div>
| Option | Description |
|---|---|
| onstat -g env | Displays the settings of environment variables when the database server was started Does not display environment variables that have not been set explicitly. |
| onstat -g env all | Displays the settings used by all sessions This display is the same as the output of onstat -g env and onstat -g envsessionid iteratively on all current sessions. |
| onstat -g env variable | Displays the default value of the specified environment variable |
| onstat -g env sessionid | Displays the settings that a specific session uses. This display includes the following values: Set in the environment of the session Assigned by the database server, as onstat -g env displays |
| onstat -g env sessionid variable | Displays the value of the specified environment variable that the specified session uses The sessionid and variable arguments eliminate the need to pipe the output to grep (or some other utility) to locate an environment variable among many that might be set. |
Notes
The onstat -g env command displays the current setting of an environment variable
and the complete list of values each time the variable was set in the environment.
For example, if PDQPRIORITY is set to 10 in the .informix.rc file and set to 55
in the shell environment, onstat -g env command displays both values.
However, if you change the PDQPRIORITY with the onmode -q pdqpriority sessionid command, the onstat -g env command does not display the new value for the session. The onstat -g env command displays only the values of environment variables set in the environment. It does not display values modified while the session is running.
The information can be accessed via sysmaster:sysenv, but only the environment variables that are directly related to Informix so if export MYENV_VAL=1 would not be available. However, the following UDR will access any enviroment variable
However, if you change the PDQPRIORITY with the onmode -q pdqpriority sessionid command, the onstat -g env command does not display the new value for the session. The onstat -g env command displays only the values of environment variables set in the environment. It does not display values modified while the session is running.
The information can be accessed via sysmaster:sysenv, but only the environment variables that are directly related to Informix so if export MYENV_VAL=1 would not be available. However, the following UDR will access any enviroment variable
/*@unused@*/static char WhatStr[] = "@(#)oninit.1.0/getenv.c(2015/04/16
08:57)";
#ifdef __cplusplus
extern "C"
{
#endif
/* Standard library includes. */
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
/* Used by Informix GLS routines. */
#include <ifxgls.h>
#include <mi.h>
UDREXPORT
mi_lvarchar *oni_getenv
(
mi_lvarchar *lv,
MI_FPARAM *fparam
)
{
char *s;
char *s1=NULL;
mi_lvarchar *lv1=NULL;
s=mi_lvarchar_to_string(lv);
if(s==NULL)
mi_db_error_raise(NULL, MI_EXCEPTION, "Invalid request");
s1=getenv(s);
if(s1==NULL)
mi_fp_setreturnisnull(fparam, 0, (mi_integer)MI_TRUE );
else
lv1=mi_string_to_lvarchar(s1);
mi_free(s);
return(lv1);
}
#ifdef __cplusplus
}
#endif