使用以下語法檢查在非限制性資料庫上授予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"
執行結果如下: