DB2权限

DB2的权限(authorization)

db2的权限是以层次结构的形式体现的,用于将一组预先确定的权限授予用户账户组。

DB2中包括两类权限:实例权限和数据库权限

实例权限包括:SYSADM, SYSCTRL, SYSMAINT, SYSMON等,权限范围包括实例级命令 和 针对该实例所有数据库的命令,通过DBM CFG文件分给组, 这些权限且只能分配给组。

数据库权限包括:DBADM, SECADM, LOAD这三种权限,可以通过GRANT分配给用户或用户组。

其中SYSCTRL、SYSMAINT、SYSMON权限级别的用户不能访问数据,DBAMD、LOAD权限级别的用户可以访问数据。


                                                                                   

  

                                                                                                   权限图

查看当前权限:

1)db2 connect to test 连上数据库

2) db2ilist 查看所有实例

3)db2 get instance 查看当前数据库所在实例

4)db2 get authorizations 查看自己拥有的权限


SYSADM: DB2 UDB中最高的管理权限级别,可以发出数据库管理器(实例)和数据库命令,及访问数据库管理器实例中任何数据库任何表中的数据,一句话:什么都能做。

                 该权限供对需要使用程序和数据的完全访问权的DB2 UDB管理员使用。

SYSCTRL:最高的系统控制权限级别,提供对数据库管理器实例及其数据库执行维护和管理操作的能力,但不允许访问数据库中的数据。

                    该权限供管理一个包含敏感数据的数据库管理器实例的用户使用。(仅管理一个实例(包含实例中的数据库),并且不能access数据库中的数据)

SYSMAINT: 比SYSCTRL低一个级别,提供对数据库管理器实例及其数据库执行维护和管理操作的能力,但不允许访问数据库中的数据。

                    该权限供管理一个包含敏感数据的数据库管理器实例中的数据库的用户使用。   

SYSMON:提供获得数据库管理器实例及快照的功能。该权限不允许改变系统资源的使用。

------------------------------------------------------

SECADM 权限是对特定数据库的安全性管理权限。此权限允许您创建和管理与安全性相关的数据库对象以及授予和撤销所有数据库权限和特权。此外,安全性管理员可以执行审计系统例程以及管理还有哪些用户可以执行审计系统例程。SECADM 权限能够从目录表和目录视图中进行选择,但是无法访问存储在用户表中的数据。SECADM 权限只能由安全性管理员(拥有 SECADM 权限)授予,并且可授予用户、组或角色。PUBLIC无法直接或间接获取 SECADM 权限。数据库必须至少有一个具备 SECADM 权限的 USER 类型的授权标识。无法从 USER 类型的每个授权标识撤销 SECADM 权限。


DBADM: 对一个实例中的特定数据库的次高管理权限级别,允许用户运行某些实用程序,发出数据库命令及访问数据库中表的数据。

                该权限供需要完全访问数据库对象和数据,但是不需要完整的维护权限的管理员使用。(一般用于开发人员)

LOAD: 允许用户调用LOA实用程序。

             该权限供只想批量load一组新数据的用户使用。



=======================================================DB2 10.1

Instance level authorities

Instance levelauthorities enable you to perform instance-wide functions, such ascreating and upgrading databases, managing table spaces, and monitoringactivity and performance on your instance. No instance-level authorityprovides access to data in database tables. The following diagramsummarizes the abilities given by each of the instance level administrativeauthorities:
  • SYSADM -for users managing the instance as a whole
  • SYSCTRL -for users administering a database manager instance
  • SYSMAINT -for users maintaining databases within an instance
  • SYSMON -for users monitoring the instance and its databases

A user with a higher-level authority also has the abilitiesgiven by the lower level authorities. For example, a user with SYSCTRLauthority can perform the functions of users with SYSMAINT and SYSMONauthority as well.

Figure 1. Instance-level authorities
Figure shows the instance level authorities: SYSADM, SYSCTRL, SYSMAINT, and SYSMON.

Database level authorities

Database levelauthorities enable you to perform functions within a specific database,such as granting and revoking privileges, inserting, selecting, deletingand updating data, and managing workloads. The following diagramsummarizes the abilities given by each of the database level authorities. The administrative database authorities are:
  • SECADM - for users managing security within a database
  • DBADM - for users administering a database
  • ACCESSCTRL - for users who need to grant and revoke authoritiesand privileges (except for SECADM, DBADM, ACCESSCTRL, and DATAACCESSauthority, SECADM authority is required to grant and revoke theseauthorities)
  • DATAACCESS - for users who need to access data
  • SQLADM - for users who monitor and tune SQL queries
  • WLMADM - for users who manage workloads
  • EXPLAIN - for users who need to explain query plans (EXPLAIN authoritydoes not give access to the data itself)

The following diagram shows, where appropriate, whichhigher level authorities include the abilities given by a lower levelauthority. For example, a user with DBADM authority can perform thefunctions of users with SQLADM and EXPLAIN authority, and all functionsexcept granting USAGE privilege on workloads, of users with WLMADMauthority.

Figure 2. Database-level authorities
Figure shows the database level authorities: SECADM, DBADM, ACCESSCTRL, DATAACCESS, SQLADM, WLMADM and EXPLAIN.

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值