If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Environment variable ADMIN_DIR not set

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-24-06, 06:28
Polly013 Polly013 is offline
Registered User
 
Join Date: Aug 2004
Location: Manchester, UK
Posts: 136
Environment variable ADMIN_DIR not set

Hi all,

When I run the following script I get the above error (ADMIN_DIR not set). However when I run an identical script on another database it runs fine. Does anyone have any idea why it can't set the variable in this one?

Many thanks,
Paula

Code:
#! /bin/ksh
#
# Remove oldest backup
#
cd /backup/houload
ls -l
rm -r `ls -ltr /backup/houload | awk 'NF > 2 {print $9}' | head -1`
ls -l
#
# Set the environment for HOULOAD
#
cd
#
. /opt/bin/oraHOULOAD.env
#
if [[ -z ${ADMIN_DIR} ]]
then
ADMIN_DIR=/opt/bin ; export ADMIN_DIR
fi
#
# Stop java listeners
#
/opt/bin/dbsctl stop HOULOAD
#
# Connect to the database to shut it down
#
sqlplus \/nolog <<EOF
connect / as sysdba
shutdown immediate
exit
EOF
#
# Create backup directory
#
cd /backup/houload
mkdir backup_`date +%d%m%y`
#
# Copy the files 
#
cd /dpp/load/HOULOAD
cp * /backup/houload/backup_`date +%d%m%y`
#
# Connect to the database to start up
#
sqlplus \/nolog <<EOF
connect / as sysdba
startup
exit
EOF
#
# Start the java listeners
#
/opt/bin/dbsctl start HOULOAD
#
# Compress the backup files
#
echo '++++ HOULOAD AVAILABLE ++++'
cd /backup/houload/backup_`date +%d%m%y`
compress *
#
exit
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On