AIX Scripts with SQLPLUS Commands [message #603220] |
Thu, 12 December 2013 05:07 |
|
psunith
Messages: 1 Registered: December 2013 Location: Dubai
|
Junior Member |
|
|
I need your help again on AIX Scripting.
Below are the commands that we need to run in sequence to start the Oracle DB & the SAP Services.
su - orap02
sqlplus "/as sysdba"
startup;
exit
lsnrctl start;
logout
su - p02adm
startsap all;
logout
I created the below script to the best of my knowledge, I am confused with the "sqlplus" bit, how do i add this to the script. Please see the script i created.
#!/usr/bin/ksh
su - orap02 -c
sqlplus "/as sysdba" <<ENDOFSQL
startup;
exit
ENDOFSQL
su - orap02 -c "lsnrctl start"
su - p02adm -c "startsap all"
exit
Please correct me where I am wrong in the above script.
|
|
|
|
Re: AIX Scripts with SQLPLUS Commands [message #603223 is a reply to message #603220] |
Thu, 12 December 2013 05:43 |
martijn
Messages: 286 Registered: December 2006 Location: Netherlands
|
Senior Member |
|
|
Well where does it go wrong?
What are to addres?
First thing I notice that you do not set some environment variables (ORACLE_HOME, ORACLE_SID,....)
Does "su - <user> -c " acept commands as you provided them? How does the shell know where to stop pushing commands thru su?
Anyway...lot's to think about I guess.
|
|
|