Skip to content
March 25, 2013 / doganay

HOW TO RE-CREATE ORAINVENTORY

#!/usr/bin/ksh
# Mustafa DOGANAY 2013 doganay.wordpress.com
date
if [ $# -ne 2 ]
then
echo "Usage: orainv_recreate.sh <ORACLE_HOME> <ORACLE_HOME_NAME>"
date;exit 1
fi

IS_LINUX=$(uname -a|grep -i SunOS)

if [ "X$IS_LINUX" = "X" ];then
## Linux
ORAINST=/etc/oraInst.loc
else
## Solaris
ORAINST=/var/opt/oracle/oraInst.loc
fi

ORAINV=$(grep inventory_loc $ORAINST | awk -F"=" '{print $2}')
mv $ORAINV $ORAINV_$(date +%Y%m%d)
$ORACLE_HOME/oui/bin/runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="$1" ORACLE_HOME_NAME="$2"

date;exit 0
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: