Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help needed in Unix Shell Scripts
I'm working from memory on this one, so it may not be perfect, but I hope this
will get you on the right track. The easiest way would be to use a 'here'
file, as in the following script:
#!/bin/sh
ORACLE_SID=sid
sqldba mode=line <<shutdown
connect ora734/oracle734;
shutdown normal;
quit;
shutdown
echo 'Oracle instance shut down'
The shutdown redirect is a 'here' file... it reads as input the next three lines until it sees a line containing 'shutdown'. It would be called from root as:
su - oracle -c "shutdown_script"
HTH,
Eric Byrnes
Kenny Leow wrote:
> Hi,
>
> I need to write a shell script to login into my oracle from root, and do a
> shutdown. Can someone help me please?
>
> login for oracle=ora734
> password=oracle734
>
> Thanks a lot.
>
> Kenny
Received on Thu Dec 10 1998 - 19:50:40 CST