DB2-create users, groups, and databases

Source: Internet
Author: User
Tags db2 connect db2 connect to

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"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.