John’s Oracle Experiences

My everyday experiences with Oracle products

Archive for January 1st, 2009

Customized Linux prompt

Posted by John Paul van Helvoort on January 1, 2009

I like to work with a linux prompt which indicates the current ORACLE_SID set at anytime.
Therefor i use a customized prompt which can be set in the profile of the oracle user.
The file to adjust for this is /home/oracle/.profile or .bash_profile

Just add these lines at the bottum of the file

################################
# BEGIN Change Unix prompt
################################
HOSTNAME=$(uname -n)
BOLD=$(tput bold)
NORM=$(tput sgr0)
PS1='$BOLD[$ORACLE_SID] $HOSTNAME:${PWD##/*/}> $NORM'
set -o emacs

echo "**********************************************************"
echo " Welcome on $HOSTNAME "
echo "* This is a OAS test server *"
echo "* Owner = *"
echo "* User oracle = owner oracle software *"
echo "**********************************************************"
echo ""

################################
# END Change Unix prompt
################################

After doing so, your prompt will look like this when you login as the oracle user;

xxx:~ # su - oracle
**********************************************************
Welcome on xxx
* This is a OAS test server *
* Owner = *
* User oracle = owner oracle software *
**********************************************************

[] xxx:oracle> . oraenv
ORACLE_SID = [] ? mid101
[mid101] xxx:oracle>

Posted in Linux | Leave a Comment »