Skip to content
Advertisement

How to block a user from executing select queries on a table in Db2?

I have a database ‘SAMPLE’ in which I need to block a user ‘DB2ADMIN’ from executing

JavaScript

I already tried

JavaScript

I get error SQL0556N and message “DB2ADMIN does not hold this privilege”, which means it shouldn’t have worked in first place.

Still I am able to get select query results when I log in with that account and execute above query. Can someone suggest a way out to do this.

Advertisement

Answer

The following query provide you information on why your DB2ADMIN user has SELECT or CONTROL privileges (if any) on the SYSIBMADM.DBMCFG view.

JavaScript

The following query provide you information on why your DB2ADMIN user has one of DATAACCESS, DBADM, SQLADM, SECADM or ACCESSCTRL authorities (if any) sufficient to select from this view. Update
Note, that the Authorization list for SYSIBMADM.DBMCFG is not correct. It’s one of the system catalog views, and one having SECADM or ACCESSCTRL database authority has an access to this view. So, we need to check both these user authorities in addition.

JavaScript
Advertisement