Home » Infrastructure » Unix » Redhat linux (wait command)
Redhat linux [message #511887] Wed, 15 June 2011 14:25 Go to next message
gkrishn
Messages: 506
Registered: December 2005
Location: Putty a dark screen
Senior Member
My wait command doest wait for the previous process.Any idea what option i need to use with wait command,so that it wait till my sqlplus session ends.

sqlplus -s <<EOF1>> $sqlout.OUT 2>&1
$USER/$PASS


--@generateSQLfiles.sql

exit
EOF1

#-----------
wait
if [ ! -f *.SQL ]; then
 echo "NO SQL files generated"
exit 0
fi
Re: Redhat linux [message #511888 is a reply to message #511887] Wed, 15 June 2011 14:29 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
What exactly are you trying to do?
Re: Redhat linux [message #511889 is a reply to message #511887] Wed, 15 June 2011 14:30 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
You do not need a "wait" command.
The script will not continue until the sqlplus exits.

[Updated on: Wed, 15 June 2011 14:57] by Moderator

Report message to a moderator

Re: Redhat linux [message #511890 is a reply to message #511889] Wed, 15 June 2011 14:34 Go to previous messageGo to next message
gkrishn
Messages: 506
Registered: December 2005
Location: Putty a dark screen
Senior Member
my "if" condition should run only after sqlplus session exit.

now it goes to "if" condition before sqlplus session completes.
Re: Redhat linux [message #511891 is a reply to message #511890] Wed, 15 June 2011 14:39 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
gkrishn wrote on Wed, 15 June 2011 15:34
my "if" condition should run only after sqlplus session exit.

now it goes to "if" condition before sqlplus session completes.

Not true...the sqlplus session completes before the rest of the scripts executes.

Remove the silent (-s) option from sqlplus and check the contents of the $sqlout.OUT file.

[Updated on: Wed, 15 June 2011 14:58] by Moderator

Report message to a moderator

Re: Redhat linux [message #511892 is a reply to message #511890] Wed, 15 June 2011 14:40 Go to previous message
gkrishn
Messages: 506
Registered: December 2005
Location: Putty a dark screen
Senior Member
my sqlplus session generates many .SQL files for each "VIEWS" in my database.

"if" condition is added to check if any .SQL files are generated or not. Thanks Mahesh
Previous Topic: run sql commands in background
Next Topic: need to install oracle 10g for AIX 5.3 virtual machine
Goto Forum:
  


Current Time: Thu Mar 28 14:06:00 CDT 2024