Solved

Shutdown to database oracle with a script.bat

Posted on 2004-04-29
5
964 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

623 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