AIX question

From: Andrew Kerber <andrew.kerber_at_gmail.com>
Date: Tue, 3 Jun 2014 21:12:18 -0500
Message-ID: <CAJvnOJZvRehXxp83cM+5JgAVEpbkNuTsHW2SpXVPAVUvH7qzzA_at_mail.gmail.com>



I have a script that runs the loop below:

for ORACLE_SID in `ps -e -o="CMD" | grep smon|grep -v grep| awk -F "_"
'{print$3}'`

do
....
done

The problem that just came up is a rac one node instance, where the ORACLE_SID is orcl_1 or orcl_2

So the script above, in a standard rac instance would find orcl1 or orcl2, which is what I want. But with Rac one node, and the underscore in the name it just extracts orcl, when I need to extract orcl_1.

Can one of you scripting gurus show me a corrected version of that for loop that gets the correct ORACLE_SID?

-- 
Andrew W. Kerber


'If at first you dont succeed, dont take up skydiving.'
-- http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 04 2014 - 04:12:18 CEST

Original text of this message