Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2007
    Posts
    78

    Unanswered: Creating userids for db2 on linux

    hi everyone,

    I just installed DB2 ESE on RH linux and created a couple of databases. I now need to create a separate admin id to access the databases with dbadm privledges. How would i go about doing that? I created the DB's using the control center and i thought i created the users but when i try to connect to a DB with an id it says that the id doesn't exist. Thanks.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Use the Linux "create user" command. DB2 uses Linux user and group athentication. You can grant the required DBA authority to the user or the group, even if the user or group has not been created yet in Linux (it will start working when the Linux id is created).
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Dec 2007
    Posts
    78
    Thanks Marcus,

    Sorry i'm still kinda of new to this. Can you provide me with some examples? I granted a user with dbadm authority through DB2 by connecting to the DB but i haven't set a password for the user yet. How would i do that? on the OS side or in DB2? Thanks again.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Read my lips. You must create the user id and the password in Linux. Linux is the operating system. If you don't know how to create a userid and set the password in Linux, try google or a Linux forum.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  5. #5
    Join Date
    Dec 2007
    Posts
    78
    Great. Thanks for the clarification.

  6. #6
    Join Date
    Jan 2003
    Posts
    1,605
    Rev1976,
    the easiest way to add user to Linux is by command:
    useradd -g db2grp1 -m -d /db2home/db2inst1 db2inst1 -p password1

    Notes:
    -g db2grp1 -> add user to this group
    -m -d /db2home/db2inst1 -> create home directory
    db2inst1 -> new user name
    -p password1 -> password

    If user already exists and you would like to change password:
    passwd userid

    Note:
    userid -> userid you would like to change password

    P.S. I recommend the following web site for Unix/Linux commands: http://www.computerhope.com/unix.htm

    Hope this helps,
    Grofaty

  7. #7
    Join Date
    Dec 2007
    Posts
    78
    Thanks Grofaty. I could also create a group with all my users and assign privledges in DB2 as ai see fit? Thanks again.

  8. #8
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    If you grant DB2 privledges to a group, make sure you use the GROUP key word in the grant statement. As aleady stated, the userid and group are defined in the Linux OS.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  9. #9
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Regarding groups: groups are not used for the validation of static embedded SQL. That's something you have to be aware of. If you don't know what the difference between static and dynamic embedded SQL is, you probably don't have to worry about this.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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