• 3 replies
  • Latest Post - ‏2013-08-08T11:01:05Z by 9RYQ_Kiran_mk
1 Post

Pinned topic Read only access to Database

‏2013-05-21T20:27:29Z |


Is there a way to grant a read only role to users in DB2 10.1 FP2 LUW? Simiar to the datareader role in SQL Server?

With this the user should only be able to run SELECT queries against the database, and nothing  else.



Updated on 2013-05-21T20:27:36Z at 2013-05-21T20:27:36Z by JSSK_Chumma_Dede
  • Sreeharsha_Naik
    8 Posts

    Re: Read only access to Database


    There is no other way than granting only SELECT auth to the users on the tables within your database. Unlike mainframe you cannot set the DB to read only in LUW


  • Jotac
    82 Posts

    Re: Read only access to Database


    You can create the role by yourself as described here



  • 9RYQ_Kiran_mk
    78 Posts

    Re: Read only access to Database


    No as such. But you have to create the group or role give read access to a role or group. Then assign or add the user to that group to get only read access.  In case of any new table is created or added to the DB. Then give read or select access on that table to role or group. Automatically the users belong to that group will get read access. No need to provide any access on that table separately. Apart from this there is no other way as far as I know.

    In PostgreSQL or MySQL we can provide the read access on tables residing in a schema in one command. But I guess its not possible in DB2.