DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Trending

  • Deep Q-Learning Networks: Bridging the Gap from Virtual Games to Real-World Applications
  • Tomorrow’s Cloud Today: Unpacking the Future of Cloud Computing
  • How To Use an Automatic Sequence Diagram Generator
  • An Overview of Cloud Cryptography

Trending

  • Deep Q-Learning Networks: Bridging the Gap from Virtual Games to Real-World Applications
  • Tomorrow’s Cloud Today: Unpacking the Future of Cloud Computing
  • How To Use an Automatic Sequence Diagram Generator
  • An Overview of Cloud Cryptography
  1. DZone
  2. Data Engineering
  3. Databases
  4. DB2 database and User Privileges

DB2 database and User Privileges

Madhuka  Udantha user avatar by
Madhuka Udantha
CORE ·
May. 05, 14 · Interview
Like (0)
Save
Tweet
Share
1.52K Views

Join the DZone community and get the full member experience.

Join For Free

IBM DB2 is a family of database server products developed by IBM. Here I was connecting DB2 and WSO2 products. Here I will show how to create users and grant privileges for DB2 users.

Here I have two users. One is 'madhuka' and and second user is 'db2test1'. Madhuka has all the rights (admin). db2test1 is a standard user. I have db2 database called 'regdb7'.

Here I am try to connect to regdb7 from user 'db2test1'.

image

db2test1 user does not have privilege to connect to regdb7.

Now user 'madhuka' (admin) connects to db and gives privileges to db2test1 user.

db2 => connect to regdb7 user madhuka using <password>

image

Here pass user grants

image

Then quit

Now try connect from db2test1

image

Yap, you are in.

You can revoke the permission from

db2=> REVOKE CONNECT ON DATABASE FROM USER db2test1

Here we try it out:

image

Here is full use case that we try:

image

Here is privilege list to try:

[1] http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.sec.doc%2Fdoc%2Fc0005478.html


Db2 Database Database

Published at DZone with permission of Madhuka Udantha, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Deep Q-Learning Networks: Bridging the Gap from Virtual Games to Real-World Applications
  • Tomorrow’s Cloud Today: Unpacking the Future of Cloud Computing
  • How To Use an Automatic Sequence Diagram Generator
  • An Overview of Cloud Cryptography

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: