Re: AIX question

From: saurabh manroy <saurabhmanroy_at_gmail.com>
Date: Wed, 4 Jun 2014 16:43:39 +0200
Message-ID: <CAELkjfWEZLK9X=JM8e5Bf016hoW4vvi_NmNXkJazVSC0r7E_pw_at_mail.gmail.com>



Sorry, I think I need some more coffee...

ps -ef |grep ora_pmon | grep -v grep | awk '{ print $NF}' | awk -F "ora_pmon_" '{print $2}'

Regards,

On Wed, Jun 4, 2014 at 4:10 PM, saurabh manroy <saurabhmanroy_at_gmail.com> wrote:

> Another way:
>
> Tested on AIX (korn shell):
>
> ps -ef |grep ora_pmon | grep -v grep | awk '{ print $NF}' | awk -F "_"
> '{$1=$2=""; print $0}' | tr -d " "
>
> Regards,
> Saurabh Manroy
>
>
>
>
>
>>>
>>> On 04/06/14 12:12, Andrew Kerber wrote:
>>>
>>>> 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.'
>>>>
>>>
>>>
>>
>>
>> --
>> 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 - 16:43:39 CEST

Original text of this message