Nov 14 2012

Oracle and Grid User bash_profile Example on Linux

Category: Administration,Linux & UnixFatih Acar @ 14:25

bash_profile for Oracle user

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=testdb.domainname; export ORACLE_HOSTNAME
ORACLE_UNQNAME=testdb; export ORACLE_UNQNAME
ORACLE_BASE=/u01/oracle/11.2.0; export ORACLE_BASE
ORACLE_SID=testdb; export ORACLE_SID
ORACLE_HOME=/u01/oracle/11.2.0/db_home; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

BASE_PATH=/usr/sbin:$PATH:$HOME/bin; export BASE_PATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

alias sql=’sqlplus / as sysdba’
alias home=’cd $ORACLE_HOME’
alias db=’export ORACLE_SID=testdb’
alias alert_db=’tail -55f /u01/oracle/11.2.0/diag/rdbms/testdb/testdb/trace/alert_testdb.log’

bash_profile for Grid user

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs
if [ $USER = “grid” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

# Grid Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=testdb.domainname; export ORACLE_HOSTNAME
ORACLE_UNQNAME=testdb; export ORACLE_UNQNAME
ORACLE_BASE=/u01/grid/11.2.0; export ORACLE_BASE
GRID_HOME=/u01/grid/11.2.0/grid_home; export GRID_HOME
ORACLE_HOME=$GRID_HOME; export ORACLE_HOME
ORACLE_SID=+ASM; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

BASE_PATH=/usr/sbin:$PATH:$HOME/bin; export BASE_PATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH

alias sql=’sqlplus / as sysasm’
alias home=’cd $ORACLE_HOME’
alias asm=’export ORACLE_SID=+ASM’
alias alert_asm=’tail -55f /u01/grid/11.2.0/diag/asm/+asm/+ASM/trace/alert_+ASM.log’

113,193 total views, 10 views today

Tags: Oracle, Oracle Administration, System Administration

facebook comments:

One Response to “Oracle and Grid User bash_profile Example on Linux”

  1. Aamir says:

    Awesome, it is working.

    Thanks,
    Aamir

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.