Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Shutdown to database oracle with a script.bat

Posted on 2004-04-29
5
Medium Priority
?
979 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 160 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

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…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

730 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