Home » RDBMS Server » Server Administration » Windows Oracle services (Can a database be shut down using just windows services?)
Windows Oracle services [message #273910] Fri, 12 October 2007 03:35 Go to next message
Phillawson
Messages: 18
Registered: December 2006
Location: Derby UK
Junior Member
Hi, I need to shut my Oracle 10G database down for a few hours each weekend whilst the server it is on has work carried out on it. I've been told that just shutting down the oracle windows service is the equivalent to the database crashing and that I should shut the database down using sql or Enterprise Manager.
is it true about the service advice? and if so how can I create a job to carry out a safe shutdown.
I've tried a command line sqlplus method logging in as / but I need to be able to automate the task as it needs to run at 3am.
Can anyone help please?
Re: Windows Oracle services [message #273913 is a reply to message #273910] Fri, 12 October 2007 04:04 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
1/ Shutting down the service result depends on parameters setting in your registry but ion all cases if the database does not shut down after a while this is the same as killing the processes.

2/ You can create a batch (cmd) file that spawns a sqlplus that cleanly shut down the database and then use Windows scheduler to schedule this file.

Regards
Michel
Re: Windows Oracle services [message #273919 is a reply to message #273913] Fri, 12 October 2007 04:21 Go to previous messageGo to next message
Phillawson
Messages: 18
Registered: December 2006
Location: Derby UK
Junior Member
Ah, thats my problem. I've been sitting here quite a while trying to create a .cmd file to shut the database down using oradim rather than shutting down the services but I can't seem to work out how to do it. I've even gone as far as checking the Oracle documentation and it's easy if I'm willing to sit at the machine and do it manually so I know it works but I want to do it automatically by scheduling the .cmd file. does this make sense?
Re: Windows Oracle services [message #273929 is a reply to message #273919] Fri, 12 October 2007 04:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Don't use oradim it is the same thing as stopping the services.
Use SQL*Plus as you do it manually.

For instance (check it I write it on the fly):
set ORACLE_SID=xxx
echo 'shutdown immediate' | sqlplus "/ as sysdba"


Regards
Michel

Re: Windows Oracle services [message #273981 is a reply to message #273929] Fri, 12 October 2007 09:39 Go to previous message
Phillawson
Messages: 18
Registered: December 2006
Location: Derby UK
Junior Member
Thanks, I was close. I'd got the user logging in first then the shutdown command. It's all working fine now.
cheers,
Phil.
Previous Topic: ora-12560:TNS: protocol adapter error
Next Topic: while connect sqlplus "/as sysdba" like this, i got message ORA-01031: insufficient privil
Goto Forum:
  


Current Time: Mon Dec 02 07:39:56 CST 2024