20 July,2011 by Tom Collins
Take these steps to generate SELECT privileges for a given USER on all tables in a SCHEMA
Either create a shell script and execute, or run from the command prompt
MYDB="" MYSCHEMA="" MYUSER="" db2 "CONNECT TO $MYDB" DBTABLES=`db2 -x "SELECT tabname FROM syscat.tables WHERE tabschema=UPPER('$MYSCHEMA')"` for TABLENAME in $DBTABLES; do db2 "GRANT SELECT ON $MYSCHEMA.$TABLENAME TO USER $MYUSER" done db2 "DISCONNECT $MYDB"
DBA Interview Questions and Answers – DB2 Security Management
This is only a preview. Your comment has not yet been posted.
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.
Posted by: |