#!/bin/sh # # # Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. # # NAME # acfsdriverstate - front end for the Perl script that does the work. # # DESCRIPTION # Purpose # Verify USM installation/load/version/supported. # # # NOTES # This wrapper program supports only Lunix/Unix platforms. # Use acfsdriverstate.bat for Windows platforms. # ############################################################################# ORA_CRS_HOME=/ade/aime_adc00jzc/oracle if [ ! -d $ORA_CRS_HOME ]; then ORA_CRS_HOME=$ORACLE_HOME fi # If ORA_CRS_HOME is still not right - that is, it does not # contain our libraries, it means that the script is being run before it is # instantiated with an env variable that is not right (perhaps a db home instead # of a GI home). We will try one last time to find a good # GIHome to run from. # This is because acfsdriverstate must be able to run # before acfsroot is run - the patch and install setup uses # this script to tell if ACFS is supported, and it is run # before our scripts are instantiated. # So we try and use the path we are running from, where we assume # that this is a GI home. if [ ! -r $ORA_CRS_HOME/lib/osds_acfsdriverstate.pm ] ; then # Take the path we are running from, which we assume is the # GI Home/bin and go one level up to find the GI Home. # Since we are only concerned with finding the library # we don't need to find the canonical path or anything like that. # If we were connecting to ASM, we would need the same canonical # path that ASM was running from. ORA_CRS_HOME=`dirname $0` # ORA_CRS_HOME now == '.' if we are running the cwd. # Otherwise, if we had an absolute path, we have a real name there. # so, if it == '.', just use 'pwd'. if [ "$ORA_CRS_HOME" = "." ] ; then ORA_CRS_HOME=`pwd` fi # Following was tested on AIX, Solaris, Linux under /bin/sh. # Strips the ending 'bin' directory from the path name. # This assumes we are always running acfsdriverstate from a directory # called bin. # This should be a valid assumption - shiphomes always have it in # GIHome/bin. Patches (including acfspatchcreate) as well. # (True to form, bourne shell on solaris is missing substitutions.) # The following expr command will return everything from the left up to # the final '/bin'. It has been tested with /1/2/3/4/bin and # /1/2bin/3/bin, and appears to work well. # In ADE, if run from usm/bin, with no ORACLE_HOME or ORA_CRS_HOME # set in the env, this will look in usm/lib for the # tools driver, but that is no different from current state. ORA_CRS_HOME=`expr $ORA_CRS_HOME : '\(.*\)/bin.*'` fi CMDNAME=acfsdriverstate # I don't like this. If the user runs with no arguments, perhaps to find # the help, then this will give back a bogus # error of "user does not have permission to run perl in this dir" # in some cases. if [ $# -gt 0 ] ; then if [ $1 = "-orahome" ] ; then ORACLE_HOME=$2 shift # pop -orahome shift # pop fi fi #use clsecho if available, if not, default to echo which $ORA_CRS_HOME/bin/clsecho > /dev/null 2>&1 if [ "$?" = "0" ]; then ECHO=$ORA_CRS_HOME/bin/clsecho else ECHO=echo fi # If the user passed a non existent ORACLE_HOME, fall back to ORA_CRS_HOME. if [ -n "$ORACLE_HOME" ] && [ ! -d "$ORACLE_HOME" ]; then $ECHO '[WARNING]' 09389: ORACLE_HOME is not set to the location of the \ Grid Infrastructure home. unset ORACLE_HOME fi if [ -z "$ORACLE_HOME" ]; then ORACLE_HOME=$ORA_CRS_HOME fi TOOLS_DRIVER=${ORA_CRS_HOME}/lib/acfstoolsdriver.sh export ORA_CRS_HOME export ORACLE_HOME exec $TOOLS_DRIVER $CMDNAME $@ # Should never get here. exit -1