Start and Stop scripts for Oracle Enterprise manager


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
export MW_HOME=/app/oracle/product/ofm11g
[oracle@oraappman bin]$ cat
. ~/bin/
export DOMAIN_HOME=/app/oracle/product/ofm11g/user_projects/domains/$1
[oracle@oraappman bin]$ cat
. ~/bin/ $1
nohup $DOMAIN_HOME/ > ~/logs/start_$1_domain.`date +%y%m%d%H%M%S`.log 2>&1 &
[oracle@oraappman bin]$ cat
. ~/bin/ $1
nohup $DOMAIN_HOME/bin/ > ~/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

# User specific aliases and functions

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases

[oracle@oraappman ~]$ cat .bash_aliases
alias set_<yourdomain>='. ~/bin/ <yourdomain>'
alias start_<yourdomain>='. ~/bin/ <yourdomain>'
alias stop_<yourdomain>='. ~/bin/ <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'