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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: The same session run on both instances (RAC), is it normal?

Re: The same session run on both instances (RAC), is it normal?

From: Rajeev Prabhakar <rprabha01_at_gmail.com>
Date: Thu, 27 Sep 2007 16:39:07 -0400
Message-ID: <2ba656800709271339p509b8754w25b0ec06c0d9517@mail.gmail.com>


Yes. I tried via sqlplus client gui tool and I got the same results...

16:36:21 SQL> l
  1 select a.inst_id, a.sid,a.serial#, b.sid,   2 a.qcsid,b.audsid,b.osuser,b.username,   3 to_char(b.logon_time,'dd-mon-yy hh24:mi:ss'),

  4  b.machine,
  5  b.command, b.serial#,
  6  b.inst_id

  7 from gv$px_session a, gv$session b
  8 where a.sid=b.sid
  9  and b.username='MONITOR'
 10  and a.serial#=b.serial#
 11* and a.inst_id=b.inst_id

16:36:29 SQL> /    INST_ID SID SERIAL# SID QCSID AUDSID OSUSER USERNAME TO_CHAR(B.LOGON_TIME,'DD-MO MACHI ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------------
         2       2430       3855       2430       2539     547105 rprabhakar
MONITOR    27-sep-07 16:36:28          WORKGROUP\L
         1       2041        814       2041       2539     547105 rprabhakar
MONITOR    27-sep-07 16:36:28          WORKGROUP\L
         1       2539        475       2539       2539     547105 rprabhakar
MONITOR    27-sep-07 16:33:41          WORKGROUP\L

16:36:31 SQL>
On 9/27/07, LS Cheng <exriscer_at_gmail.com> wrote:
>
> How about SQL*PLUS, you know tools like PL/SQL Developer sometimes opens
> several connections, so to be sure try with SQL*PLUS and once connected run
> the query
>
> Thanks
>
> --
> LSC
>
>
>
> On 9/27/07, qihua wu <staywithpin_at_gmail.com> wrote:
> >
> > select username, machine, osuser, to_char(logon_time, 'YYYY-MM-DD
> > HH24:MI') LG ,last_call_et
> > from gv$session
> > where username = 'GDBA_WUQIH'
> >
> > GDBA_WUQIH ASIAPACIFIC\SCN7872 wuqih 2007-09-27 17:23 0
> > GDBA_WUQIH ASIAPACIFIC\SCN7872 wuqih 2007-09-27 16:40 0
> > GDBA_WUQIH ASIAPACIFIC\SCN7872 wuqih 2007-09-27 16:40 0
> > GDBA_WUQIH ASIAPACIFIC\SCN7872 wuqih 2007-09-27 17:23 0
> >
> > From the result, the session connects to two instances at the same time.
> > it's amazing. Is it correct that a session connect to two nodes?
> >
> > On 9/27/07, LS Cheng <exriscer_at_gmail.com > wrote:
> > >
> > > I dont work with PL/SQL Developer so I am not sure what it does
> > > underwood. But this is very easy to check
> > >
> > > select username, machine, module, osuser, to_char(logon_time,
> > > 'YYYY-MM-DD HH24:MI') LG ,last_call_et
> > > from gv$session
> > > where username = 'GDBA_WUQIH'
> > >
> > > Thanks
> > >
> > > --
> > > LSC
> > >
> > >
> > >
> > > On 9/27/07, qihua wu <staywithpin_at_gmail.com > wrote:
> > > >
> > > > select inst_id,count(*) from gv$session where
> > > > schemaname='GDBA_WUQIH' group by inst_id
> > > > 1 2
> > > > 2 2
> > > >
> > > > And I have only two session through plsql devloper. Each of these
> > > > sessions lands on both instances. That surprise me. One session sits on both
> > > > instance at the same time.
> > > >
> > > > On 9/27/07, LS Cheng <exriscer_at_gmail.com> wrote:
> > > > >
> > > > > please add a predicate for your user and not groupping at global
> > > > > level because for a idle RAC system there are quite a few background
> > > > > processes and RAC monitoring processes and if you have dbconsole then more
> > > > >
> > > > > thanks
> > > > >
> > > > > --
> > > > > LSC
> > > > >
> > > > >
> > > > >
> > > > > On 9/27/07, qihua wu <staywithpin_at_gmail.com > wrote:
> > > > > >
> > > > > > I don't know why ask for groupping by inst_id, anyway the result
> > > > > > is.
> > > > > > select inst_id,count(*) from gv$session group by inst_id
> > > > > > 1 36
> > > > > > 2 39
> > > > > >
> > > > > > David may be correct that sid is not unique accross instance,
> > > > > > but why gv$mystat will show non-zero stats value on both instances(since
> > > > > > non-zeror statatics, that means the session operates on both instance).
> > > > > >
> > > > > > Dan:
> > > > > > a session connects to the database multiple times, it still has
> > > > > > the same session id, otherwise they are not the same session, right?
> > > > > >
> > > > > > My question is "one session can only land on one instance during
> > > > > > its lifetime?".
> > > > > >
> > > > > > Thanks very much for your reply. Have a good day.
> > > > > >
> > > > > > On 9/26/07, LS Cheng <exriscer_at_gmail.com> wrote:
> > > > > > >
> > > > > > > how about group by inst_id...?
> > > > > > >
> > > > > > > thanks
> > > > > > >
> > > > > > > --
> > > > > > > LSC
> > > > > > >
> > > > > > >
> > > > > > > On 9/27/07, qihua wu < staywithpin_at_gmail.com > wrote:
> > > > > > > >
> > > > > > > > We have a two nodes RAC, the strange thing is that many
> > > > > > > > sessions run on both nodes.
> > > > > > > > select sid from gv$session group by sid having
> > > > > > > > count(*)>1
> > > > > > > > they are lots of rows return.
> > > > > > > >
> > > > > > > > My understanding for load balance is: if sessions on
> > > > > > > > instance 1 are too many, then new session will be connected to instance 2.
> > > > > > > > But if at the beginning there were100 sessions on both inst1
> > > > > > > > and inst2, after all the sessions on inst2 are completed, no existing
> > > > > > > > session on instance1 will go to instance2.
> > > > > > > >
> > > > > > > > But the fact of the above query told me some sessions run on
> > > > > > > > both instance. How can this be true?
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Sep 27 2007 - 15:39:07 CDT

Original text of this message

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