How to grant privileges for a windows username on a new schema

02 September,2015 by Tom Collins

Question: I am new to DB2 and have a question about the post  SQL0286N A default table space could not be found - DBA DB2

I want to access a database schema from a  client  on my desktop. However, I am not sure how to grant my windows username to the new schema

Answer:  On Windows , users and groups in db2 are handled by the OS, use OS tools to find the list of users.   You can then use various commands within DB2 to confirm privileges. And execute any GRANT statements

This includes local Windows users and Active Directory users

 SQL0286N A default table space could not be found - DBA DB2 - DBA DB2 outlines steps on how to grant privileges to a schema - but prior to executing these commands the user needs to be set up and added to a group

There are a number of different ways to organise users. The method below is based on users being added to a Windows group. Privileges are then assigned to the group.

Before you make any changes – find out whether the username you’re using is in the right Windows group. Typically – Windows groups are set up such as these examples:DB2ADMNS and DB2USERS. Then users are added to these groups.

Check in computer management | Local Users and Groups

Db2_users

If the intended user is not in the relevant group , then add to the group.

Proceed with granting privileges to the group by using  similar  commands  as on :SQL0286N A default table space could not be found - DBA DB2

Depending on your specific set up – you may need to grant to GROUP rather than USER. Follow this link to GRANT (schema privileges) statement  

Some other useful sql commands

To list all schemas on a database

select SCHEMANAME from syscat.schemata

 

To check user authority levels – check the sysibm.sysuserauth

 

Select * from sysibm.sysuserauth where grantee = ‘user’

 

Read More on Security Audits and auditing failed logins

DB2 security audit - DBA DB2

DB2 – Audit Failed logons - DBA DB2

 

 

Author: Rambler(http://www.dba-db2.com)

Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to grant privileges for a windows username on a new schema

Comments are moderated, and will not appear until the author has approved them.


dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright