linux重装oracle11g

linux中操作

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
1、停止数据库
[oracle@dg2 ~]$ sqlplus / as sysdba
SQL> connect / as sysdba
SQL> shutdown immediate
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit


2、停止监听
[oracle@dg2 ~]$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 23-DEC-2016 14:44:52
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dg1)(PORT=1521)))
The command completed successfully


3、切换到root用户,删除oracle用户
3.1、删除/usr/bin下的文件删除
[root@dg2 ~]# rm -rf /usr/local/bin/dbhome
[root@dg2 ~]# rm  -rf /usr/local/bin/oraenv
[root@dg2 ~]# rm -rf /usr/local/bin/coraenv

3.2、删除/etc/oratab删除
[root@dg2 ~]# rm /etc/oratab

3.3、删除/etc/oraInst.loc
[root@dg2 ~]# rm /etc/oraInst.loc

3.4、删除oracle用户
[root@dg2 ~]# userdel -r oracle
[root@dg2 ~]# groupdel oinstall
[root@dg2 ~]# groupdel dba

3.5、将oracle服务删除
[root@dg2 ~]# chkconfig --del oracle

4、重装数据库即可