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 > How to automaticaly execute db2profile after user login on Linux?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-12-07, 02:06
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
How to automaticaly execute db2profile after user login on Linux?

Hi,
on DB2 v9.1 on Red Hat Linux I have created new user 'test'. After login into Linux (by command 'su - test') I need to execute db2profile from /home/db2inst1/sqllib/db2profile to enable db2 profile. How to set automatic start of db2profile after login of 'test' user?
Thanks,
Grofaty
Reply With Quote
  #2 (permalink)  
Old 04-12-07, 02:12
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Look at the .profile file of the instance owner, and copy the DB2 lines over to your other user's .profile file. The .profile file is a hidden file on their home directory. You can see hidden files with:

ls -all
__________________
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 04-12-07, 02:35
guyprzytula guyprzytula is offline
Registered User
 
Join Date: Jun 2006
Posts: 471
profile

or create an client instance for this user
from root : db2icrt....
the complete environment will be set for this user
__________________
Best Regards, Guy Przytula
DB2 UDB LUW certified V6/7/8
Reply With Quote
  #4 (permalink)  
Old 04-12-07, 02:47
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by guyprzytula
or create an client instance for this user
from root : db2icrt....
the complete environment will be set for this user
If you create a client instance for a user, and there are multiple server instances on the machine, what is the default instance for that user?

For that matter, even if there is only one instance, does the client instance user have to catalog databases on the server instance as remote databases? If so, maybe that is not what they are looking for.
__________________
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 04-12-07, 06:23
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Quote:
Originally Posted by Marcus_A
If you create a client instance for a user, and there are multiple server instances on the machine, what is the default instance for that user?

For that matter, even if there is only one instance, does the client instance user have to catalog databases on the server instance as remote databases? If so, maybe that is not what they are looking for.
The user itself has its own instance - a client instance. Thus, you will have to catalog local/remote nodes and the required databases at those nodes.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #6 (permalink)  
Old 04-17-07, 02:20
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Quote:
Originally Posted by Marcus_A
Look at the .profile file of the instance owner, and copy the DB2 lines over to your other user's .profile file.
Hi,
it is interesting this file .profile doesn't exist. So I created it manually and it is not started during "su - user" on Red Hat Enterprise, but it runs well on Ubuntu Linux and Suse Linux.

So instead of putting commands into .profile I have put commands into .bash_profile and now it works.

I am not an expert on Linux, but for months or so I have experienced some funny things using DB2 on different Linux distributions (Red Hat, Suse, Ubuntu, Fedora). Maybe I am little bit pessimistic, but it looks like Unix story is repeating at Linux - compatibility problems.
Thanks for help,
Grofaty
Reply With Quote
  #7 (permalink)  
Old 03-12-09, 03:12
sumanthvm sumanthvm is offline
Registered User
 
Join Date: Feb 2009
Posts: 5
Thank You


Sumanth
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