DB2-create users and groups, database 1. Add an operating system user groupadd test --- add user group test useradd-m-g test-d/home/test --- add user test passwd test --- change the password of test 2, grant DB2 permissions to db2 connect to sample --- connect to the sample database db2 grant connect on database to user test --- grant the connect permission to the test user sample database db2 connect reset -- close the connection 3. Modify the test user. bashrc file # Add the following code to the user test. bashrc file. If [-f/db2home/db2inst1/sqllib/db2profile]; then. /db2home/db2inst1/sqllib/db2profile fi # test the Connection source. bashrc db2 connect to sample know how to add a DB2 user. What should I do if I want to delete a DB2 user? It's easy to delete users in the operating system, as shown in the following figure: userdel test --- delete an operating system user DB2 user permission control: 1) Create an instance: we have created the database test under DB2 user db2inst1, And the test_table table and test_procedure stored procedures exist below. We have created an empty proxy user agent_user (both db2inst1 and agent_user are operating system users) and set the same environment variables as db2inst1. 2) log on to the db2inst1 user, connect to the test database, and grant the select permission of the test table and the excute permission of the stored procedure to the Agent user agent_user. $ Db2 connect to test $ db2 "grant select on db2inst1. test_table to agent_user "$ db2" grant excute on db2inst1. test_procedure to agent_user "3) log on to the agent_user and set the current mode and specify the SQL Execution path: $ db2" set current schema db2inst1 "$ db2" set current path db2inst1"