The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-18-2008
gzs553 gzs553 is offline VIP Member  
Supporter
  
 

Join Date: Oct 2006
Posts: 42
How does the environment stay set

I am running this pre-script with a post scripts that needs to share the same variables. How do I keep the environment variable settings for the next script to access from the RMAN Script?



Prescript #1


#RMAN Script
#!/bin/ksh
ORACLE_SID=INVPRD;export ORACLE_SID
DBNAME=$ORACLE_SID;export DBNAME
LOGDIR=/u01/app/oracle/product/10.2.0/scripts/logs/rman;export LOGDIR
CURRTIME=`date +"%y%m%d%H%M%S"`;export CURRTIME
LOGF=$LOGDIR/bkp_${DBNAME}_FULL_${CURRTIME}.log;export LOGF
START=`date +"%m/%d %H:%M"`
rman msglog $LOGF <<EOF


RMAN script# 2

connect target backup_admin/emcnw@INVPRD.WORLD
RUN {
ALLOCATE CHANNEL t1 TYPE 'SBT_TAPE';
backup database;
release CHANNEL t1;
}
exit;


Post script # 3

EOF
RC=$?
STATUS=OK
if [ $RC -ne 0 ]
then
STATUS=Error
fi
END=`date +"%H:%M"`
MSG="$STATUS $DBNAME RMAN_Full Backup $START-$END";export MSG
#mailx -s "$MSG " romptechteam@txu.com,vviswan1@txu.com < $LOGF
mailx -s "$MSG " vviswan1@txu.com < $LOGF