luckymlj
发贴: 18
积分: 0
|
于 2003-11-05 14:41
Ok, that's no problem! But I think if you install DB2 on linux, there will be a file named db2profile on that path. Any Way, I paste this file for all of you :) ============================================= # ############################################################################# # # Licensed Materials - Property of IBM # # 5724-B62 # (C) COPYRIGHT International Business Machines Corp. 1993, 2002 # # 5724-D54 # (C) COPYRIGHT International Business Machines Corp. 1993, 2002 # # 5765-F35 # (C) COPYRIGHT International Business Machines Corp. 1993, 2002 # # 5765-F43 # (C) COPYRIGHT International Business Machines Corp. 1993, 2002 # # 5765-F41 # (C) COPYRIGHT International Business Machines Corp. 1993, 2002 # # 5765-F30 # (C) COPYRIGHT International Business Machines Corp. 1993, 2002 # # 5765-F34 # (C) COPYRIGHT International Business Machines Corp. 1993, 2002 # # 5765-F31 # (C) COPYRIGHT International Business Machines Corp. 1993, 2002 # # 5765-F42 # (C) COPYRIGHT International Business Machines Corp. 1993, 2002 # # All Rights Reserved # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # ############################################################################# # # NAME: db2profile # # FUNCTION: This script sets up a default database environment for # Bourne shell or Korn shell users. # # USAGE: . db2profile # This script can either be invoked directly as above or # it can be added to the user's .profile file so that the # database environment is established during login. # # #### DO NOT EDIT THIS FILE #### # #############################################################################
# Default DB2 product directory DB2DIR="/usr/opt/db2_08_01"
# Function to avoid repetitive environment variable entries AddtoString() { var=$1 addme=$2 awkval='$1 != "'${addme?}'"{print $0}' newval=`eval /usr/bin/echo \\${$var} | /usr/bin/awk "${awkval?}" RS=:` eval ${var?}=`/usr/bin/echo $newval | /usr/bin/sed 's/ /:/g'`:${addme?} unset var addme awkval newval }
#----------------------------------------------------------------------- # DB2INSTANCE [Default null, values: Any valid instance name] # Specifies the instance that is active by default. #----------------------------------------------------------------------- DB2INSTANCE=db2inst1 export DB2INSTANCE
INSTHOME=/home/db2inst1
#----------------------------------------------------------------------- # First remove any sqllib entries from the user's path. # Add the directories: # INSTHOME/sqllib/bin - database executables # INSTHOME/sqllib/adm - sysadm executables # INSTHOME/sqllib/misc - miscellaneous utilities # to the user's PATH. #-----------------------------------------------------------------------
AddtoString PATH ${INSTHOME?}/sqllib/bin AddtoString PATH ${INSTHOME?}/sqllib/adm AddtoString PATH ${INSTHOME?}/sqllib/misc export PATH
#----------------------------------------------------------------------- # UDB Extender initialization #----------------------------------------------------------------------- if [ -f ${INSTHOME}/dmb/dmbprofile ]; then . ${INSTHOME}/dmb/dmbprofile fi
#----------------------------------------------------------------------- # The following variables are used for JDBC support #----------------------------------------------------------------------- CLASSPATH=${CLASSPATH:-""}
if [ -f ${INSTHOME?}/sqllib/java/db2java.zip ]; then AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/db2java.zip fi if [ -f ${INSTHOME?}/sqllib/java/db2jcc.jar ]; then AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/db2jcc.jar fi if [ -f ${INSTHOME?}/sqllib/java/sqlj.zip ]; then AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/sqlj.zip fi if [ -d ${INSTHOME?}/sqllib/function ]; then AddtoString CLASSPATH ${INSTHOME?}/sqllib/function fi
if [ -f ${INSTHOME?}/sqllib/java/db2jcc_license_cisuz.jar ]; then AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/db2jcc_license_cisuz.jar fi
if [ -f ${INSTHOME?}/sqllib/java/db2jcc_license_cu.jar ]; then AddtoString CLASSPATH ${INSTHOME?}/sqllib/java/db2jcc_license_cu.jar fi
AddtoString CLASSPATH . export CLASSPATH
#----------------------------------------------------------------------- # The following variables are used for Data Warehouse support #----------------------------------------------------------------------- if [ -d ${INSTHOME?}/sqllib/templates ]; then VWS_TEMPLATES=${INSTHOME?}/sqllib/templates export VWS_TEMPLATES fi if [ -d ${INSTHOME?}/sqllib/logging ]; then VWS_LOGGING=${INSTHOME?}/sqllib/logging export VWS_LOGGING fi VWSPATH=${INSTHOME?}/sqllib export VWSPATH
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-""} AddtoString LD_LIBRARY_PATH ${INSTHOME}/sqllib/lib export LD_LIBRARY_PATH
# If LIBPATH isn't set, AIX assumes "/usr/lib:lib". But if LIBPATH # is set, AIX makes no such assumption. Thus, to duplicate AIX's # behaviour, if LIBPATH is not set, add the assumptions, but if LIBPATH # is already set, we must make the same assumption that /usr/lib:lib is # already in the LIBPATH somewhere.
LIBPATH=${LIBPATH:-"/usr/lib:/lib"} AddtoString LIBPATH ${INSTHOME}/sqllib/lib export LIBPATH
# Any user changes to the environment goes into userprofile. Modifications # to db2profile may be overwritten in fixpaks. if [ -f ${INSTHOME?}/sqllib/userprofile ] then . ${INSTHOME?}/sqllib/userprofile fi
EXTSHM=ON export EXTSHM
why edited on 2003-11-05 15:16
|