Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.4K Intelligent Advisor
- 75 Insurance
- 537.7K On-Premises Infrastructure
- 138.7K Analytics Software
- 38.6K Application Development Software
- 6.1K Cloud Platform
- 109.6K Database Software
- 17.6K Enterprise Manager
- 8.8K Hardware
- 71.3K Infrastructure Software
- 105.4K Integration
- 41.6K Security Software
Reading Oracle Instance Names from /etc/oratab file

Hi Gurus,
I have oracle RAC setup and wanted to read database instance entries from /etc/oratab file Now I have put in the Instance SID for the databases DBTEST and DBQA.
/etc/oratab from Node 1 which is running 2 oracle instances DBTEST1 and DBQA1 and one ASM instance +ASM1
DBTEST1:/u02/app/oracle/product/18.0.0.0/dbhome_1:Y
DBTEST1_ord18t:/u02/app/oracle/product/18.0.0.0/dbhome_1:Y
DBQA1:/u02/app/oracle/product/18.0.0.0/dbhome_3:Y
DBQA1:_ord3m:/u02/app/oracle/product/18.0.0.0/dbhome_3:Y
+ASM1:/u01/app/19.0.0.0/grid:N
I need to extract the Oracleinstance Name from these oratab files. I am using the following command which is returning the instance name and database name.
cat /etc/oratab|egrep ':N|:Y'|grep -v \*|cut -f1 -d':'
DBTEST1
DBTEST1_ord18t
DBQA1
DBQA1:_ord3m
+ASM1
But i need the output as follows
DBTEST1
DBQA1
+ASM1
Please help me which the script or command which will give me the instance name only from the /etc/oratab file.