Skip to content

Instantly share code, notes, and snippets.

@rch317
Created April 20, 2017 01:17
Show Gist options
  • Save rch317/c0919bf15819acaa1938249aca5daf4d to your computer and use it in GitHub Desktop.
Save rch317/c0919bf15819acaa1938249aca5daf4d to your computer and use it in GitHub Desktop.
Grant the cpe_db_user dbadm access to all of the available databases
#!/bin/bash
#
# Stole this from an existing jazzdb user script
#
for i in $(db2 list database directory|grep alias|awk '{print $4}')
do
db2 connect to $i;
db2 grant dbadm on database to user cpe_db_user;
db2 terminate;
done
### not sure why you need to restart the db for a grant
db2stop force
db2start
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment