RE: oraenv and ASM instance

  • From: "Hallas, John (EXP N-ARM)" <john.hallas@xxxxxxxx>
  • To: tony@xxxxxxxxxxxxxxx, oracle-l@xxxxxxxxxxxxx
  • Date: Fri, 10 Aug 2007 16:11:58 +0100

Metalink note 338441.1 refers

To summarise - a known bug (in 10.1)

Fix  - 

Edit dbhome and change the following block of code:

Change:

case "$ORASID" in
    NOTSET)     # ORACLE_SID not passed in and not in environment
                RET=2
                ORAHOME="$ORACLE_HOME" ;;

    *)  # ORACLE_SID was set or provided on the command line
        if test -f $ORATAB ; then
            # Try for a match on ORASID in oratab
            # NULL SID is * in oratab
            case "$ORASID" in
                "")     ORASID='\*' ;;
            esac
            
            ORAHOME=`awk -F: "/^${ORASID}:/ {print \\$2; exit}"\
                        $ORATAB 2>/dev/null`
            
        fi ;;
esac


To:

 case "$ORASID" in
    NOTSET)     # ORACLE_SID not passed in and not in environment
                RET=2
                ORAHOME="$ORACLE_HOME" ;;

    *)  # ORACLE_SID was set or provided on the command line
        if test -f $ORATAB ; then
            # Try for a match on ORASID in oratab
            # NULL SID is * in oratab
            case "$ORASID" in
                "")     ORASID='\*' ;;
            esac

            if [ $ORASID = "+ASM" ] ; then
              ORAHOME=`awk -F: "/^\+ASM:/ {print \\$2; exit}" $ORATAB
2>/dev/null`
            else
              ORAHOME=`awk -F: "/^${ORASID}:/ {print \\$2; exit}"\
                        $ORATAB 2>/dev/null`
            fi
        fi ;;
esac
 

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of S. Anthony Sequeira
Sent: 10 August 2007 14:16
To: oracle-l@xxxxxxxxxxxxx
Subject: oraenv and ASM instance

Hi,

Something that has been bothering me for a while.  I know it's no
biggie, just a bit of a pain.

I cannot use oraenv to change the default instance to the +ASM
instance,  I haven't the time to go through and fix the script, just
wondering whether anyone has done so.

$ cat /var/opt/oracle/oratab
+ASM:/u01/app/oracle/product/10.2.0/ASM:Y
testbed:/u01/app/oracle/product/10.2.0/Db_1:Y
mpnfdb:/u01/app/oracle/product/8.1.7:N
*:/u01/app/oracle/product/9.2.0:N
$ . oraenv
ORACLE_SID = [tsequeira] ? +ASM
ORACLE_HOME = [/export/home/oracle] ?
$ . oraenv
ORACLE_SID = [+ASM] ? '+ASM'
ORACLE_HOME = [/export/home/oracle] ?
$ . oraenv
ORACLE_SID = ['+ASM'] ? "+ASM"
ORACLE_HOME = [/export/home/oracle] ?
$ . oraenv
ORACLE_SID = ["+ASM"] ? \+ASM
ORACLE_HOME = [/export/home/oracle] ?
$
-- 
Tony

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


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


Other related posts: