f



New user to access db2

Hi, we need to setup a new user id which can access db2 , apart from db2inst1 as db2inst1 has all access/permission. The new id should have only limited access like should be able to connect to database, able to access system admin table to do monitoring. 

OS( AIX )team, has created a user and provided us.  

I searched on internet, to setup a new user to access DB2, need to update "profile" . but when I go to user name directory from /db2home/user_name . I don't find any file/directory.

I also tried running db2profile ( form home/db2inst1/sqllib) after login with new user . but it didn't help.  

COuld anyone help in this regard. Thanks in advance. 
0
Shashi
3/21/2016 10:55:47 PM
comp.databases.ibm-db2 12448 articles. 3 followers. arunrocks (9) is leader. Post Follow

5 Replies
899 Views

Similar Articles

[PageSpeed] 46

On Tuesday, March 22, 2016 at 4:25:49 AM UTC+5:30, Shashi Shekhar wrote:
> Hi, we need to setup a new user id which can access db2 , apart from db2i=
nst1 as db2inst1 has all access/permission. The new id should have only lim=
ited access like should be able to connect to database, able to access syst=
em admin table to do monitoring.=20
>=20
> OS( AIX )team, has created a user and provided us. =20
>=20
> I searched on internet, to setup a new user to access DB2, need to update=
 "profile" . but when I go to user name directory from /db2home/user_name .=
 I don't find any file/directory.
>=20
> I also tried running db2profile ( form home/db2inst1/sqllib) after login =
with new user . but it didn't help. =20
>=20
> COuld anyone help in this regard. Thanks in advance.


I just tried " . /db2home/db2inst1/sqllib/db2profile" after running this, I=
 am able to connect to database. but when I reopen the command window and a=
gain try to connect it says "db2 : not found"

Is there any way to save this?

Thanks
Shashi
0
Shashi
3/21/2016 11:19:01 PM
On 2016-03-21 23:19:01 +0000, Shashi Shekhar said:

> On Tuesday, March 22, 2016 at 4:25:49 AM UTC+5:30, Shashi Shekhar wrote:
>> Hi, we need to setup a new user id which can access db2 , apart from 
>> db2inst1 as db2inst1 has all access/permission. The new id should have 
>> only limited access like should be able to connect to database, able to 
>> access system admin table to do monitoring.>> OS( AIX )team, has 
>> created a user and provided us.
>> I searched on internet, to setup a new user to access DB2, need to 
>> update "profile" . but when I go to user name directory from 
>> /db2home/user_name . I don't find any file/directory.
>> 
>> I also tried running db2profile ( form home/db2inst1/sqllib) after 
>> login with new user . but it didn't help.
>> COuld anyone help in this regard. Thanks in advance.
> 
> 
> I just tried " . /db2home/db2inst1/sqllib/db2profile" after running 
> this, I am able to connect to database. but when I reopen the command 
> window and again try to connect it says "db2 : not found"
> 
> Is there any way to save this?

You need to edit the file $HOME/.profile, which initializes your 
environment when you log in to a Linux/UNIX box.

