MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/lib/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/lib/olfstoolsdriver.sh

#!/bin/sh
#
#
# olfstoolsdriver.sh
#
# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
#
#    NAME
#      olfstoolsdriver.sh - front end for the Perl scripts that do the work.
#
#    DESCRIPTION
#     Common driver for olfsroot, olfsload 
#
#    NOTES
#      This wrapper program supports Linux/Unix platforms.
#
#      ORA_CRS_HOME and ORACLE_HOME have been exported by the caller
#      (see DESCRIPTION). They are NOT inherited from the shell.
#
#
#############################################################################

# One echo to just the console.
CLSECHO="$ORA_CRS_HOME/bin/clsecho -p usm -f olfs  -c err "
# One echo to the log, with timestamps.
CLSECHOTL="$ORA_CRS_HOME/bin/clsecho -p usm -f olfs -l -c err -t -n"
SED=/bin/sed
PATH=/bin:/usr/bin:/usr/sbin:/sbin:$PATH
PLATFORM=`uname`

# Add Solaris32 backward compatibility for LD_LIBRARY_PATH.  This extra
# path is used for Solaris64 Oracle homes that come with a Solaris32
# Perl build.
LD_LIBRARY_PATH="${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}"
LD_LIBRARY_PATH="${ORACLE_HOME}/lib32:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH

# AIX uses LIBPATH, not LD_LIBRARY_PATH.
if [ "${PLATFORM}" = "AIX" ] ; then
  LIBPATH="${ORACLE_HOME}/lib:${LIBPATH}"
  export LIBPATH
fi

# HP-UX uses SHLIB_PATH, not LD_LIBRARY_PATH.
if [ "${PLATFORM}" = "HP-UX" ] ; then
  SHLIB_PATH="${ORACLE_HOME}/lib32:${SHLIB_PATH}"
  export SHLIB_PATH
fi

# the basename of the command that the user entered
CMD=$1

# Set path to Perl.
PERLBIN="${ORACLE_HOME}/perl/bin/perl"

if [ ! -r $PERLBIN ] ; then
  # 621: "The user executing this command does not have permission to execute Perl in '%s'."
  ${CLSECHO} -m 621 $PERLBIN
  ${CLSECHOTL} -m 621 $PERLBIN
  if [ $CMD = "afddriverstate" ] ; then
    # 622: usage: %s [-orahome <ORACLE_HOME>] <installed | loaded | version | supported> [-s]
    ${CLSECHO} -m 622 $CMD
    ${CLSECHOTL} -m 622 $CMD
  else
    # 623: "Root access required."
    ${CLSECHO} -m 623
    ${CLSECHOTL} -m 623
  fi
  exit 1
fi

# Get Perl version.
PERLV=`${PERLBIN} -e 'printf "%vd", $^V'`

# Set PERLINC, which is a list of -I options passed to the perl
# interpreter, telling perl where to look for modules.
PERLINC="-I ${ORACLE_HOME}/perl/lib/${PERLV}"
PERLINC="${PERLINC} -I ${ORACLE_HOME}/perl/lib/site_perl/${PERLV}"

# if the OSD module is not found, the platform is not supported
#if [ ! -r $ORA_CRS_HOME/lib/osds_${CMD}.pm ] ; then
#  # 618: "OKA is not supported on $PLATFORM."
#  ${CLSECHO} -m 618 $PLATFORM
#  ${CLSECHOTL} -m 618 $PLATFORM
#  exit 1
#fi

PERLINC="${PERLINC} -I ${ORA_CRS_HOME}/lib"
CMD_LOC="${ORA_CRS_HOME}/lib/${CMD}.pl"

# Build command to execute the tool.
RUNTHIS="${PERLBIN} -w ${PERLINC} ${CMD_LOC}"

# Now run command with all arguments!
exec ${RUNTHIS} $@

# Should never get here.
exit -1

OHA YOOOO