Thursday, September 15, 2016

pse util to get the proccsses

Create the .aliases file
Added below lines in .aliases at oracle home directory in my case it was /home/oracle
alias pse='ps -ef | grep -v grep | grep '
alias psg='ps -ef | grep -v grep | grep '
Modify .bashrc
Modified the .bashrc file so that new .aliases is there. My file is 
[oracle@o12c (cdb1) ~]$ cat .bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
# User specific aliases and functions
if [ -f $HOME/.aliases ]
then
  . $HOME/.aliases
fi
[oracle@o12c (cdb1) ~]$ 
Now simply run pse command with process name it saves some time.

[oracle@o12c (cdb1) ~]$ pse tns
root        13     2  0 16:03 ?        00:00:00 [netns]
oracle    2758     1  0 16:05 ?        00:00:00 /u01/app/oracle/product/12.1.0.2/db_1/bin/tnslsnr listener -inherit
[oracle@o12c (cdb1) ~]$ 
[oracle@o12c (cdb1) ~]$ pse smon
oracle    2507     1  0 16:04 ?        00:00:00 ora_smon_cdb1

[oracle@o12c (cdb1) ~]$ 


No comments: