px-slaves and gv$session
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 😉
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