Advertisement

Monday, January 7, 2019

Oracle Database : How to List Environment Variables of a Process (Linux)

I always wanted to know when debugging an issue as a DBA, if the database was started using the right variables and it took quite a lot of time. 

Today I want to introduce you to a simple way of doing that. 

Method in Linux - 

Step 1. Get the process ID
ps -ef | grep smon

Step 2. strings/proc/<pid from above>/environ

ps -ef | grep smon
oracle   30846     1  0  2018 ?        00:00:48 ora_smon_EMREP

strings  /proc/30846/environ
HOSTNAME=lx03294d
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
TMPDIR=/tmp
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P15
USER=oracle
LD_LIBRARY_PATH=/opt/oracle/product/12.2/lib
ORACLE_SID=EMREP
ORA_NLS10=/opt/oracle/product/12.2/nls/data
ORACLE_BASE=/opt/oracle
MAIL=/var/spool/mail/oracle
PATH=
PWD=/opt/oracle/product/12.2/dbs
EDITOR=vi
LANG=en_US.UTF-8
AGENT_HOME=/opt/oracle/agent
ORACLE_TERM=vt100
HISTCONTROL=ignoredups
SHLVL=1
HOME=/opt/oracle
TMP=/tmp
LOGNAME=oracle
LESSOPEN=||/usr/bin/lesspipe.sh %s
ORACLE_HOME=/opt/oracle/product/12.2
OMS_HOME=/opt/oracle/middleware
_=/opt/oracle/product/12.2/bin/sqlplus
OLDPWD=/opt/oracle
ORA_NET2_DESC=10,13
ORACLE_SPAWNED_PROCESS=1
SKGP_HIDDEN_ARGS=<FATAL/S/SMON/x0/xF/x0/x819B398A/30792/30703/xE/x10/x1/x819B3F02/1545055463/1545055463>
SKGP_SPAWN_DIAG_PRE_EXEC_TS=1545055463
SKGP_SPAWN_DIAG_PRE_FORK_TS=1545055463

SKGP_SPAWN_DIAG_POST_FORK_TS=1545055463


For Other OS see below - 
Reference: How to Check the Environment Variables for an Oracle Process (Doc ID 373303.1)

1 comment:
Write comments