Solved

Shutdown to database oracle with a script.bat

Posted on 2004-04-29
5
871 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
Comment Utility
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
Comment Utility
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
Comment Utility
you can simply stop the oracle-services in a dos-batch. then the oracle-db is shutting down

net stop youroracleservice
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now