DB2 database authorization is implemented through the GRANT command. After DB2 database authorization, users can perform corresponding operations on DB2.
DB2 database authorization consists of privileged groups and advanced database management program instance-level maintenance and practical operations. Of the five permissions available for DB2, SYSADM, SYSCTRL, and SYSMAINT are instance-level permissions. This means that their range includes instance-level commands and commands for all databases in this instance. These permissions can only be assigned to a group. You can assign these permissions through the dbm cfg file.
DBADM and LOAD permissions for specific databases can be assigned to users or user groups. You can use the GRANT command to explicitly assign these permissions.
Get SYSADM Permissions
SYSADM permissions are controlled by the SYSADM_GROUP parameter in the dbm cfg file. In Windows, this parameter is set to Administrator when an instance is created. However, if you run the db2 get dbm cfg command, it looks empty ). On UNIX, It is set as the master Group of the user who created the instance.
Because only SYSADM users are allowed to update the dbm cfg file, only the users can grant any SYS * permission to other groups. The following example shows how to grant SYSADM permissions to the db2grp1 group:
Db2 update dbm cfg using SYSADM_GROUP db2grp1
Obtain SYSCTRL Permissions
Users with SYSCTRL permissions can execute all management and maintenance commands in the instance. However, unlike SYSADM users, they cannot access any data in the database unless they are granted the privileges required to access the data. The command example that the SYSCTRL user can execute on any database in the instance is as follows:
* Db2start/db2stop
* Db2 create/drop database
* Db2 create/drop tablespace
* Db2 backup/restore/rollforward database
* Db2 runstats for any table)
* Db2 update db cfg for database dbname
Users with SYSADM permissions can use the following command to assign SYSCTRL to a group:
Db2 update dbm cfg using SYSCTRL_GROUP group name
Create a table in DB2 -- a table with an auto-incrementing Column
DB2 rename a table and view table information
Deep analysis DB2 modification table
DB2 mount command performance factors
How to back up all tables in DB2