If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Creating userids for db2 on linux

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-13-07, 17:39
rev1976 rev1976 is offline
Registered User
 
Join Date: Dec 2007
Posts: 78
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.
Reply With Quote
  #2 (permalink)  
Old 12-13-07, 18:06
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #3 (permalink)  
Old 12-13-07, 21:56
rev1976 rev1976 is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 12-13-07, 22:17
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #5 (permalink)  
Old 12-13-07, 22:20
rev1976 rev1976 is offline
Registered User
 
Join Date: Dec 2007
Posts: 78
Great. Thanks for the clarification.
Reply With Quote
  #6 (permalink)  
Old 12-14-07, 08:01
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
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
Reply With Quote
  #7 (permalink)  
Old 12-14-07, 09:23
rev1976 rev1976 is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 12-14-07, 11:35
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
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
Reply With Quote
  #9 (permalink)  
Old 12-14-07, 15:21
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On