Return-Path: <oracle-l-bounce@freelists.org>
X-Original-To: oracle-l@orafaq.com
Delivered-To: oracle-l@orafaq.com
Received: from puck1183.startdedicated.com (localhost [127.0.0.1])
 by puck1183.startdedicated.com (Postfix) with ESMTP id E69E51960294
 for <oracle-l@orafaq.com>; Thu,  6 Jun 2013 20:55:01 +0200 (CEST)
Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180])
 by puck1183.startdedicated.com (Postfix) with ESMTP
 for <oracle-l@orafaq.com>; Thu,  6 Jun 2013 20:55:01 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 30C8A22F1F;
 Thu,  6 Jun 2013 14:41:50 -0400 (EDT)
Authentication-Results: turing.freelists.org; dkim=fail
 (verification failed; insecure key) header.i=@gmail.com;
 dkim-adsp=none (insecure policy)
X-Virus-Scanned: Debian amavisd-new at turing.freelists.org
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id x+NHNAcXqodl; Thu,  6 Jun 2013 14:41:50 -0400 (EDT)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 3960222EA9;
 Thu,  6 Jun 2013 14:41:08 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Thu, 06 Jun 2013 14:40:27 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id F40EB22E83
 for <oracle-l@freelists.org>; Thu,  6 Jun 2013 14:40:26 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id zkPpXi3233tU for <oracle-l@freelists.org>;
 Thu,  6 Jun 2013 14:40:26 -0400 (EDT)
Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B32B622E82
 for <oracle-l@freelists.org>; Thu,  6 Jun 2013 14:40:26 -0400 (EDT)
Received: by mail-vb0-f49.google.com with SMTP id q13so2174677vbe.8
        for <oracle-l@freelists.org>; Thu, 06 Jun 2013 11:53:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc:content-type;
        bh=MsIswSu2pzKwjvAP3Yzc17NN0iwN4RHAPOjak4+9pq4=;
        b=Q9gDap/x3nw20/z7P56kpCQpUz2IFe966su6waYZbFYIt3rR2xv+9tQxy7kBNVE2nn
         2V26onw9dXEIR4OC+Q42mUYIMZY/Y5t0J0jHUVoPFi5GPMvScJiDotZeasJBSFggdUSg
         mxSqjBxBys43eVwzMh/uS37+/HSElK0qB4X3h4/V327v/RXJMq9y3fiMH+H0ZAe1K77m
         zgca0OUKOdoJra2Ix+3H9vhXgdtb25y17bDQlP79b+GHH+L3KMgaUbhCWHxCemvh+pqC
         gqjLodDSFij5faiXg384JkTQ0u9vxlHYSuguSyW3hU4hi8sKj74BIM1K/sL8zrrhiJck
         0zzg==
MIME-Version: 1.0
X-Received: by 10.220.83.138 with SMTP id f10mr22598990vcl.7.1370544815348;
 Thu, 06 Jun 2013 11:53:35 -0700 (PDT)
Received: by 10.220.96.138 with HTTP; Thu, 6 Jun 2013 11:53:35 -0700 (PDT)
In-Reply-To: <96FC82DA2FD4354D9A8B8434B6E7003D209E59C9@COL0SGEM20.AD.DLA.MIL>
References: <96FC82DA2FD4354D9A8B8434B6E7003D209E59C9@COL0SGEM20.AD.DLA.MIL>
Date: Thu, 6 Jun 2013 20:53:35 +0200
Message-ID: <CAJ2-Qb8hXNGdbj-wziVCPNwgMgzLA5WjJKgdXvT9fV4huquH9A@mail.gmail.com>
Subject: Re: auto start a data guard physical standby Oracle 11.2
From: Ls Cheng <exriscer@gmail.com>
To: Tom.Terrian.ctr@dla.mil
Cc: Oracle Mailinglist <oracle-l@freelists.org>
Content-type: text/plain
Content-Transfer-Encoding: 8bit
X-archive-position: 49221
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: exriscer@gmail.com
Precedence: normal
Reply-To: exriscer@gmail.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l

Hi
Any reason not use Data Guard in 11g? It works pretty good in 11g.

In ther other hand a few years ago I had to do a db startup script in Linux
for DG, the code is roughly following. If you are using RAC then use the
srvctl command you have mentioned.


start_db()
{
    # Parameter 1 -> Oracle SID
    ORACLE_SID=$1
    # Do not start oracle until the /u02/oradata fs is mounted
    if [ ! -d $ORADATA ]; then
        echo "$ORADATA not mounted..."
        return 1
    fi

    tmpfile='/tmp/oracle-init.tmp'
    dgfile='/tmp/oracle-dg.tmp'

    echo "startup mount" > $tmpfile
    echo "set pagesize 0" >> $tmpfile
    echo "select 'DB_ROLE:' || decode(DATABASE_ROLE, 'PRIMARY', 'FALSE',
'TRUE') from v\$database;" >> $tmpfile
    echo "quit" >> $tmpfile

    $SUBIT "export ORAENV_ASK=NO; export ORACLE_SID=$ORACLE_SID; .
/usr/local/bin/oraenv; sqlplus / as sysdba" < $tmpfile | tee -a $LOGFILE |
tee $dgfile > /dev/null

    result=$?

    if [ $result -ne 0 ]; then
        echo "Oracle DB did not mount..."
        return 1
    fi

    ISDG=`grep DB_ROLE $dgfile | awk -F":" '{ print $2 }'`
    if [ "$ISDG" == "FALSE" ]; then
        echo "alter database open;" > $tmpfile
        echo "quit" >> $tmpfile
    else
        echo "alter database recover managed standby database using current
logfile;" > $tmpfile
        echo "quit" >> $tmpfile
    fi

    $SUBIT "export ORAENV_ASK=NO; export ORACLE_SID=$ORACLE_SID; .
/usr/local/bin/oraenv; sqlplus / as sysdba" < $tmpfile >> $LOGFILE

    result=$?

    if [ $result -ne 0 ]; then
        #echo "Oracle DB did not start..."
        return 1
    else
        return 0
    fi
}

Regards


--
http://www.freelists.org/webpage/oracle-l


