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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Processes/users blocking shutdown

Re: Processes/users blocking shutdown

From: Michel Cadot <micadot2removethat_at_free.fr>
Date: Wed, 1 Oct 2003 20:30:50 +0200
Message-ID: <3f7b1c92$0$2787$626a54ce@news.free.fr>

"Richard B. Kreckel" <richard.kreckel_at_framatome-anp.com> a écrit dans le message de news:fdf52b9b.0310010837.359577b7_at_posting.google.com...
> Daniel Morgan <damorgan_at_x.washington.edu> wrote in message news:<1064930417.825158_at_yasure>...
> > Richard B. Kreckel wrote:
> [...]
> > >There sure must be an easy way to find out if someone is connected to
> > >the database?
> > >
> > SELECT from v_$session.
>
> Oh, thanks!
>
> This, however, raises an interesting question:
> There are several sessions in the view v$session. If I want to query
> all these sessions but excluding the session doing the query itself,
> how can I do this?
>
> Well, there is v$process, and there is a one-to-one relationship
> between v$process.addr and v$session.paddr. However, on a Unix
> system (Linux, actually), v$process.spid refers to the PID of the
> oracle child process of the session while v$session.process refers
> to the PID of the session itself.
>
> So it is not possible to fetch the PID by querying
> SELECT p.spid FROM v$session s, v$process p WHERE p.addr=s.paddr AND ...
> and exclude that value from a query to v$session.process.
>
> Subtracting one from v$process.spid is no solution, since other
> processes might have spawned in the meantime.
>
> Is there another way to fetch the PID of the current session?
>
> TIA
> -richy.
> --
> Dr. Richard B. Kreckel
> Framatome ANP GmbH, NGLTS
> <Richard.Kreckel_at_Framatome-ANP.COM>
> Tel: (+49)9131/189-5275, Fax: (+49)9131/189-9908

The sid of the current session is given by the sid column of v$mystat.

In addition, v$process.spid gives the process id of the server (or shadow) process and v$session.process gives the process id of the client process.

Hope this helps
Michel Cadot Received on Wed Oct 01 2003 - 13:30:50 CDT

Original text of this message

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