Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Help needed in Unix Shell Scripts

Re: Help needed in Unix Shell Scripts

From: Eric Byrnes <ericbyrnes_at_sprintmail.com.NOSPAM>
Date: Thu, 10 Dec 1998 20:50:40 -0500
Message-ID: <36707A6F.86685947@sprintmail.com.NOSPAM>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US