Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

DB2 database and User Privileges

DZone's Guide to

DB2 database and User Privileges

· Database Zone ·
Free Resource

Built by the engineers behind Netezza and the technology behind Amazon Redshift, AnzoGraph is a native, Massively Parallel Processing (MPP) distributed Graph OLAP (GOLAP) database that executes queries more than 100x faster than other vendors.  

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


Download AnzoGraph now and find out for yourself why it is acknowledged as the most complete all-in-one data warehouse for BI style and graph analytics.  

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}