On AIX (I'm not intimate with Solaris... yet), you run a script called 'db2profile' located in the instance owner's home directory under the 'sqllib' directory. (ie db2inst1/sqllib/db2profile).
This sets *all* the environment variables required by DB2, and is probably the most 'supported' (notice the quotes) way to set environment variables. If you don't trust that script to not contain malicious code, since you may or may not be owned by someone else, (Who? Me? Paranoid?) you could run the script once, then do a "set |grep DB2" to get all the variables that relate to DB2, then set them inside your own Perl code as recommended by Stephen Keller. This however exposes you to additional maintenance if IBM should decide to change the 'db2profile' script to include or exclude additional variables in the future. Ah, the double-edged sword of programming... -JD. >To anyone who can provide some insight, > >To interface with a DB2Connect Client on a Solaris platform, I am using >DBI and >DBD::DBD2. When I run a simple test connection script as the db2 instance user >defined when installing the DB2COnnect Client (db2inst1) I have no >problem. But >when I attempt to run the same test connection script as another user I >get the >following error: > >Total Environment allocation failure! Did you set up your DB2 client >environment? > >So far I have a work around which is to set the following environment >variable: > >$ export DB2INSTANCE=db2inst1 > >If I do this, it works correctly, but this is not a practical solution for me. >Does anyone have any alternative solutions? > >Thanks, > >Brad > >__________________________________________________ >Do You Yahoo!? >Yahoo! Sports - Coverage of the 2002 Olympic Games >http://sports.yahoo.com
