1停止数据库
因为:我的数据库实际已经停了所以会出现下面的情况
[oracle@ora920 oracle]$ sqlplus /nolog
SQL> connect user/password as sysdba
SQL> shutdown immediate
SQL> exit
操作
[root@centos213 /]# sqlplus /nolog
SQL*Plus: Release 12.2.0.1.0 Production on Mon May 28 10:49:59 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
SQL> connect sys/123 as sysdba
Connected to an idle instance.
SQL> shutdown
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3701
Additional information: -1182543949
Process ID: 0
Session ID: 0 Serial number: 0
SQL> exit
Disconnected
2.停止Listener[root@centos213 /]# lsnrctl stop
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 28-MAY-2018 10:55:53
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=196.160.1.211)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
You have mail in /var/spool/mail/root
3.把$ORACLE_HOME下面的文件删掉
[root@centos213 /]# $ORACLE_HOME
-bash: /usr/oracle/product: Is a directory
rm -rf /opt/oracle/
4.将安装目录删除
[root@centos213 opt]# rm -rf /opt/oracle/
5.将/usr/bin下的文件删除
[root@centos213 /]# rm /usr/bin/dbhome
[root@centos213 /]# rm /usr/bin/oraenv
[root@centos213 /]# rm /usr/bin/coraenv
下面引用https://www.cnblogs.com/codewater/articles/2013892.html
[root@ora920 /root]# rm /etc/oratab
8.将/etc/oraInst.loc删除
[root@ora920 /root]# rm /etc/oraInst.loc
9.将oracle用户删除(若要重新安装,可以不删除)
[root@ora920 /root]# userdel –r oracle
10.将用户组删除(若要重新安装,可以不删除)
[root@ora920 /root]# groupdel oinstall
[root@ora920 /root]# groupdel dba
11.将启动服务删除
[root@ora920 /root]# chkconfig --del dbora