Linux平臺下解除安裝ORACLE

weixin_34377065發表於2013-03-27

實驗環境:作業系統版本:Red Hat Enterprise Linux Server release 5.5 (Tikanga),
資料庫版本 :Oracle Database 10g Enterprise Edition Release 10.2.0.1.0。
解除安裝ORACLE 10g的過程,在不同平臺或不同版本資料可能有些步驟略有不同,具體操作的時候請結合實際情況酌情處理。

1. 首先做好備份工作(如果有需要的話,如果你想重新完全安裝,可以忽略這個步驟)。用 oracle 使用者登入。 最好先做一些備份工作。例如備份資料庫檔案等。

2. 使用SQL*PLUS停止資料庫

[oracle@wgods ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Mar 27 09:35:23 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

3. 停止Listener服務
[oracle@wgods ~]$ lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 27-MAR-2013 09:37:21

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
The command completed successfully

4. 停止HTTP服務
[oracle@wgods ~]$ service httpd stop

5. 刪除$ORACLE_BASE目錄下的所有檔案

[oracle@wgods ~]$ echo $ORACLE_BASE
/database/oracle
[oracle@wgods ~]$ ls -lrt /database/oracle
total 40
drwxrwx--- 3 oracle oinstall 4096 Dec 14 11:28 product
drwxrwx--- 6 oracle oinstall 4096 Dec 14 11:36 oraInventory
drwxr-x--- 3 oracle oinstall 4096 Dec 14 11:36 oradata
drwxr-x--- 3 oracle oinstall 4096 Dec 14 11:36 admin
drwxr-x--- 3 oracle oinstall 4096 Dec 14 11:37 flash_recovery_area
[oracle@wgods ~]$ rm -rf $ORACLE_BASE/*


6.切換到root賬號

[oracle@wgods ~]$ su - root

7.刪除/etc/oraInst.loc /etc/oratab檔案

[root@wgods ~]# rm /etc/oraInst.loc /etc/oratab
rm: remove regular file `/etc/oraInst.loc'? y
rm: remove regular file `/etc/oratab'? y

注意網上有些文章有刪除/usr/bin 下的一些檔案,例如 rm /usr/bin/dbhome、rm /usr/bin/oraenv、rm /usr/bin/coraenv。這個在ORACLE 10g下是沒有的

8.刪除oracle使用者(若要重新安裝,可以不刪除)
[root@wgods ~]# userdel –r oracle

9.刪除使用者組(若要重新安裝,可以不刪除)
[root@wgods ~]# groupdel oinstall
[root@wgods ~]# groupdel dba

10.將啟動服務刪除
[root@OracleTest /root]# chkconfig --del dbora

操作完後,你的ORALCE資料庫已經完全、徹底的刪除了。

 

 

相關文章