Add the lines (this assumes you're using ksh or bash as your shell):

    if [[ -f /db2home/db2inst1/sqllib/db2profile ]] ; then
        . /db2home/db2inst1/sqllib/db2profile
    fi


Then, log out and back in again.  Your DB2 environment will be initialized.



0
Ian
3/22/2016 9:01:09 PM
On Wednesday, March 23, 2016 at 2:31:13 AM UTC+5:30, Ian wrote:
> On 2016-03-21 23:19:01 +0000, Shashi Shekhar said:
> 
> > On Tuesday, March 22, 2016 at 4:25:49 AM UTC+5:30, Shashi Shekhar wrote:
> >> Hi, we need to setup a new user id which can access db2 , apart from 
> >> db2inst1 as db2inst1 has all access/permission. The new id should have 
> >> only limited access like should be able to connect to database, able to 
> >> access system admin table to do monitoring.>> OS( AIX )team, has 
> >> created a user and provided us.
> >> I searched on internet, to setup a new user to access DB2, need to 
> >> update "profile" . but when I go to user name directory from 
> >> /db2home/user_name . I don't find any file/directory.
> >> 
> >> I also tried running db2profile ( form home/db2inst1/sqllib) after 
> >> login with new user . but it didn't help.
> >> COuld anyone help in this regard. Thanks in advance.
> > 
> > 
> > I just tried " . /db2home/db2inst1/sqllib/db2profile" after running 
> > this, I am able to connect to database. but when I reopen the command 
> > window and again try to connect it says "db2 : not found"
> > 
> > Is there any way to save this?
> 
> You need to edit the file $HOME/.profile, which initializes your 
> environment when you log in to a Linux/UNIX box.
> 
> Add the lines (this assumes you're using ksh or bash as your shell):
> 
>     if [[ -f /db2home/db2inst1/sqllib/db2profile ]] ; then
>         . /db2home/db2inst1/sqllib/db2profile
>     fi
> 
> 
> Then, log out and back in again.  Your DB2 environment will be initialized.


Thanks Ian, It worked. 
0
Shashi
3/23/2016 1:25:20 AM
On Mon, 21 Mar 2016 16:19:01 -0700 (PDT), Shashi Shekhar wrote:

> On Tuesday, March 22, 2016 at 4:25:49 AM UTC+5:30, Shashi Shekhar
> wrote:
>
>> Hi, we need to setup a new user id which can access db2 , apart from
>> db2inst1 as db2inst1 has all access/permission. The new id should
>> have only limited access like should be able to connect to database,
>> able to access system admin table to do monitoring.
>>
>> OS( AIX )team, has created a user and provided us.
>>
>> I searched on internet, to setup a new user to access DB2, need
>> to update "profile" . but when I go to user name directory from
>> /db2home/user_name . I don't find any file/directory.
>>
>> I also tried running db2profile ( form home/db2inst1/sqllib) after
>> login with new user . but it didn't help.
>>
>> COuld anyone help in this regard. Thanks in advance.
>
>
> I just tried " . /db2home/db2inst1/sqllib/db2profile" after running
> this, I am able to connect to database. but when I reopen the command
> window and again try to connect it says "db2 : not found"

You almost have it. This is a little more of an AIX question than a DB2
one, but you need to put that source command into the ".profile" (note
carefully the dot) file for the user. You can do this by opening a
command window as the user, running the command

echo ". /db2home/db2inst1/sqllib/db2profile" >> ~/.profile

and then opening a new command window and trying the db2 command again
to make sure the change to .profile was correct.

(Note also please that not all methods of using that user ID will run
the .profile upon connection. Most do. But that's getting even further
off-topic.)

-- 
35. I will not grow a goatee. In the old days they made you look 
   diabolic. Now they just make you look like a disaffected member of 
   Generation X.
	--Peter Anspach's list of things to do as an Evil Overlord
0
Peter
3/23/2016 1:25:22 PM
On Wednesday, March 23, 2016 at 7:25:07 PM UTC+5:30, Peter H. Coffin wrote:
> On Mon, 21 Mar 2016 16:19:01 -0700 (PDT), Shashi Shekhar wrote:
> 
> > On Tuesday, March 22, 2016 at 4:25:49 AM UTC+5:30, Shashi Shekhar
> > wrote:
> >
> >> Hi, we need to setup a new user id which can access db2 , apart from
> >> db2inst1 as db2inst1 has all access/permission. The new id should
> >> have only limited access like should be able to connect to database,
> >> able to access system admin table to do monitoring.
> >>
> >> OS( AIX )team, has created a user and provided us.
> >>
> >> I searched on internet, to setup a new user to access DB2, need
> >> to update "profile" . but when I go to user name directory from
> >> /db2home/user_name . I don't find any file/directory.
> >>
> >> I also tried running db2profile ( form home/db2inst1/sqllib) after
> >> login with new user . but it didn't help.
> >>
> >> COuld anyone help in this regard. Thanks in advance.
> >
> >
> > I just tried " . /db2home/db2inst1/sqllib/db2profile" after running
> > this, I am able to connect to database. but when I reopen the command
> > window and again try to connect it says "db2 : not found"
> 
> You almost have it. This is a little more of an AIX question than a DB2
> one, but you need to put that source command into the ".profile" (note
> carefully the dot) file for the user. You can do this by opening a
> command window as the user, running the command
> 
> echo ". /db2home/db2inst1/sqllib/db2profile" >> ~/.profile
> 
> and then opening a new command window and trying the db2 command again
> to make sure the change to .profile was correct.
> 
> (Note also please that not all methods of using that user ID will run
> the .profile upon connection. Most do. But that's getting even further
> off-topic.)
> 
> -- 
> 35. I will not grow a goatee. In the old days they made you look 
>    diabolic. Now they just make you look like a disaffected member of 
>    Generation X.
> 	--Peter Anspach's list of things to do as an Evil Overlord


Thanks Peter, 
Working now. 
0
Shashi
4/1/2016 1:34:00 PM
Reply: