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

Thread: View that shows table columns for which user has privileges

  1. #1
    Join Date
    Jul 2000
    Posts
    41
    Hi,

    I have a user that wants to see a list of all tables and columns
    of tables that he has being granted select privs to.
    He is accessing the database thru Access dabatase and has no
    access to SQL Plus. He wants to see the table and column information. I have logged in as him and
    queried dba_col_privs but returns no rows. I read then that at column level the only privs that can be granted are
    Update and Insert. How can I create a view that returns
    all columns names and table names and schema owner which
    could be seen by my user only. Thanks,
    Any help would be appreciated..
    CD

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    You can use the following views:

    USER_ROLE_PRIVS
    USER_SYS_PRIVS
    USER_TAB_PRIVS
    USER_TAB_PRIVS_MADE
    USER_TAB_PRIVS_RECD ( Privileges received on other schemas )


    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  3. #3
    Join Date
    Jul 2000
    Posts
    41
    I could see the list of tables that my user have been granted
    select privs on other schemas all right by
    quering

    select owner, table_name, grantor
    from
    user_tab_privs_recd;

    in user schema.
    How can I see the column name for each table? if I try to
    query user_col_privs_recd I get zero rows... Shuldn't return a list of the columns of the tables the user has privs to select from?





  4. #4
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    The reason is as follows.

    If the user had been given a privilege on the table level, then you would not see the table's columns to be listed under USER_COL_PRIVS_RECD. It would be an extra over head on the dictionary. On the other hand, if the user had received a colum level previlege on any table, instead of the whole table, then you would see that on the USER_COL_PRIVS_RECD and not on the USER_TAB_PRIVS_RECD .

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  5. #5
    Join Date
    Jul 2000
    Posts
    41
    All right then, is there a way for my user to see the columns
    of tables he has select privs or not?
    I just cannot believe that Oracle does not have this feature. Even SQL Server has
    sp_columns...

    How can I solve this?
    Thanks,
    CD

  6. #6
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    I dont think you can restrict the select priv on specific columns of a table of an user, only references, update and insert works

    you have to create a view for this user

    this is an enhancement request to Oracle

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