I am an oracle/sql server DBA having limited knowledge in IBM DB2. We have DB2 9.7 fp4 running on AIX 6. I would like to create a new user and grant him READ only privilege on a particular database. Please help!
Thanks & Regards Mohammed
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
There is no read only privilege on a database in DB2. You will need to grant
SELECT privileges on specific tables, preferably via a role to avoid doing this multiple times.
create role readonly.
SELECTprivileges on the required tables to that role:
grant select on myschema.mytable to role readonly.
# mkuser newuser.
grant role readonly to user newuser.
Note that the new user will likely need to change the initial password before he or she can connect to the database.