Here I am connecting IBM DB2 database
Looking our privileges.
Filtering user/group level
Via our client
[NOTE]
Following statement retrieves all authorization names with privileges.
SELECT DISTINCT GRANTEE, GRANTEETYPE, 'DATABASE' FROM SYSCAT.DBAUTH
UNION
SELECT DISTINCT GRANTEE, GRANTEETYPE, 'TABLE ' FROM SYSCAT.TABAUTH
UNION
SELECT DISTINCT GRANTEE, GRANTEETYPE, 'PACKAGE ' FROM SYSCAT.PACKAGEAUTH
UNION
SELECT DISTINCT GRANTEE, GRANTEETYPE, 'INDEX ' FROM SYSCAT.INDEXAUTH
UNION
SELECT DISTINCT GRANTEE, GRANTEETYPE, 'COLUMN ' FROM SYSCAT.COLAUTH
UNION
SELECT DISTINCT GRANTEE, GRANTEETYPE, 'SCHEMA ' FROM SYSCAT.SCHEMAAUTH
UNION
SELECT DISTINCT GRANTEE, GRANTEETYPE, 'SERVER ' FROM SYSCAT.PASSTHRUAUTH
ORDER BY GRANTEE, GRANTEETYPE, 3
All authorization names that have been directly granted DBADM authority
SELECT DISTINCT GRANTEE, GRANTEETYPE FROM SYSCAT.DBAUTH
WHERE DBADMAUTH = 'Y'
Here is permission I have for db2test1 user
Here I am using user you can try role for this even.
you will no need provide grant right for here, accessing is enough
Starting wso2 with db2
Here is user I am going to use to connect wso2 product in db2
1. Update master-datasources.xml in wso2 product as below
<datasource>
<name>WSO2_CARBON_DB</name>
<description>The datasource used for registry and user manager</description>
<jndiConfig>
<name>jdbc/WSO2CarbonDB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:db2://localhost:50000/regdb7</url>
<username>db2test1</username>
<password>password1</password>
<driverClassName>com.ibm.db2.jcc.DB2Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
2. Add libs ‘repository\components\lib’
db2jcc.jar
db2jcc_license_cu.jar
3. Now Start wso2 server
4. Here is my db2 table (that was created with out –Dsteup)
Here is tables
Here is User mgt
Reg tables check
274 RECORDS are added
[TIPS]
To verify you we with correct user with greg, do not try on production level. Here I stop my db2 user privilege of connect as below.
Going ‘madhuka’ (DBADM) account stop connect privilege
you see greg go off
You will see ‘UM_DIALECT’ table sql error and ‘Error in getting the tenants.’ as this is table we try to access firstly.
You can mount ESB for this and play around. (ESB with offset 1)
greg offset 0
WSO2 ok to go with DB2
No comments:
Post a Comment