v$session : username vs schemaname ?
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: v$session : username vs schemaname ?

Hybrid View

  1. #1
    Join Date
    Dec 2001
    Posts
    141

    Question

    Hi everybody !
    Does someone know the difference between v$session.username and v$session.schemaname ?
    Thanks a lot in advance ...

  2. #2
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    Here the schemaname=schema user name
    username= oracle username and both should be the same.

    regards
    anandkl
    anandkl

  3. #3
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    username is the one who runs the query, schemaname is schema which the queries are run against to

    for example

    I am user SCOTT, when I logon I can do

    alter session set current_schema=FORD;

    Code:
    SQL> select username, schemaname from v$session;
    
    USERNAME                       SCHEMANAME
    ------------------------------ ------------------------------
                                   SYS
                                   SYS
                                   SYS
                                   SYS
                                   SYS
                                   SYS
                                   SYS
                                   SYS
    SCOTT                     FORD
    Scott has table emp with 14 rows, Ford has empty table emp, now if I query emp as SCOTT but under schema FORD I will be querying FORDīs emp table and not SCOTTs

  4. #4
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    It should be same except for background processes. For BG processes username is usually NULL and schemaname is SYS.

    Sanjay

  5. #5
    Join Date
    Aug 2002
    Location
    Bangalore, India
    Posts
    405

    Unhappy

    Originally posted by SANJAY_G
    It should be same except for background processes. For BG processes username is usually NULL and schemaname is SYS.

    Sanjay
    Hey, Sanjay pls do read the msg clearly before rasing your doubt again.. That was an excellent reply from Pando which clearly says the difference between username and shcema name in v$session. Read that message once again..

  6. #6
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by nagarjuna
    Hey, Sanjay pls do read the msg clearly before rasing your doubt again.. That was an excellent reply from Pando
    Hey, nagarjuna pls note the time when pando's and Sanjay's messages were posted. You'll note that it is very likely that pando's reply was not published yet when Sanjay started writing down his comment. So there is no need to be harsh on him, simmilar things have happend to many of us....
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  7. #7
    Join Date
    Feb 2000
    Location
    Singapore
    Posts
    1,758
    Thanks jmodic.

    nagarjuna, I hope that clears your doubt.

    Sanjay

  8. #8
    Join Date
    Aug 2002
    Location
    Bangalore, India
    Posts
    405
    Originally posted by SANJAY_G
    Thanks jmodic.

    nagarjuna, I hope that clears your doubt.

    Sanjay
    oh.. I am very very sorry Mr. Sanjay. It was my mistake. Since, I am new to this forum (registered 8 hrs back), I didnt know abt this timing problem and flow of the forum. I am sorry once again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width