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: Instance , what instance.

Re: Instance , what instance.

From: Yong Huang <yong321_at_yahoo.com>
Date: 14 Aug 2001 21:40:29 -0700
Message-ID: <b3cb12d6.0108142040.23feca4b@posting.google.com>


Correction to my own message. My observation that UNIX processes are killed in reverse order of PIDs at system shutdown may well be an artifact. Most UNIX processes are killed by their own applications which have K[number][somename] symbolic link in /etc/rc[number].d. System administrators carefully choose the K and S scripts [number] so that the script starts in an order and stops in its reverse order. This also means that client processes started ad-hoc long after those server or daemon processes are started will be stopped "randomly" as far as PIDs are concerned. Sorry about my mistake.

Within one application, such as oracle, the background processes seem to be started in the order of pmon, dbwr, lgwr, ckpt, smon, reco according to PID (as you indicated). Whether oracle shuts down in reverse order is up to the program svrmgrl. For lack of source code, the only way to find out is by examining the output of truss (or strace) on svrmgrl - shutdown. Checking ps -ef (or ps -fp) rapidly doesn't catch it. What I find from truss svrmgrl - shutdown immediate is this sequence: kill reco, dbw0, lgwr, ckpt, reco, pmon (ESRCH), dbw0, lgwr, ckpt, smon (ESRCH), reco, pmon (ESRCH), dbw0 (ESRCH), lgwr (ESRCH), ckpt (ESRCH), smon (ESRCH), reco (ESRCH), where ESRCH means error "No such process" is returned; all other kill's return success. I don't know how to explain why I don't see kill pmon.

Yong Huang
yong321_at_yahoo.com

"Jonathan Lewis" <jonathan_at_jlcomp.demon.co.uk> wrote in message news:<997800325.20816.0.nnrp-14.9e984b29_at_news.demon.co.uk>...
> The database didn't get corrupted. (Beyond a tiny
> glitch needing instance recovery, probably).
>
> The point about shutdown killing pids in reverse
> order is a useful snippet. However, given the
> cyclic nature of UNIX pids it won't always guarantee
> that pmon will get killed last - although the odds are
> probably about 6,000 to 1 in favour (based on
> max(pid)=65535, and background pids leaving a
> gap of 2 all the time, and 5 pids being assigned
> as a typical number etc. etc. etc.)
>
>
> --
> Jonathan Lewis
>
> Seminars on getting the best out of Oracle
> Last few places available for Sept 10th/11th
> See http://www.jlcomp.demon.co.uk/seminar.html
>
>
>
>
> Yong Huang wrote in message ...
> >So why did the database get corrupted? You mean it needs media
> >recovery, right?
> >
> >It's unusual only background processes are killed leaving shadow
> >processes around (pulling power cord kills them all). It's even more
> >unusual background processes are killed in the strict order of PIDs.
> >I'm under the impression that if you init 0 (shutdown) as root,
> >processes are killed in reverse order of PID or sort of. If shadow
> >processes are left alone, it would be good if pmon is killed last.
> >
> >Yong Huang
> >yong321_at_yahoo.com
Received on Tue Aug 14 2001 - 23:40:29 CDT

Original text of this message

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