Solved

Shutdown to database oracle with a script.bat

Posted on 2004-04-29
5
905 Views
Last Modified: 2008-02-01
I am working with Database Oracle. I wish to do a shutdown to database oracle with a script.
On Unix the script run, but when I try to run it on DOS, the script not run.

svrmgrl << EOF     -->  << was unexpected at this time
connect internal;
shutdown immediate;
EOF

So, I want to know, how can I run this script (or something like that) on NT???

If I need change something, please tell me, I need any help



0
Comment
Question by:arianym
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
mrdtn earned 40 total points
ID: 10953285
Create an sql script and name it shutdown.sql

I guess yours would look like

connect internal
shutdown immediate

Then from the DOS command line or from within a batch file, use the following line:

sqlplus /nolog @shutdown.sql

--

That's it.  Keep in mind you need to make sure sqlplus is in your path (it's located in ORACLEHOME\bin).  Also, if your shutdown.sql file is located in a specific location, put in the entire path (using quotes for good measure) as in the example below:

sqlplus /nolog @"c:\sql directory\shutdown.sql"

--

mrdtn
0
 
LVL 6

Expert Comment

by:mrdtn
ID: 10953340
You also need an "exit" at the end of your sql file -- but you probably already knew that.

--

mrdtn
0
 
LVL 4

Expert Comment

by:berni1234
ID: 10976433
you can simply stop the oracle-services in a dos-batch. then the oracle-db is shutting down

net stop youroracleservice
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question