Sponsored Content
Top Forums Shell Programming and Scripting Unix shell script couldn't be executed. Pls help! Post 302088814 by duke0001 on Thursday 14th of September 2006 01:59:01 PM
Old 09-14-2006
Unix shell script couldn't be executed. Pls help!

I have wrriten a script to call sql script to do some work in database. However, the script couldn't be executed. The only information was: ksh: ./updt_attrib.ksh cannot execute. Please help me to identify where the problem is. I post script here for your reference. Thanks a lot.


#!/bin/ksh

# Created By: duke0001
# Created On: 9/14/06
# Description: This script update xxx information for xxxx
# attributes tables.

# Check to make sure the correct number of parameters have been enetered.
#if [[ $# -lt 1 ]] then
# echo "Incorrect number of parameters."
# echo "Usage: $0 [ORACLE_SID]"
# exit 1
# fi

#Initialize variables.
ORACLE_SID=$1
ORACLE_HOME=/oracle/product/9.2.0
WORK_DIR=`dirname $0`
MINUTES=0
#FILECOUNT=0
#FILETRANSFERED=1
DBDOWN=1

# Change to working directory.
cd $WORK_DIR

# Set environment variables.
export ORACLE_SID
export ORACLE_HOME
export PATH=$PATH:/oracle/product/9.2.0:/oracle/product/9.2.0/bin

# Check to make sure that the database is available.
while [ $DBDOWN -eq 1 ]
do
sqlplus -s > /dev/null 2>&1 "dbuser/password@$ORACLE_SID" <<EOF
whenever sqlerror exit 1
select * from dual;
exit 0
EOF

if [ $? = 1 ]
then DBDOWN=1
date +"%D %T: Still waiting for $ORACLE_SID to become available." >> updt_attrib.log
sleep 60
else DBDOWN=0
fi
done

date +"%D %T: Database $ORACLE_SID is up and running." >> updt_attrib.log
echo "" >> updt_attrib.log

date +"%D %T: update attributes script started." >> updt_attrib.log
sqlplus -s > temp.log 2>&1 dbuser/passwd@$database @tools/updt_attrib.sql

if [ $? = 0 ]
then date +"%D %T: $scripts successfully executed." >> updt_attrib.log
else date +"%D %T: Error executing script." >> updt_attrib.log
grep "ORA-" temp.log >> updt_attrib.log
date +"%D %T: Exiting script." >> updt_attrib.log
mail -s 'DB Update: Unsuccessful. See Log file for errors.'
duke0001@company.com<updt_attrib.log
exit 1
fi
done

date +"%D %T: End update attributes in xxx data warehouse." >> updt_attrib.log
mail -s 'End update attributes in xxx data warehouse.' duke0001@company.com<updt_attrib.log
exit 0
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script doesn't get executed using crontab

I have the following crontab entry to run a shell script for every 30 minutes of every day: 30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log after I created the crontab file I have also done: $crontab my_crontab I also check to make sure it exists, by using the following... (11 Replies)
Discussion started by: radhika
11 Replies

2. AIX

Help - Need simple example of VI executed in shell script

Please help - I have seen others ask this question but I need a simple example of using vi in a shell script. Once I enter VI the shell script does not execute the next commands until I q!. I invoke VI and start the edit process. I want to go to the third line and replace a character with a new... (2 Replies)
Discussion started by: corsart
2 Replies

3. Shell Programming and Scripting

korn shell script executed with error

Hi, need help, I would like to know what is this IF statement trying to do? When the script is executing and error out with line 9 which is the IF statement line. if ] then TOPDIR=$(pwd) else TOPDIR=${0%/*} fi TOPDIR=${TOPDIR%/*} the log file. Current system time is... (15 Replies)
Discussion started by: beooi
15 Replies

4. Shell Programming and Scripting

help with shell script executed by php.

I made a shell script to execute a server in screen mode. # start server screen -d -m -S Test ./application echo "Program Started Successfully" than I'm executing it from php by echo shell_exec('/home/script.sh'); and it is giving me this error. "cannot make directory... (1 Reply)
Discussion started by: dmallia
1 Replies

5. Shell Programming and Scripting

Shell script executed from Informatica ETL tool is spawning 2 processes for one script

Hi, I am having a shell script which has a while loop as shown below. while do sleep 60 done I am executing this script from Informatica ETL tool command task from where we can execute UNIX commands/scripts. When i do that, i am seeing 2 processes getting started for one script... (2 Replies)
Discussion started by: chekusi
2 Replies

6. Shell Programming and Scripting

Shell script not getting executed

Hi As per my requirement when I run . ./file.sh am getting the following error -bash:ELF: command not found when i execute as ./file.sh it is getting executed.How to resolve this. Thanks in advance. (3 Replies)
Discussion started by: pracheth
3 Replies

7. UNIX for Dummies Questions & Answers

How to send keyboard inputs toa UNIX command executed from a shell script?

I have a unix command that prompts for 'y'. How do I run this from my shell script? (4 Replies)
Discussion started by: Sree10
4 Replies

8. Shell Programming and Scripting

Multiple shell scripts executed in one script

Hi every one, i am new to shell script. my people given a task to write a shell script that should execute number of shell scripts in that. in that, if any shell script is failed to execute, we have to run the main script again, but the script should start execute from the failed script only.. it... (1 Reply)
Discussion started by: Madhu Siddula
1 Replies

9. Shell Programming and Scripting

Multiple shell scripts executed in one script

Hi every one, i am new to shell script. my people given a task to write a shell script that should execute number of shell scripts in that. in that, if any shell script is failed to execute, we have to run the main script again, but the script should start execute from the failed script only.. it... (6 Replies)
Discussion started by: Madhu Siddula
6 Replies

10. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies
ds.log(4)							   File Formats 							 ds.log(4)

NAME
ds.log - Availability Suite data services log file DESCRIPTION
The /var/adm/ds.log file contains the Availability Suite data services command log. The administration commands log activities to the file in the format: date time product: message Note that when the size of the log file exceeds 10 Mbytes, ds.log is renamed /var/adm/ds.log.bak and a new /var/adm/ds.log file is cre- ated. The ds.log fields are: date The date format is mmm nn, where mmm is the local three-character abbreviation for the month and nn is the day of the month on which the event occurred. time The time of the event, in hh:mm:ss format. product A product code that identifies which component of the data services produced the event. The code is separated from the message that follows by a colon (:) and a space. message A message that can extend over more than one line describing the event that occurred. The second or following lines are not pre- fixed by the date, time, and product code strings. EXAMPLES
The example below shows sample ds.log file content: Jan 25 05:26:17 ii: iiboot suspend cluster tag <none> Jan 25 05:32:02 ii: iiboot resume cluster tag <none> Jan 25 05:32:04 sv: svboot: resume /dev/vx/rdsk/bigmaster Jan 25 05:32:04 sv: svboot: resume /dev/vx/rdsk/bigshadow Jan 25 05:32:04 sv: svboot: resume /dev/vx/rdsk/mstvxfs Jan 25 05:32:04 sv: svboot: resume /dev/vx/rdsk/master01 ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +---------------------+---------------------------------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +---------------------+---------------------------------------------------------+ |Architecture | x86 | +---------------------+---------------------------------------------------------+ |Availability | SUNWscmu | +---------------------+---------------------------------------------------------+ |Interface Stability | Committed | +---------------------+---------------------------------------------------------+ SEE ALSO
iiadm(1M), sndradm(1M), svadm(1M), attributes(5) SunOS 5.11 08 Jun 2007 ds.log(4)
All times are GMT -4. The time now is 09:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy