mkdir /home/oracle/bin
mkdir /home/oracle/logs
chown oracle.oinstall /home/oracle/logs
chown oracle.oinstall /home/oracle/bin
cd /home/oracle/bin
[oracle@oraappman bin]$ cat set_mw_home.sh
export MW_HOME=/app/oracle/product/ofm11g
[oracle@oraappman bin]$ cat set_domain.sh
. ~/bin/set_mw_home.sh
export DOMAIN_HOME=/app/oracle/product/ofm11g/user_projects/domains/$1
[oracle@oraappman bin]$ cat start_domain.sh
. ~/bin/set_domain.sh $1
nohup $DOMAIN_HOME/startWebLogic.sh > ~/logs/start_$1_domain.`date +%y%m%d%H%M%S`.log 2>&1 &
[oracle@oraappman bin]$ cat stop_domain.sh
. ~/bin/set_domain.sh $1
nohup $DOMAIN_HOME/bin/stopWebLogic.sh > ~/logs/stop_$1_domain.`date +%y%m%d%H%M%S`.log &
cd ~
[oracle@oraappman ~]$ cat .bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
[oracle@oraappman ~]$ cat .bash_aliases
alias set_<yourdomain>='. ~/bin/set_domain.sh <yourdomain>'
alias start_<yourdomain>='. ~/bin/start_domain.sh <yourdomain>'
alias stop_<yourdomain>='. ~/bin/stop_domain.sh <yourdomain>'
alias stop_all='stop_<yourdomain>; sleep 2m; stop_X; sleep 2m; stop_X'
alias start_all='start_<yourdomain>; sleep 3m; start_X; sleep 3m; start_X'