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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Exiting a script lassimanji Shell Programming and Scripting 7 05-05-2009 02:02 PM
Shell script..invoking command and exiting at fixed intervals rajuak12 Shell Programming and Scripting 1 07-19-2008 09:34 AM
Script Not Exiting??? lesstjm Shell Programming and Scripting 1 07-11-2007 11:58 AM
Shell script not exiting Gracefully smithK Shell Programming and Scripting 5 02-08-2007 06:48 PM
Terminate session on completing script deepsteptom Shell Programming and Scripting 4 06-08-2004 10:47 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-02-2009
welldone welldone is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 10
shell script exiting before completing

I have a script which has the following statement,

/opt/oracle/product/9i/bin/sqlplus << EOC >> $LOG_FILE 2>&1
username/password ---- Enters the SQL prompt
@/export/home/oracle/shells/grant_userview.sql ---Runs the SQL script
@/export/home/oracle/shells/grant_proc_userview.sql ---Runs the SQL script
@/export/home/oracle/shells/createindex.sql ---Runs the SQL script
exit --- Exits the SQL prompt
EOC

imp system/password file=/oradata/temp/user.dmp fromuser=user 1 touser=user2 indexes=y log=user.log -- Runs on $ prompt.

The statement in red above doesnt run. When run out of the script manually it succeeds, I am trying to figure if i have to move this "exit" below the last line, Please advice
  #2 (permalink)  
Old 07-02-2009
scottn scottn is offline Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 968
Does it produce an error?

(and what is the 1 between the fromuser and touser part)?
Code:
fromuser=user 1 touser=user2
Just as a thought: Is that imp command you show exactly the command you run from the script, or is the username/password, for example, in a variable? If so, did you export the varaible?

The exit isn't neccessary either in the SQL*Plus or the script. You should replace it with a / in the SQL.
  #3 (permalink)  
Old 07-02-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,861
What happens if you add the full pathname to imp?
  #4 (permalink)  
Old 07-02-2009
welldone welldone is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 10
Hi Scottn/fpmurhpy,

No there is no export of username/password required in the script because it contains the original username and password.

This script was running and since couple of days it terminates and doesnt run that imp command.

Thanks.
  #5 (permalink)  
Old 07-02-2009
scottn scottn is offline Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 968
What does user.log say?

Remove the exit anyway, as it's not required.
  #6 (permalink)  
Old 07-02-2009
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,382
file=/oradata/temp/user.dmp
is this file available in that location..
  #7 (permalink)  
Old 07-02-2009
radoulov's Avatar
radoulov radoulov is online now Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,793
Quote:
Originally Posted by welldone View Post
[...]
This script was running and since couple of days it terminates and doesnt run that imp command.
If you enable tracing, you should be able to see what happens.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0