1.用SQL*PLUS停止数据库
[oracle@mydata ~]$ sqlplus / as sysdba
SQL> shutdown immediate
SQL> exit
2.停止Listener
[oracle@mydata ~]$ lsnrctl stop
3.删除安装目录
rm -rf /u01/app/oracle/*
rm -rf /u01/app/grid/*
rm -rf /u01/app/11.2.0/grid/*
rm -rf /u01/app/oraInventory/*
4.删除/usr/bin下的文件
rm -f /usr/local/bin/dbhome
rm -f /usr/local/bin/oraenv
rm -f /usr/local/bin/coraenv
5.删除/etc/oratab
rm -f /etc/oratab
6.删除/etc/oraInst.loc
rm -f /etc/oraInst.loc
7.删除/etc/oracle/ocr.loc
rm -rf /etc/oracle/ocr.loc
8.删除/var/tmp/.oracle集群注册信息
rm -f /var/tmp/.oracle
9.删除oracle用户(重新安装,可以不删除)
[root@mydata ~]# userdel -r oracle
[root@mydata ~]# userdel -r grid
10.删除用户组(重新安装,可以不删除)
[root@mydata ~]# groupdel oinstall
[root@mydata ~]# groupdel dba
11.如果采用裸设备安装的数据库,需要格式化ASM磁盘组
dd if=/dev/zero of=/dev/mapper/iscsi-data bs=1024 count=2056
dd if=/dev/zero of=/dev/mapper/iscsi-fra bs=1024 count=2056
dd if=/dev/zero of=/dev/mapper/iscsi-ocr1 bs=1024 count=2056
dd if=/dev/zero of=/dev/mapper/iscsi-ocr2 bs=1024 count=2056
dd if=/dev/zero of=/dev/mapper/iscsi-ocr3 bs=1024 count=2056