Question

Je suis un DBA Oracle / SQL Server ayant une connaissance limitée dans IBM DB2.Nous avons DB2 9.7 FP4 en cours d'exécution sur AIX 6. J'aimerais créer un nouvel utilisateur et lui accorder uniquement le privilège sur une base de données particulière.S'il vous plaît aider!

Merci et salutations Mohammed

Était-ce utile?

La solution

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.

  1. Create a new database role, e.g. create role readonly.
  2. Grant SELECT privileges on the required tables to that role: grant select on myschema.mytable to role readonly.
  3. Create a new user in the operating system, e.g. # mkuser newuser.
  4. Grant the role to the user: 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à dba.stackexchange
scroll top