Useful Scripts for SQLPlus

From Kb

Jump to: navigation, search

Contact Article Author | Blog of Article Author | FirstPartners.net Home | LinkedIn profile of Author

Run Oracle Script from SQL Plus Command Line

'''Force running of script as certain user via SQLPlus'''
 
 
 
SET LINES 200
 
SPOOL output_message_file.txt
 
PROMPT Enter password FOR USER:
 
ACCEPT pass hide
 
PROMPT Enter SID
 
ACCEPT sid 
 
CONNECT USER/&&pass@&&sid
 
'''Put the SQL you wish to execute here'''
 
SPOOL OFF;
Personal tools