標籤:rm -rf listener tar file SQ lda dir ssis nod
環境
OS: CentOS 7.4; hosts: L134; IP: 192.168.1.134 Oracle安裝檔案目錄:/opt/oracle_install ORACLE_BASE:/data/app/oracle ORACLE_HOME: /data/app/oracle/product/11.2.0/db_1 oraInventory: /data/app/oraInventory Oracle資料目錄:/data/app/oradata/
方法1:使用oracle內建的deinstall卸載
[[email protected] ~]$ cd $ORACLE_HOME/deinstall[[email protected] /data/app/oracle/product/11.2.0/db_1/deinstall]$ ./deinstall
然後根據提示一步一步進行操作即可。最後一步是確認操作,選擇y,斷行符號。
Do you want to continue (y - yes, n - no)? [n]: y
最後還要需要以root身份刪除/etc/oraInst.loc這個檔案。
我覺得方法2刪除更方便更徹底。
方法2:手動刪除相關檔案和目錄
- 關閉執行個體
sqlplus / as sysdbaSQL> shutdown immediate
關閉listener
lsnrctl stop
刪除安裝目錄
su -rm -rf /data/app/oracle/ /data/app/oraInventory/ /data/app/oradata/
以root許可權刪除/usr/bin下的相關檔案。下周
cd /usr/local/bin/rm -f dbhome oraenv coraenv
刪除/etc/oratab
rm -f /etc/oratab
刪除
rm -f /etc/oraInst.loc
刪除oracle使用者和使用者組(如有必要)
userdel -r oraclegroupdel oinstallgroupdel dbagroupdel oper
刪除啟動服務
chkconfig --del oracle
擴充
oracle內建的deinstall卸載的提示和日誌資訊
[[email protected] /data/oracle/11g2/deinstall]$ ./deinstall Checking for required files and bootstrapping ...Please wait ...Location of logs /tmp/deinstall2018-03-08_08-53-24-AM/logs/############ ORACLE DEINSTALL & DECONFIG TOOL START #################################### CHECK OPERATION START ########################Install check configuration STARTChecking for existence of the Oracle home location /data/app/oracle/product/11.2.0/db_1Oracle Home type selected for de-install is: SIDBOracle Base selected for de-install is: /data/app/oracleChecking for existence of central inventory location /data/app/oraInventoryInstall check configuration ENDNetwork Configuration check config STARTNetwork de-configuration trace file location: /tmp/deinstall2018-03-08_08-53-24-AM/logs/netdc_check1471463216126639250.logSpecify all Single Instance listeners that are to be de-configured [LISTENER]:Network Configuration check config ENDDatabase Check Configuration STARTDatabase de-configuration trace file location: /tmp/deinstall2018-03-08_08-53-24-AM/logs/databasedc_check5326208000777792237.logUse comma as separator when specifying list of values as inputSpecify the list of database names that are configured in this Oracle home [orclyz]: ###### For Database ‘orclyz‘ ######Single Instance DatabaseThe diagnostic destination location of the database: /data/app/oracle/diag/rdbms/orclyzStorage type used by the Database: FSDatabase file location: /data/app/oracle/oradata/orclyz,/data/app/oracle/flash_recovery_area/orclyzFlash recovery area location: /data/app/oracle/flash_recovery_area/ORCLYZdatabase spfile location: /data/app/oracle/product/11.2.0/db_1/dbs/spfileorclyz.oraThe details of database(s) orclyz have been discovered automatically. Do you still want to modify the details of orclyz database(s)? [n]: Database Check Configuration ENDEnterprise Manager Configuration Assistant STARTEMCA de-configuration trace file location: /tmp/deinstall2018-03-08_08-53-24-AM/logs/emcadc_check.log Checking configuration for database orclyzEnterprise Manager Configuration Assistant ENDOracle Configuration Manager check STARTOCM check log file location : /tmp/deinstall2018-03-08_08-53-24-AM/logs//ocm_check5456.logOracle Configuration Manager check END######################### CHECK OPERATION END ################################################ CHECK OPERATION SUMMARY #######################Oracle Home selected for de-install is: /data/app/oracle/product/11.2.0/db_1Inventory Location where the Oracle home registered is: /data/app/oraInventoryFollowing Single Instance listener(s) will be de-configured: LISTENERThe following databases were selected for de-configuration : orclyzDatabase unique name : orclyzStorage used : FSNo Enterprise Manager configuration to be updated for any database(s)No Enterprise Manager ASM targets to updateNo Enterprise Manager listener targets to migrateChecking the config status for CCROracle Home exists with CCR directory, but CCR is not configuredCCR check is finishedDo you want to continue (y - yes, n - no)? [n]: yA log of this session will be written to: ‘/tmp/deinstall2018-03-08_08-53-24-AM/logs/deinstall_deconfig2018-03-08_08-53-33-AM.out‘Any error messages from this session will be written to: ‘/tmp/deinstall2018-03-08_08-53-24-AM/logs/deinstall_deconfig2018-03-08_08-53-33-AM.err‘######################## CLEAN OPERATION START ########################Enterprise Manager Configuration Assistant STARTEMCA de-configuration trace file location: /tmp/deinstall2018-03-08_08-53-24-AM/logs/emcadc_clean.log Updating Enterprise Manager ASM targets (if any)Updating Enterprise Manager listener targets (if any)Enterprise Manager Configuration Assistant ENDDatabase de-configuration trace file location: /tmp/deinstall2018-03-08_08-53-24-AM/logs/databasedc_clean1081110075195191916.logDatabase Clean Configuration START orclyzThis operation may take few minutes.Database Clean Configuration END orclyzNetwork Configuration clean config STARTNetwork de-configuration trace file location: /tmp/deinstall2018-03-08_08-53-24-AM/logs/netdc_clean1072295666521765217.logDe-configuring Single Instance listener(s): LISTENERDe-configuring listener: LISTENER Stopping listener: LISTENER Listener stopped successfully. Deleting listener: LISTENER Listener deleted successfully.Listener de-configured successfully.De-configuring Naming Methods configuration file...Naming Methods configuration file de-configured successfully.De-configuring backup files...Backup files de-configured successfully.The network configuration has been cleaned up successfully.Network Configuration clean config ENDOracle Configuration Manager clean STARTOCM clean log file location : /tmp/deinstall2018-03-08_08-53-24-AM/logs//ocm_clean5456.logOracle Configuration Manager clean ENDOracle Universal Installer clean STARTDetach Oracle home ‘/data/app/oracle/product/11.2.0/db_1‘ from the central inventory on the local node : DoneDelete directory ‘/data/app/oracle/product/11.2.0/db_1‘ on the local node : DoneDelete directory ‘/data/app/oraInventory‘ on the local node : DoneDelete directory ‘/data/app/oracle‘ on the local node : DoneOracle Universal Installer cleanup was successful.Oracle Universal Installer clean ENDOracle install clean STARTClean install operation removing temporary directory ‘/tmp/install‘ on node ‘PostalDataDG‘Oracle install clean END######################### CLEAN OPERATION END ################################################ CLEAN OPERATION SUMMARY #######################Successfully de-configured the following database instances : orclyzFollowing Single Instance listener(s) were de-configured successfully: LISTENERCleaning the config for CCRAs CCR is not configured, so skipping the cleaning of CCR configurationCCR clean is finishedSuccessfully detached Oracle home ‘/data/app/oracle/product/11.2.0/db_1‘ from the central inventory on the local node.Successfully deleted directory ‘/data/app/oracle/product/11.2.0/db_1‘ on the local node.Successfully deleted directory ‘/data/app/oraInventory‘ on the local node.Successfully deleted directory ‘/data/app/oracle‘ on the local node.Oracle Universal Installer cleanup was successful.Run ‘rm -rf /etc/oraInst.loc‘ as root on node(s) ‘PostalDataDG‘ at the end of the session.Oracle install successfully cleaned up the temporary directories.#################################################################################### ORACLE DEINSTALL & DECONFIG TOOL END #############
CentOS卸載Oracle 11gR2(x64)