Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Best way to handle Oracle shutdowns from Unix script

Re: Best way to handle Oracle shutdowns from Unix script

From: Phil Herring <revdoc_at_uow.edu.au>
Date: 1997/10/15
Message-ID: <62115r$o5c$1@wyrm.its.uow.edu.au>#1/1

In article <01bcd8c2$b7c00100$269014ce_at_hamilton.qvc.com> Chuck Hamilton, Xchuckh_at_dvol.com writes:
>I wouldn't do it with my database! By killing oracle background processes
>this way you're just asking for trouble. A better way is to:
>
>1. shutdown abort
>2. startup in restricted mode
>3. shutdown immediate or normal

Uh, 'shutdown abort' is also asking for trouble - it may not be possible to restart your DB afterwards. You should only use this in case of an emergency.

Somebody also mentioned dbshut - this uses 'shutdown normal', and will wait for current connections to terminate. Most other solutions also neglect the associated RDBMS processes like SQL*Net listeners, which can create confusion for people trying to connect. A complete database shutdown script does these things:

  1. Shut down SQL*Net listeners, OWS listeners, and any other services that access the instance.
  2. Perform a 'shutdown immediate' on the instance. Note that this might fail on some versions (e.g., 7.1.6) if there are users connected. In such cases, 'shutdown abort, startup restrict, shutdown imediate' is your only way of guaranteeing a timely shutdown. (And no, it's still not safe, so minimise the risk by attempting to kill active sessions via the 'alter system kill session' command, waiting a few minutes, and only proceeding to a 'shutdown abort' if the sessions aren't cleared.)
  3. Do your backups, etc.
  4. 'startup restrict' your instance.
  5. Do any required instance initialisation, such as pinning packages.
  6. 'alter system disable restricted session' to allow logons.
  7. Start all the listeners that you shut down in step 1.

You might also want to do other stuff in there as well, such as clean up log files, backup control files, and other housekeeping, but this is the basic process.



Copyright 1997 Phil Herring. This article may not be reproduced for profit.
Received on Wed Oct 15 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US