If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > check if the tables have select privileges for a user in db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-19-12, 22:56
matt02 matt02 is offline
Registered User
 
Join Date: Jan 2012
Posts: 1
check if the tables have select privileges for a user in db2

hi,

I'm trying to execute a db2 query from unix shell script to find the all the schemas in the database which has a table - TAB_A in those schema and select permission for my user id on the table on that schema.

ie, i would pass arguments table name (TAB_A) and user id (matt02) and the select query should fetch me all the schemas which has a TAB_A and also have select privileges for matt02 on TAB_A.

thanks
matt
Reply With Quote
  #2 (permalink)  
Old 01-19-12, 23:21
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
DB2 does not authorize by schema, only by table, or the entire database for certain athorities like DBADM. You can find the table authorities in SYSCAT.TABAUTH catalog view. Database level authorities are in SYSCAT.DBAUTH. To find the list of all tables, independent of authorizations granted, you would look in SYSCAT.TABLES (but check the table "type" since it includes other objects such as views, etc).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On