469,303 Members | 2,047 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,303 developers. It's quick & easy.

script to automate table grants like a current user?

aj
DB2 WSE LUW 8.1 FP5
Red Hat AS 2.1

I would like to grant a new database user the same privileges
(across many tables and views) that a current user has.

Rather than doing it by hand, might anyone have a script that
automates this?

TIA

aj
Nov 12 '05 #1
2 1521
Write a query using "union all" selecting the data from the (10)
authorization tables. Use literals in the query to build the
authorization statements and include a statement terminator literal at
the end of each output row. Case constructs can be used to turn encoded
authorizations back into literals for the statements you are
constructing. Use the current user as a predicate to match
authorizations to a specific user.

Ship the output to a file then read it back into the command processor
to execute your statements.

Phil Sherman
aj wrote:
DB2 WSE LUW 8.1 FP5
Red Hat AS 2.1

I would like to grant a new database user the same privileges
(across many tables and views) that a current user has.

Rather than doing it by hand, might anyone have a script that
automates this?

TIA

aj

Nov 12 '05 #2
Ian
aj wrote:
DB2 WSE LUW 8.1 FP5
Red Hat AS 2.1

I would like to grant a new database user the same privileges
(across many tables and views) that a current user has.

Rather than doing it by hand, might anyone have a script that
automates this?


db2look -x ... | sed -e 's/OLDUSER/NEWUSER'

:-)
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Richard Holliingsworth | last post: by
1 post views Thread by Tim Pascoe | last post: by
2 posts views Thread by Federica T | last post: by
3 posts views Thread by muzamil | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.