DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: User_tab_Privs

  1. #1
    Join Date
    Nov 2000
    Posts
    21
    All,

    How do I find out whether a User has access to a particular Table, I have tried using User_tab_privs, but it doesn't give me the info I need, can anyone help ?
    regards Giddy

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    you which table you have access or which user has access to your tables?

  3. #3
    Join Date
    Nov 2000
    Posts
    21
    whether a user has access to particular table or not
    regards Giddy

  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    select * from dba_tab_privs where table_name='XXX' and owner='YYY'

  5. #5
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    User can have access on a particular table if one of the following three conditions is met:

    1. Access to this particular table has been granted to user
    2. Access to this particular table has been granted to PUBLIC
    3. Acess to *ANY* table has been granted to this user.

    select owner, table_name, privilege from user_tab_privs
    where (grantee = user or grantee = 'PUBLIC')
    and owner = xowner and table_name = xtable
    union all
    select 'ANY SCHEMA', 'ANY TABLE', privilege from user_sys_privs
    where privilege like '% ANY TABLE';

    Point 1. and 3. above can also been granted to a role and then this role to a user. So you should enhance the above query by searching if any role granted to user has been granted points 1. and 3.
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

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