Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Script for performing clean shutdown before windows shutdown
"Holger Baer" <holger.baer_at_science-computing.de> wrote in message
news:ddqef3$pfa$1_at_news.BelWue.DE...
> Andreas Sheriff wrote:
>> <bdbafh_at_gmail.com> wrote in message
>> news:1124119055.886364.226290_at_g14g2000cwa.googlegroups.com...
>>
>>>Your fears are well founded.
>>>
>>>Even with the service configured to perform a shutdown immediate when
>>>the service is stopped, if control is not returned within the "wait to
>>>kill service timeout" the process is terminated in a non-graceful
>>>fashion and crash recovery will be required ... possibly requiring
>>>media recovery to be performed.
>>>
>>>best approach is to:
>>>
>>>connect / as sysdba
>>>alter system switch logfile;
>>>shutdown abort
>>>startup mount restrict
>>>alter system set job_queue_processes=0;
>>>alter database open;
>>>shutdown immediate
>>>
>>>then stop the operating system service.
>>>
>>>you'll also want to alter the value for the registry key
>>>HKLM\SYSTEM\CurrentControlSet\Control\WaitToKillServiceTimeout
>>>the default is 20000 (20 seconds).
>>>I'd recommend setting it to at least 300 seconds.
>>>
>>>hth.
>>>
>>>-bdbafh
>>>
>>
>>
>> DO NOT SHUTDOWN ABORT
>>
>> If you're that fearful, execute a SHUTDOWN IMMEDIATE manually every time
>> you
>> wish to stop or restart the OS. Don't rely on scripts to do it for you
>> because scripts can fail.
>>
>
> Only that SHUTDOWN IMMEDIATE might wait a long time if, e.g. the
> Intelligent(?)
> Agent is running.... So scripting isn't too bad, provided you know the
> limitations.
>
> In general shutting down everything that connects to the database
> (Intelligent Agent,
> DBConsole/EnterpriseManager....) should be shutdown first, then the
> database, and
> finally the listener (although the listener can be shutdown upfront to
> prevent logins).
>
> On a busy database you might still have problems with shutdown immediate,
> though.
>
> And if you don't trust Oracle to recover from a shutdown abort, don't use
> Oracle.
> Or invest in proper HW, OS and training.
>
> Regards,
> Holger
SHUTDOWN IMMEDIATE will not wait.
From the 10gR2 SQL PLUS documentation:
(SHUTDOWN) IMMEDIATE
Does not wait for current calls to complete or users to disconnect from the
database.
Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.
If you don't believe me, try it. Start several transactions from several sources, including the agent/console/EM/etc... and you'll see that any active transaction will be rolled back, no further connections will be allowed, and the database will shutdown.
SHUTDOWN TRANSACTIONAL will wait, however.
And if IMMEDIATE seems to wait, that's only because the database is busy finishing activity it needs to shutdown.
-- Andreas Oracle 9i Certified Professional Oracle 10g Certified Professional Oracle 9i Certified PL/SQL Developer "If you don't eat your meat, you cannot have any pudding. "How can you have any pudding if you don't eat your meat?!?!" --- WARNING: DO NOT REPLY TO THIS EMAIL Reply to me only on this newsgroupReceived on Mon Aug 15 2005 - 12:25:19 CDT
![]() |
![]() |