1. 程式人生 > >Linux下解除安裝Oracle 11g

Linux下解除安裝Oracle 11g

第一種方法: 使用oracle自帶的runInstaller 解除安裝

[[email protected]_0_14_centos deinstall]$ cd $ORACLE_HOME
[[email protected]_0_14_centos 11.2.0]$ cd deinstall/
[[email protected]_0_14_centos deinstall]$ ./deinstall 

第二種方法:通過刪除檔案的方式解除安裝;(即:刪除Oracle安裝目錄下的所有檔案和資料夾)

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

[[email protected]
_0_14_centos ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 1 17:31:18 2018 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> shutdown SQL> exit

2.停止Listener 

[[email protected]_0_14_centos ~]$ lsnrctl stop

3.停止HTTP服務

[[email protected]_0_14_centos ~]$ service httpd stop

4.用su或者重新登入到root(如想重新安裝可以保留oracle使用者,省得輸入環境變量了)

5.將安裝目錄刪除

[[email protected]_0_14_centos ~]$ rm -rf /data/app/oracle/

6.將/usr/bin下的檔案刪除

rm /usr/local/bin/dbhome
rm /usr/local/bin/oraenv
rm /usr/local/bin/coraenv

7.將/etc/oratab刪除

rm /etc/oratab

8.將/etc/oraInst.loc刪除

rm /etc/oraInst.loc

9.將oracle使用者刪除(若要重新安裝,可以不刪除)

[[email protected]_0_14_centos ~]# userdel –r oracle

10.將使用者組刪除(若要重新安裝,可以不刪除)

groupdel oinstall
groupdel dba

11.將啟動服務刪除

chkconfig --del dbora

到此為止重啟後,你的Linux系統下的Oracle資料庫已完全刪除了!!!

如果要再次安裝, 最好先做一些備份工作。
包括使用者的登入指令碼,資料庫自動啟動關閉的指令碼,和Listener自動啟動的指令碼。
要是有可能連建立資料庫的指令碼也儲存下來