Home » Infrastructure » Unix » AIX Scripts with SQLPLUS Commands (AIX 6.1)
AIX Scripts with SQLPLUS Commands [message #603220] Thu, 12 December 2013 05:07 Go to next message
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 #603221 is a reply to message #603220] Thu, 12 December 2013 05:21 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Oracle has provided the standard startup/shutdown scripts. Much easier and standard way to do it.
http://docs.oracle.com/cd/B19306_01/server.102/b15658/strt_stp.htm#CFAHAHGA

If you still want to do it from scratch, you have all the hints in above piece of documentation.
Set your ORACLE_HOME, PATH , ORACLE_SID etc.

[Updated on: Thu, 12 December 2013 05:26]

Report message to a moderator

Re: AIX Scripts with SQLPLUS Commands [message #603223 is a reply to message #603220] Thu, 12 December 2013 05:43 Go to previous message
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.
Previous Topic: HOST command
Next Topic: ColdBackUp
Goto Forum:
  


Current Time: Tue Nov 26 04:19:53 CST 2024