Discovery of Oracle databases and installations
During configuration of an Oracle environment the user can choose to use an automatic discovery of Oracle databases and installations. The discovery is an alternative for a manual entry of all the details. The discovery is the same on both source (GI) and target (VDB).
Process
The process of discovery is done in stages:
Find all running Oracle database instances
ps -ef | grep pmon | grep -v grep | awk '{print $2}'
For each running Oracle database instance - its Oracle home is calculated
strings /proc/%s/environ | egrep 'ORACLE_HOME'
For each running Oracle database instance - its Oracle SID is calculated
strings /proc/%s/environ | egrep 'ORACLE_SID'
For each running Oracle database instance - a listener process that runs from the same Oracle home is calculated (
%s
- Oracle home)ps -ef |grep tns | grep -v grep | grep \"%s\" | awk '{print $2}'
For each listener - its port is calculated (
%s
- listener process id)netstat -ltnp | grep %s | grep -v \"127.0.0.1\" | grep -v grep | awk '{print $4}'
For each Oracle home - its OS owner is calculated (
%s
- Oracle home)ls -ltrd %s | awk '{print $3}'
Â
Output
A list where each item includes:
Oracle home directory
Oracle SID
OS user
Listener port