1개의 서버 장비에 여러 개의 인스탄스를 띄워야 하는 경우
다음과 같이 오라클 UNIX 계정의 .profile을 구성하면 편리하게
관리할 수 있다.
-------------------- < .profile 내용 > -----------------------------
##########################################################
###################### 호출 함수 #########################
##########################################################
if [ "$HERE_HOME"="" ]; then
export HERE_HOME=`echo ``pwd```
fi
unset ORACLE_SID
SetSID() {
while true
do
unset TEMP
echo ""
echo "###########################################"
echo "# 1) 프로젝트 개발 (DEVDB) #"
echo "# 2) 통합 시험 (TESTDB) #"
echo "# q) 종료 (default DEVDB) #"
echo "###########################################"
read "TEMP? ▣ 사용할 DB를 선택하십시오 : "
case $TEMP in
"1")
ORACLE_SID=DEVDB; export ORACLE_SID
echo " [프로젝트 개발(DEVDB)]을 선택하셨습니다."
break
;;
"2")
ORACLE_SID=TESTDB; export ORACLE_SID
echo " [통합시험(TESTDB)]을 선택하셨습니다."
break
;;
"Q")
ORACLE_SID=DEVDB; export ORACLE_SID
echo " [프로젝트 개발(DEVDB)]을 선택하셨습니다."
break
;;
"q")
ORACLE_SID=DEVDB; export ORACLE_SID
echo " [프로젝트 개발(DEVDB)]을 선택하셨습니다."
break
;;
*)
unset ORACLE_SID
;;
esac
done
}
##########################################################
###################### 함수 호출 #########################
##########################################################
if [ ! "$ORACLE_SID" ]
then
SetSID
fi
##########################################################
##########################################################
##########################################################
export PS1='$ORACLE_SID:$PWD> '
banner $ORACLE_SID
umask 022
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export NLS_LANG=American_America.KO16MSWIN949
export ORA_NLS10=$ORACLE_HOME/nls/data
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export SHLIB_PATH=$ORACLE_HOME/lib32:/lib:/usr/lib
export PATH=$PATH:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ccs/bin
export PATH=$PATH:/etc:/bin:/usr/ucb:/usr/bin/X11:/sbin
export PATH=$PATH:.:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch
# export DISPLAY=10.182.52.156:0.0
export LANG=C
export TERM=vt100
export EDITOR=vi
set -o vi
stty erase ^H
alias home='cd $ORACLE_HOME'