MINI MINI MANI MO
#!/bin/sh
#
# $Header: rdbms/src/client/tools/qpinv/qopiprep.bat /st_rdbms_18.0/1 2018/03/27 08:13:10 apfwkr Exp $
#
# qopiprep.bat
#
# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
#
# NAME
# qopiprep.bat - bat file for preprocessor
#
# DESCRIPTION
# bat file for external table preprocessor.
#
# NOTES
# .
#
# MODIFIED (MM/DD/YY)
# sspulava 03/16/18 - Bug 27699235 - CONTENT INCLUSION OF 27153641 IN
# DATABASE RU 18.0.0.0.0
# apfwkr 03/16/18 - Backport apfwkr_blr_backport_27153641_12.2.0.1.0
# from st_rdbms_12.2.0.1.0
# prprprak 07/03/17 - #25889413 Move opatch log out of OH
# prprprak 06/15/17 - #26285062 Remove parameter 'e' for Solaris
# prprprak 05/29/17 - #25671354 Appending PID to xml_file name
# agomezc 06/02/16 - set locale to valid string on supported platforms
# and verify xml file exist before running cat.
# sspulava 01/12/18 - BUG 27292298 - BLR BACKPORT OF BUG 27153641 ON TOP
# OF 12.2.0.1.0 (BLR #6231124)
# apfwkr 12/21/17 - Backport sspulava_sh_var_expansion_fix from unix
# sspulava 12/10/17 - 27153641 Fixing shell variable expansions DBSID and
# PD
# dkoppar 10/16/15 - #22026338 cleanup work area
# ssathyan 05/21/15 - #18592717 Move qopatch logs
# dkoppar 05/06/15 - #20979217 NLS issue
# dkoppar 02/05/15 - #20244108 remove unnecessary eval cycles
# dkoppar 07/22/14 - #19215058 append sid
# tbhukya 04/03/13 - Bug 16226172 : Forward merge of fix 16076845
# tbhukya 09/23/12 - Creation
#
cd $ORACLE_HOME
PATH=/bin:/usr/bin
export PATH
# sed tried to convert from one encoding to other in presence of LC_ALL
# or LANG settings. Since opatch returning UTF-8 based encoding we do not
# need such a conversion. So safely skip it
LANG_STR=`locale -a | grep -i 'en_us' | grep -i 'utf' | grep '8'`
if [ $? -eq 0 ] ; then
LANG="${LANG_STR}"; #Use a valid string for each supported platform.
else
LANG="en_US.utf8"; #if there was any utf-8 valid string, use default for Lin
fi;
unset LANG_STR;
export LANG
LC_ALL=''
export LC_ALL
# Option: "-retry 0" avoids retries in case of locked inventory.
# Option: "-invPtrLoc" is required for non-central-inventory
# locations. $OPATCH_PREP_LSINV_OPTS which may set by users
# in the environment to configure special OPatch options
# ("-jdk" is another good candidate that may require configuration!).
# Option: "-all" gives information on all Oracle Homes
# installed in the central inventory. With that information, the
# patches of non-RDBMS homes could be fetched.
DBSID=$ORACLE_SID
PD=$$
ORABASE=`$ORACLE_HOME/bin/orabasehome`
rm -rf $ORABASE/rdbms/log/xml_file_${DBSID}_${PD}.xml
$ORACLE_HOME/OPatch/opatch lsinventory -customLogDir $ORABASE/rdbms/log -xml $ORABASE/rdbms/log/xml_file_${DBSID}_${PD}.xml -retry 0 -invPtrLoc $ORACLE_HOME/oraInst.loc >> $ORABASE/rdbms/log/stout_${DBSID}_${PD}.txt
RETVAL=$?;
if [ $RETVAL -ne 0 ] ; then
# if execution was not successfull, then exit at this point.
exit $RETVAL;
fi;
unset RETVAL ;
if [ -f "$ORABASE/rdbms/log/xml_file_${DBSID}_${PD}.xml" ] ; then
cat $ORABASE/rdbms/log/xml_file_${DBSID}_${PD}.xml | sed 's/^ *//' | tr '\n' ' '
fi;
echo "UIJSVTBOEIZBEFFQBL";
rm -f $ORABASE/rdbms/log/xml_file_${DBSID}_${PD}.xml
rm -f $ORABASE/rdbms/log/stout_${DBSID}_${PD}.txt
OHA YOOOO