使用以下语法检查在非限制性数据库上授予PUBLIC
的数据库权限:
第1步 ,首先启动数据库。
db2start
第2步 ,激活数据库 “XYZ”。
db2 activate db XYZ
第3步 ,连接到 “XYZ” 数据库。
db2 connect to XYZ
现在验证数据库的权限:
语法:
db2 "select substr(authority,1,25) as authority, d_user, d_group,
d_public, role_user, role_group, role_public,d_role from table(
sysproc.auth_list_authorities_for_authid ('public','g'))as t
order by authority"
示例:
db2 "select substr(authority,1,25) as authority, d_user, d_group, d_public, role_user, role_group, role_public,d_role from table(
sysproc.auth_list_authorities_for_authid ('public','g'))as t order by authority"
执行结果如下: