Granting view schema for DB2 zSeries on mainframe

Hi experts,

I am trying to grant users a privilege to view some schemas on my DB2 mainframe. After looking around, I can only find this:

I don't want the users to be able to either create, drop, or alter. They only need to be able to see the schema and select tables in the schema.

Would you please kindly advise me on how to do this?

Thank you!!!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Irmawaty, grant select permissions to the user or group per table with a command like this:

Grant SELECT on table schema.tablename to user userid


Grant SELECT on table schema.tablename to group usergroup

You can't grant select privileges at the schema level.

hope this helps,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
if there are alot of tables in the schema, granting select will be difficult, you can use following to create a script file:

SELECT 'GRANT SELECT ON ' || TABSCHEMA || '.' || TABLENAME || ' to user userA;' from syscat.tables where tabschema = 'DB2ADMIN';

easiest way to do this is to use the db2 Control Center.
Go to User abd Group Objects
Select DB Users
Select the user name, right click and choose change
From the tab selections, choose tables
Then choose Add table
Then select the schema name the tables
From the list of tables, highlight each table name in blue by clicking on it once, or click the entire group of tanles.
Click ok or apply
The tables are now put in new conatiner where you can set the select priv. You can do this one table at a time or highlight all the tables and adjust your priv allocations.
Click apply

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.