Db2 简明教程
DB2 - Roles
Creating and granting membership in roles
Syntax: [创建新角色]
db2 create role <role_name>
Example : [创建名为“sales”的新角色以添加某些表,这些表将由某些用户或组管理]
db2 create role sales
Output:
DB20000I The SQL command completed successfully.
Granting role from DBADM to a particular table
Syntax: [向表授予角色的权限]
db2 grant select on table <table_name> to role <role_name>
Example : [向角色“sales”添加管理表“shope.books”的权限]
db2 grant select on table shope.books to role sales
Output:
DB20000I The SQL command completed successfully.
安全管理员向必需用户授予角色。(在你使用此命令之前,你需要创建用户。)
Syntax: [向角色添加用户]
db2 grant role <role_name> to user <username>
Example : [向角色“sales”添加用户“mastanvali”]
db2 grant sales to user mastanvali
Output:
DB20000I The SQL command completed successfully.