By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,286 Members | 1,290 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,286 IT Pros & Developers. It's quick & easy.

script to automate table grants like a current user?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.