Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 993
  • Last Modified:

Shutdown to database oracle with a script.bat

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
arianym
Asked:
arianym
  • 2
1 Solution
 
mrdtnCommented:
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
 
mrdtnCommented:
You also need an "exit" at the end of your sql file -- but you probably already knew that.

--

mrdtn
0
 
berni1234Commented:
you can simply stop the oracle-services in a dos-batch. then the oracle-db is shutting down

net stop youroracleservice
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now