|
 |
|
ss
Oracle Tips by Burleson |
Get the fully-qualified UNIX
path names for directories
This section of the script gets the full path name for the UNIX
directories. The tricky part of this is when Oracle uses a question
mark, and not the fully-qualified UNIX path name to the directory.
In this case, we need to prefix the name with the value from the $ORACLE_HOME
variable.
#*************************************************************
# If the first character of the dump directory is a question-mark
(?)
# then replace it with $ORACLE_HOME
#*************************************************************
sed 's/?/$ORACLE_HOME/g' /tmp/dump_$ORACLE_SID.ora > \
tmp/dump1_$ORACLE_SID.ora
ALERT_DIR=`cat /tmp/alert_log_dir_${ORACLE_SID}.ora|awk '{print
$1}'`
export ALERT_DIR
#*************************************************************
# If the first character of the alert ora directory is a
question-mark (?)
# then prefix with $ORACLE_HOME
#*************************************************************
first_char=`echo $ALERT_DIR|grep ^?|wc -l`
first_num=`expr $first_char`
#echo $first_char
if [ $first_num -eq 1 ]
then
new=`echo $ALERT_DIR|cut -d? -f2`
ALERT_DIR=${ORACLE_HOME}$new
fi
Download your Oracle scripts now:
www.oracle-script.com
The
definitive Oracle Script collection for every Oracle professional DBA
|
|