Home > Miscellaneous > Setting up your db profile on linux(in bash shell)

Setting up your db profile on linux(in bash shell)


I have created the files .bash_profile_bharatdb, .display through which we can set the required database profile after logging in

cat .bash_profile

alias s='sqlplus / as sysdba'
alias ora='ps -ef | grep pmon'
alias tns='ps -ef | grep tns'
. $HOME/.display

cat .display

display
display(){
clear
echo "Select the database :"
echo "1. bharatdb"
echo "2. bharatdb2"
echo “3. Exit”
echo -n "Enter your option :: "
read OPTION
case $OPTION in
1)      . ~/.bash_profile_bharatdb ; echo "ORACLE SID is $ORACLE_SID ... ";;
2)      . ~/.bash_profile_bharatdb2 ; echo "ORACLE SID is $ORACLE_SID ... ";;
3) ;;
*) echo "INVALID NUMBER!" ;;
esac
}

cat .bash_profile_bharatdb

# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
# User specific environment and startup programs
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=bharatdb
export TNS_ADMIN=/u01/app/oracle/product/11.2.0/db_1/network/admin/
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:$ORACLE_HOME/bin:$HOME/OPatch:$HOME/eas-dba
export LD_LIBRARY_PATH=/lib:/lib64:/usr/lib::/usr/lib64:/usr/local/lib:$ORACLE_HOME/lib32:$ORACLE_HOME/lib
umask 022
export TMP=$HOME/temp
export TMPDIR=$HOME/temp
alias s='sqlplus / as sysdba'
alias c='clear'
alias l='ls -ltr'
alias ora='ps -ef|grep pmon'
export PS1="\u@\h \w\$ "
Advertisements
Categories: Miscellaneous
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Oracle database internals by Riyaj

Discussions about Oracle performance tuning, RAC, Oracle internal & E-business suite.

StartupForce

Where all the Action Is !!!!

Pavan DBA's Blog

The DBA Knowledge Store

ORACLE-BASE - Latest Articles

Where all the Action Is !!!!

%d bloggers like this: