Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2009
    Posts
    3

    Unanswered: Developers using multiple users

    Hi,

    I'm a co-op student who is relatively new to db2, and have a seemingly straightforward task assigned to me.

    Right now the developers here all use the default instance owner db2inst1 to access our database if they ever need it for any reason. We are looking to create a different user that would only have select permissions to avoid accident insertions, etc.

    If anyone could point me in the right direction that would be great. For example, would i need to create that user as the OS-level as well as adding it as a database user? I've created a user and applied the right permissions in the database control centre, but I don't understand how to actually "be" that user.

    Thanks to anyone who takes the time...

    (I'm not sure if matters because my question isn't that technical based, but I'm on RedHat and we're using v9.5 fix pack 0. Unwarranted type.)

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Do this on the DB2 server:

    1) Change the OS password for db2inst1 - do not give it to the developers
    2) Create a new OS group (e.g. devg)
    3) Create a new OS user in the new group (e.g. devuser)
    4) Grant the appropriate rights in DB2 to the new group


    Andy

  3. #3
    Join Date
    Aug 2009
    Posts
    3
    Thanks for the quick reply!

    I did those steps and am realizing that db2 seems to be only installed on the db2inst1 account... is that normal? I thought I would be able to 'db2 connect to [ourdb] user devuser' as the db2inst1 user to work around that, but then it seems the database is empty.

    I guess I'll try adding DB2 to the devuser?

    Thanks again!

    Tiffany

  4. #4
    Join Date
    Aug 2009
    Posts
    3
    Oops, I just realized that my original thought of connecting as a different user would require the db2inst1 password.. nevermind that...

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    One of the rights in DB2 that you need to grant to the group is CONNECT. Once you have that then you should be able to connect using a statement like:

    db2 connect to mydb user devuser using devuser-passoword

    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •