Bash_쉘 노트

2079 단어 Oaclesqlcsshbash

                \,,,/
               (o o)
-----oOOo-(_)-oOOo-----
`hostname` 
#  CRS:
$ORA_CRS_HOME/bin/crs_stop -all
/etc/init.d/init.crs stop

#        CRS
ssh $PUBIP2 "/etc/init.d/init.crs stop"

#  ORACLE     -c(command)     
su - $ORACLE_OWNER -c "lsnrctl stop"

#SSH  	
ssh $ORACLE_HOSTNAME2 "sh $ORACLE_SRC/uninst2.sh"

#  SQL
su - $ORACLE_OWNER -c "export ORACLE_SID=+ASM1;sqlplus / as sysdba @$ORACLE_SRC/uninst_asm1.sql"

#        
[ -c /dev/raw/raw103 ] && dd if=/dev/zero of=/dev/raw/raw103  bs=8192 count=2560

#  
ssh $ORACLE_HOSTNAME2 chown -R $ORACLE_OWNER:oinstall $ORACLE_BASE

#    eth?:1
ifconfig $PUBETH:1 down

#         
timestr=`date '+%Y-%m-%d %H:%M:%S '`
mkdir $timestr

#      $PRVETH     
PRVIP1_MASK=`ifconfig $PRVETH |grep Mask|awk '{print $4}' |awk -F: '{print $2}'`

#sed  
sed "s:REMOTE_PASSWD_encrypt=:REMOTE_PASSWD_encrypt=$REMOTE_PASSWD_encrypt:g;s:ORACLE_PASSWD_encrypt=:ORACLE_PASSWD_encrypt=$ORACLE_PASSWD_encrypt:g;s:DB_PASSWD_encrypt=:DB_PASSWD_encrypt=$DB_PASSWD_encrypt:g" rac_envi.sh >rac_envi.sh.bak

#SED  
sed "/$ORACLE_HOSTNAME1-vip/d;/$ORACLE_HOSTNAME1-priv/d;/$ORACLE_HOSTNAME1/d;/$ORACLE_HOSTNAME2-vip/d;/$ORACLE_HOSTNAME2-priv/d;/$ORACLE_HOSTNAME2/d" /etc/hosts >/etc/hosts.sed

#grep             
grep  "wad02-priv" /etc/hosts

#             ,       ,              
grep  "$PRVIP1 $ORACLE_HOSTNAME1-priv" /etc/hosts || echo "$PRVIP1 $ORACLE_HOSTNAME1-priv" >>/etc/hosts

################
# set ntp time #
################
rcntp restart
ssh ${ORACLE_HOSTNAME2} ntpdate ${ORACLE_HOSTNAME1}

#count++
let "count += 1"

좋은 웹페이지 즐겨찾기