diff. between username and schemaname
DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: diff. between username and schemaname

  1. #1
    Join Date
    Jan 2003
    Location
    india
    Posts
    175

    diff. between username and schemaname

    what is difference between username and schemaname?

    when i list the v$session both have same values.

    -Raja

  2. #2
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    where u select username,schemaname from v$session where status='ACTIVE'; u would see that under username all the users logged into db is not displayed, but under schemaname you can see all the users loged into db.

    regards
    anandkl
    anandkl

  3. #3
    Join Date
    Jan 2003
    Location
    india
    Posts
    175
    actually what do they mean?

  4. #4
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by anandkl
    where u select username,schemaname from v$session where status='ACTIVE'; u would see that under username all the users logged into db is not displayed, but under schemaname you can see all the users loged into db.

    regards
    anandkl
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  5. #5
    Join Date
    Aug 2002
    Posts
    115
    i think....

    Create User command creates a user.

    Collection of all objects owned by this user is a schema!!

  6. #6
    Join Date
    Jul 2003
    Posts
    323

    Cool

    aspdba has got it...a schema is a logical concept i.e collctn. of user objects !!

  7. #7
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    Hi,

    When a USER is created an empty schema is created and the USER owns the schema.

    Schema is nothing but a collection of database objects associated with a particular database user

    So when u execute the below command
    select username,schemaname from v$session where status='ACTIVE';

    USERNAME SCHEMANAME
    ------------------------------ ------------------------------
    SYS
    SYS
    SYS
    SYS
    SYS
    SYS
    SYS
    SYS SYS

    You see that few entries under USERNAME r blank, but under SCHEMA there is an entry.So i would consider using SCHEMANAME in the query

    regards
    anandkl
    Last edited by anandkl; 01-29-2004 at 07:27 AM.
    anandkl

  8. #8
    Join Date
    Jan 2003
    Location
    india
    Posts
    175
    in which case username and schemaname be different?

    if never means what is the need to have 2 different columns?

    -Raja

  9. #9
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by anandkl
    Hi,

    When a USER is created an empty schema is created and the USER owns the schema.

    Schema is nothing but a collection of database objects associated with a particular database user

    So when u execute the below command
    select username,schemaname from v$session where status='ACTIVE';

    USERNAME SCHEMANAME
    ------------------------------ ------------------------------
    SYS
    SYS
    SYS
    SYS
    SYS
    SYS
    SYS
    SYS SYS

    You see that few entries under USERNAME r blank, but under SCHEMA there is an entry.So i would consider using SCHEMANAME in the query

    regards
    anandkl
    U r seeing blank for username (logged user) coz they are background processes..

    i will giv u u a scenario wher u will have username and schemaname different and then u will realize why oracle have provided username and schemaname as 2 diff cols..

    create a master detail table with FK enforced on detail table with CASCASE = TRUE...

    and then delete recs from Master, see continuiously wass happening with the col schemaname in v$session.

    Abhay.
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  10. #10
    Join Date
    Aug 2001
    Location
    chennai,bangalore
    Posts
    840
    No..its not different,
    It just for SYS users, i feel.These might be some hidden users used for DOING some internal recursive DB calls.And the schema for those users might be SYS.

    regards
    anandkl
    anandkl

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