如何在db2 syscat.dbauth表中授予或更新'createsecureauth'特权?

时间:2019-01-28 08:35:41

标签: security db2

通过以下DB2查询,我可以查看“ CREATESECUREAUTH”特权:

select grantee, granteetype, createsecureauth from syscat.dbauth

以上查询结果:

GRANTEE     GRANTEETYPE     CREATESECUREAUTH
--------------------------------------------
DB2INST     U       N

现在,我想将被授予者“ DB2INST”的createsecureauth特权从“ N”更新为“ Y” 但是我不能用“ GRANT”或“ UPDATE”来做到这一点。 怎么做?

2 个答案:

答案 0 :(得分:0)

该特权的调用方式有所不同,请检查GRANT syntax

GRANT CREATE_SECURE_OBJECT ON DATABASE TO USER HENRIK

该特权允许创建安全对象,即安全触发器和安全功能。

答案 1 :(得分:0)

以下SQL将SYSCAT.DBAUTH的列映射到GRANT(或REVOKE)语句中使用的特权的名称

SELECT A.GRANTEE        AS AUTHID
,      A.GRANTEETYPE    AS AUTHIDTYPE
,      B.PRIVILEGE
,      CASE WHEN B.AUTH = 'G' THEN 'Y' ELSE 'N' END AS GRANTABLE
,      CURRENT SERVER   AS OBJECTNAME
,      ''               AS OBJECTSCHEMA
,      CAST ('DATABASE' AS VARCHAR (11)) AS OBJECTTYPE
FROM SYSCAT.DBAUTH A          
, LATERAL(VALUES
    (BINDADDAUTH         ,'BINDADD')
,   (CONNECTAUTH         ,'CONNECT')
,   (CREATETABAUTH       ,'CREATETAB')
,   (DBADMAUTH           ,'DBADM')
,   (EXTERNALROUTINEAUTH ,'CREATE_EXTERNAL_ROUTINE')
,   (IMPLSCHEMAAUTH      ,'IMPLICIT_SCHEMA')      
,   (LOADAUTH            ,'LOAD')
,   (NOFENCEAUTH         ,'CREATE_NOT_FENCED_ROUTINE') 
,   (QUIESCECONNECTAUTH  ,'QUIESCE_CONNECT')
,   (LIBRARYADMAUTH      ,'LIBRARYADMAUTH')
,   (SECURITYADMAUTH     ,'SECADM')
,   (SQLADMAUTH          ,'SQLADM')
,   (WLMADMAUTH          ,'WLMADM')
,   (EXPLAINAUTH         ,'EXPLAIN')
,   (DATAACCESSAUTH      ,'DATAACCESS')
,   (ACCESSCTRLAUTH      ,'ACCESSCTRL')
) B ( AUTH, PRIVILEGE )
WHERE  B.AUTH IN ('Y','G')