溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

怎么用deinstall和命令行刪除Oracle數(shù)據(jù)庫軟件

發(fā)布時間:2021-11-09 13:50:11 來源:億速云 閱讀:244 作者:小新 欄目:關系型數(shù)據(jù)庫

這篇文章將為大家詳細講解有關怎么用deinstall和命令行刪除Oracle數(shù)據(jù)庫軟件,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。

1. deinstall工具

1.1. 工具介紹

deinstall工具是oracle提供的數(shù)據(jù)庫軟件卸載工具,使用方法可以參考官方文檔路徑:Installing and Upgrading→Database Installation Guide for Linux→ 7 Removing Oracle Database Software
具體路徑為:http://docs.oracle.com/cd/E11882_01/install.112/e47689/remove_oracle_sw.htm#LADBI1336


oracle總共提供了2種使用deinstall的方法:

(1)如果Oracle安裝無誤,可以直接調(diào)用$ORACLE_HOME下的腳本$ORACLE_HOME/deinstall/deinstall

(2)如果Oracle安裝有問題或者是其他情況,可以下載獨立的工具后,然后使用工具進行卸載。

官方文檔給出的下載路徑:

1.前往URL:

http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

2.在Oracle Database 11g Release 2下載區(qū)域找到對應的平臺版本,點擊”See All”,在新打開的頁面底部可以下載到數(shù)據(jù)庫卸載工具。

另外,使用單獨的deinstall進行卸載的時候,必須指定-home參數(shù),查看官方文檔說明:

  • (4)查看數(shù)據(jù)庫實例的狀態(tài),如數(shù)據(jù)庫實例啟動,則關閉數(shù)據(jù)庫實例。


    1. [oracle@DB074 ~]$ ps -ef | grep smon

    2. oracle 3559 1 0 14:44 ? 00:00:00 ora_smon_cams

    3. oracle 3662 31107 0 14:47 pts/1 00:00:00 grep smon

    4. [oracle@DB074 ~]$ sqlplus / as sysdba

    5. SQL*Plus: Release 11.2.0.4.0 Production on Mon Sep 11 14:47:25 2017

    6. Copyright (c) 1982, 2013, Oracle. All rights reserved.

    7. Connected to:

    8. Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

    9. With the Partitioning, OLAP, Data Mining and Real Application Testing options

    10. SYS@cams>shutdown immediate;

    11. Database closed.

    12. Database dismounted.

    13. ORACLE instance shut down.

    14. SYS@cams>exit

    15. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

    16. With the Partitioning, OLAP, Data Mining and Real Application Testing options

    17. [oracle@DB074 ~]$ ps -ef | grep smon

    18. oracle 3675 31107 0 14:47 pts/1 00:00:00 grep smon



    (5)檢查確保沒有oracle進程啟動


    1. [oracle@DB074 ~]$ ps -ef | grep ora

    2. root      1987  1945  0 Sep09 ? 00:01:16 hald-addon-storage: polling /dev/sr0 (every 2 sec)

    3. oracle    3677 31107  0 14:48 pts/1    00:00:00 ps -ef

    4. oracle    3678 31107  0 14:48 pts/1    00:00:00 grep ora

    5. root     31106 30170  0 11:34 pts/1    00:00:00 su - oracle

    6. oracle   31107 31106  0 11:34 pts/1    00:00:00 –bash



    (6)切換到root用戶,完整刪除安裝目錄(如擔心手滑,部分操作可以在oracle用戶下完成)


    1. [root@DB074 oracle]# cd /

    2. [root@DB074 oracle]# rm -rf u01/



    (7)將bin下面的文件刪除,如果不知道具體在哪個bin路徑下(有/usr/bin,/usr/local/bin等),可以先查找下系統(tǒng)路徑


    1. [root@DB074 /]# find / -name oraenv

    2. /usr/local/bin/oraenv

    3. [root@DB074 /]# find / -name dbhome

    4. /usr/local/bin/dbhome

    5. [root@DB074 /]# find / -name coraenv

    6. /usr/local/bin/coraenv

    7. [root@DB074 /]# rm -rf /usr/local/bin/oraenv

    8. [root@DB074 /]# rm -rf /usr/local/bin/dbhome

    9. [root@DB074 /]# rm -rf /usr/local/bin/coraenv



    (8)刪除配置文件


    1. [root@DB074 ~]# rm -rf /etc/oraInst.loc

    2. [root@DB074 ~]# rm -rf /opt/ORCLfmap

    3. [root@DB074 ~]# rm -rf /etc/oratab



    (9)刪除home目錄

    1. [root@DB074 ~]# rm -rf /home/oracle


    (10)刪除oracle用戶和用戶組


    1. [root@DB074 ~]# userdel -f oracle

    2. [root@DB074 ~]# groupdel -f oinstall

    3. [root@DB074 ~]# groupdel -f dba



    (11)檢查是否有自啟動服務,進行刪除


    1. [root@DB074 ~]#chkconfig –list

    2. [root@DB074 ~]#chkconfig --del XXX



    3. 方法對比

    (1)兩種方法都能完成數(shù)據(jù)庫軟件的刪除,使用deinstall工具的方法比較柔和,使用命令行刪除的方法比較暴力。

    (2)第一種方法刪除后會有部分信息保留,如環(huán)境變量、安裝軟件、自定義目錄等;第二種方法可以對數(shù)據(jù)庫進行完整刪除,也可以只刪除部分內(nèi)容。當然,兩種方法沒有好壞之分,可以視情況相結(jié)合使用。

    (3)第二種方法操作過程中會多次在root用戶下執(zhí)行rm -rf命令,建議用戶小心操作。

    (4)文中沒有嘗試使用下載的deinstall工具進行卸載操作,讀者可以在工作之余在測試環(huán)境中進行嘗試。

關于“怎么用deinstall和命令行刪除Oracle數(shù)據(jù)庫軟件”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI