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 communityThere 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
.SELECT
privileges 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.
grant
statements in your process. It's quite easy to generate a script for that by selecting from SYSCAT.TABLES
.
Jun 25, 2014 at 11:19