Command to List the Oracle Databases Running on Linux Server

Generally we use ps -ef|grep pmon command to list the databases running on the database server. 

In this post I am going to mention
the commands to display only the database instances running on the Linux / Unix server. 

Commands:

ps -ef|grep pmon | awk '{print $8}'|grep -v "grep"|  grep -v "ASM"| cut -d"_" -f3

ps -eaf | grep _pmon_ | grep -v grep | grep -v + | grep -v "^#" | awk '{print $NF}' | cut -c 10-
advertisements
 
Demo

[oracle@TESTBOX exp]$ ps -ef|grep pmon | awk '{print $8}'|grep -v "grep"|  grep -v "ASM"| cut -d"_" -f3
cdb
PRODDEV1
PRODDEV2
[oracle@TESTBOX exp]$ ps -eaf | grep _pmon_ | grep -v grep | grep -v + | grep -v "^#" | awk '{print $NF}' | cut -c 10-
cdb
PRODDEV1
PRODDEV2

No comments:

Post a Comment