#!/bin/bash
#Usage:Log on as the superuser('root') on node1,node2
cd /u01/app/11.2.0/grid/bin
./crsctl stop crs -f
cd /
echo ...................
cd /etc/oracle/
rm -rf scls_scr/ oprocd/ lastgasp/ o* setasmgid
echo ...................
sed -i '/ohas/d' /etc/inittab
echo ...................
rm -f /etc/init.d/init.cssd
rm -f /etc/init.d/init.crs
rm -f /etc/init.d/init.crsd
rm -f /etc/init.d/init.evmd
rm -f /etc/rc2.d/K96init.crs
rm -f /etc/rc2.d/S96init.crs
rm -f /etc/rc3.d/K96init.crs
rm -f /etc/rc3.d/S96init.crs
rm -f /etc/rc5.d/K96init.crs
rm -f /etc/rc5.d/S96init.crs
rm -f /etc/inittab.crs
echo ...................
rm -rf /etc/init.d/ohasd
rm -rf /etc/init.d/init.ohasd
rm -rf /etc/oratab
rm -rf /etc/oraInst.loc
echo ...................
rm -rf /var/tmp/.oracle
rm -rf /tmp/.oracle
rm -rf /u01/app
echo ...................
cd /tmp
rm -rf CVU_11.2.0* logs dbca OraInstall*
echo ...................
mkdir -p /u01/app/grid
mkdir -p /u01/app/11.2.0/grid
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/11.2.0
chmod -R 775 /u01
echo ...................
service network restart
echo down