Oracle MVA

Tales from a Jack of all trades

px-slaves and gv$session

with 2 comments

While troubleshooting some problem on a RAC database for a customer, I queried gv$session. I knew I was the only user logged in with my username, but somehow I found four rows in gv$session for my one session. Some further investigation told me this:

MY_USER@SOME_DB SQL> select inst_id, username
  2    from gv$session
  3   where username = ‘MY_USER';

   INST_ID USERNAME
———- ——————–
         1 MY_USER
         1 MY_USER
         2 MY_USER
         3 MY_USER

Obviously I was annoyed by the fact that four results came back from gv$session, even though I was the only person logged in. Luckily my colleague Jeroen explained to me that I was completely overlooking the fact that querying gv$session actually invokes a parallel query over the complete RAC:

MY_USER@SOME_DB SQL> select inst_id, osuser, program
2 from gv$session
3 where username = ‘MY_USER';

INST_ID OSUSER PROGRAM
———- ——————– ————————————————–
1 LandlustJH sqlplus@some_server.nl (TNS V1-V3)
1 LandlustJH oracle@some_server.nl (PZ99)
2 LandlustJH oracle@some_server.nl (PZ99)
3 LandlustJH oracle@some_server.nl (PZ99)

Somehow I could have know this…. Somehow this also might explain why sometimes EM gives four audit alerts after one login. Anyway, this post is to share this with the world: remember that sometimes results from Oracle seem wrong, but in fact they’re not.

P.S.: and call Jeroen if you need a real pro on the job ;)

About these ads

Written by Jacco H. Landlust

November 11, 2009 at 8:31 pm

Posted in RAC

2 Responses

Subscribe to comments with RSS.

  1. Very nice one, Jacco…
    Will the RAC Pack inflict a patch ? ;-)

    Alexis Gil

    November 13, 2009 at 12:14 am

    • Oracle is notorious in patching things that are not broken, like metalink ;)

      Jacco H. Landlust

      November 13, 2009 at 10:14 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 298 other followers

%d bloggers like this: