Find Instances and Listeners in Linux

by Seth Miller

I created this script to make it very easy to see which instances and listeners are running on my server. I mostly use it to make sure everything is down when patching in RAC. Stick it in your profile script, or better yet your /etc/bashrc so all users have access to it.

function pl {
echo
echo "Database Instances Running"
echo "=========================="
ps -ef | grep pmon | grep -v grep | tr -s ' ' | cut -d ' ' -f 8 | cut -d '_' -f 3 | sort
echo
echo "Listeners Running"
echo "=========================="
ps -ef | grep tns | grep -v grep | tr -s ' ' | cut -d ' ' -f 9
echo
}