千家信息网

Oracle 学习之卸载Oracle 11g

发表于:2024-11-13 作者:千家信息网编辑
千家信息网最后更新 2024年11月13日,Oracle 11g 安装完毕后,如果有卸载的需要。可以有如下方法:手工删除Oracle安装时建立的各目录、文件等。这种方法对于Linux还算可行,但是Window版中涉及到服务、注册表等等。往往删除
千家信息网最后更新 2024年11月13日Oracle 学习之卸载Oracle 11g

Oracle 11g 安装完毕后,如果有卸载的需要。可以有如下方法:

  1. 手工删除Oracle安装时建立的各目录、文件等。这种方法对于Linux还算可行,但是Window版中涉及到服务、注册表等等。往往删除不干净。

  2. 使用安装目录$ORACLE_HOME/deinstall/下的 deinstall脚本。

[oracle@localhost deinstall]$ ./deinstallChecking for required files and bootstrapping ...Please wait ...Location of logs /tmp/deinstall2015-08-22_00-06-37AM/logs/############ ORACLE DEINSTALL & DECONFIG TOOL START ##################################### CHECK OPERATION START ########################### [START] Install check configuration ##Checking for existence of the Oracle home location /u01/app/oracle/product/11.2.0/db_1Oracle Home type selected for deinstall is: Oracle Single Instance DatabaseOracle Base selected for deinstall is: /u01/app/oracleChecking for existence of central inventory location /u01/app/oraInventoryChecking for sufficient temp space availability on node(s) : 'localhost.localdomain'## [END] Install check configuration ##Network Configuration check config STARTNetwork de-configuration trace file location: /tmp/deinstall2015-08-22_00-06-37AM/logs/netdc_check2015-08-22_12-06-57-AM.logNetwork Configuration check config ENDDatabase Check Configuration STARTDatabase de-configuration trace file location: /tmp/deinstall2015-08-22_00-06-37AM/logs/databasedc_check2015-08-22_12-07-12-AM.logUse comma as separator when specifying list of values as inputSpecify the list of database names that are configured in this Oracle home [orcl]: ###### For Database 'orcl' ######Single Instance DatabaseThe diagnostic destination location of the database: /u01/app/oracle/diag/rdbms/orclStorage type used by the Database: FSDatabase file location: /u01/app/oracle/oradata/orcl,/u01/app/oracle/fast_recovery_area/orclFast recovery area location: /u01/app/oracle/fast_recovery_area/ORCLdatabase spfile location: /u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcl.oraThe details of database(s) orcl have been discovered automatically. Do you still want to modify the details of orcl database(s)? [n]: Database Check Configuration ENDEnterprise Manager Configuration Assistant STARTEMCA de-configuration trace file location: /tmp/deinstall2015-08-22_00-06-37AM/logs/emcadc_check2015-08-22_12-07-52-AM.log Checking configuration for database orclEnterprise Manager Configuration Assistant ENDOracle Configuration Manager check STARTOCM check log file location : /tmp/deinstall2015-08-22_00-06-37AM/logs//ocm_check446.logOracle Configuration Manager check END######################### CHECK OPERATION END ################################################ CHECK OPERATION SUMMARY #######################Oracle Home selected for deinstall is: /u01/app/oracle/product/11.2.0/db_1Inventory Location where the Oracle home registered is: /u01/app/oraInventoryThe following databases were selected for de-configuration : orclDatabase unique name : orclStorage 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/deinstall2015-08-22_00-06-37AM/logs/deinstall_deconfig2015-08-22_12-06-51-AM.out'Any error messages from this session will be written to: '/tmp/deinstall2015-08-22_00-06-37AM/logs/deinstall_deconfig2015-08-22_12-06-51-AM.err'######################## CLEAN OPERATION START ########################Enterprise Manager Configuration Assistant STARTEMCA de-configuration trace file location: /tmp/deinstall2015-08-22_00-06-37AM/logs/emcadc_clean2015-08-22_12-07-52-AM.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/deinstall2015-08-22_00-06-37AM/logs/databasedc_clean2015-08-22_12-08-27-AM.logDatabase Clean Configuration START orclThis operation may take few minutes.Database Clean Configuration END orclNetwork Configuration clean config STARTNetwork de-configuration trace file location: /tmp/deinstall2015-08-22_00-06-37AM/logs/netdc_clean2015-08-22_12-09-31-AM.logDe-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/deinstall2015-08-22_00-06-37AM/logs//ocm_clean446.logOracle Configuration Manager clean ENDSetting the force flag to falseSetting the force flag to cleanup the Oracle BaseOracle Universal Installer clean STARTDetach Oracle home '/u01/app/oracle/product/11.2.0/db_1' from the central inventory on the local node : DoneDelete directory '/u01/app/oracle/product/11.2.0/db_1' on the local node : DoneDelete directory '/u01/app/oraInventory' on the local node : DoneDelete directory '/u01/app/oracle' on the local node : DoneOracle Universal Installer cleanup was successful.Oracle Universal Installer clean END## [START] Oracle install clean ##Clean install operation removing temporary directory '/tmp/deinstall2015-08-22_00-06-37AM' on node 'localhost'## [END] Oracle install clean ########################### CLEAN OPERATION END ################################################ CLEAN OPERATION SUMMARY #######################Successfully de-configured the following database instances : orclCleaning the config for CCRAs CCR is not configured, so skipping the cleaning of CCR configurationCCR clean is finishedSuccessfully detached Oracle home '/u01/app/oracle/product/11.2.0/db_1' from the central inventory on the local node.Successfully deleted directory '/u01/app/oracle/product/11.2.0/db_1' on the local node.Successfully deleted directory '/u01/app/oraInventory' on the local node.Successfully deleted directory '/u01/app/oracle' on the local node.Oracle Universal Installer cleanup was successful.Run 'rm -rf /etc/oraInst.loc' as root on node(s) 'localhost' at the end of the session.Run 'rm -rf /opt/ORCLfmap' as root on node(s) 'localhost' at the end of the session.Run 'rm -rf /etc/oratab' as root on node(s) 'localhost' at the end of the session.Oracle deinstall tool successfully cleaned up temporary directories.#################################################################################### ORACLE DEINSTALL & DECONFIG TOOL END #############

在删除的过程中有以下几点需要确认的

Specify the list of database names that are configured in this Oracle home [orcl]:

指定需要删除的数据库名称,默认即可,直接回车。

The details of database(s) orcl have been discovered automatically. Do you still want to modify the details of orcl database(s)? [n]:

是否需要修改数据库的详细信息,默认n,直接回车。

Do you want to continue (y - yes, n - no)? [n]: y

是否继续,填写y,回车

脚本结尾,提示需要使用root用户删除如下三个脚本。

rm -rf /etc/oraInst.locrm -rf /opt/ORCLfmaprm -rf /etc/oratab


至此,Oracle删除完毕。

将Oracle软件再次安装

./runInstaller -silent -responseFile /home/oracle/etc/install_software_only.rsp

3. 使用专用工具

Oracle官方推荐使用专门的删除工具。原因是内置的deinstall工具脚本中常常带有很多bug,很多时候不能完全的将其删除干净。特别是Windows环境下的卸载工具,不能正常工作的场景很多。

上传工具包至服务器,直接解压,解压完毕后即可直接使用。

[oracle@localhost ~]$ unzip p13390677_112040_Linux-x86-64_7of7.zip
[oracle@localhost ~]$ cd deinstall/[oracle@localhost deinstall]$ ./deinstall -helpdeinstall -home                [ -silent ]               [ -checkonly ]               [ -local ]               [ -paramfile  ]               [ -params  ]               [ -o  ]               [ -tmpdir  ]               [ -logdir  ]               [ -help : Type -help to get more information on each of the above options. ]

删除Oracle

[oracle@localhost deinstall]$ ./deinstall -home $ORACLE_HOMELocation of logs /home/oracle/deinstall/./logs/############ ORACLE DEINSTALL & DECONFIG TOOL START ##################################### CHECK OPERATION START ########################### [START] Install check configuration ##Checking for existence of the Oracle home location /u01/app/oracle/product/11.2.0/db_1Oracle Home type selected for deinstall is: Oracle Single Instance DatabaseOracle Base selected for deinstall is: /u01/app/oracleChecking for existence of central inventory location /u01/app/oraInventoryChecking for sufficient temp space availability on node(s) : 'localhost.localdomain'## [END] Install check configuration ##Network Configuration check config STARTNetwork de-configuration trace file location: /home/oracle/deinstall/./logs/netdc_check2015-08-22_12-34-54-AM.logNetwork Configuration check config ENDDatabase Check Configuration STARTDatabase de-configuration trace file location: /home/oracle/deinstall/./logs/databasedc_check2015-08-22_12-35-03-AM.logUse comma as separator when specifying list of values as inputSpecify the list of database names that are configured in this Oracle home []: orcl###### For Database 'orcl' ######Specify the type of this database (1.Single Instance Database|2.Oracle Restart Enabled Database) [1]: Specify the diagnostic destination location of the database [/u01/app/oracle/diag/rdbms/orcl]: Specify the storage type used by the Database ASM|FS []: FSSpecify the list of directories if any database files exist on a shared file system. If 'orcl' subdirectory is found, then it will be deleted. Otherwise, the specified directory will be deleted. Alternatively, you can specify list of database files with full path [ ]: /u01/app/oracle/oradataSpecify the fast recovery area location, if it is configured on the file system. If 'orcl' subdirectory is found, then it will be deleted. []: /u01/app/oracle/fast_recovery_areaSpecify the database spfile location [ ]: /u01/app/oracle/product/11.2.0/db_1/dbs/Database Check Configuration ENDEnterprise Manager Configuration Assistant STARTEMCA de-configuration trace file location: /home/oracle/deinstall/./logs/emcadc_check2015-08-22_12-42-35-AM.log Checking configuration for database orclEnterprise Manager Configuration Assistant ENDOracle Configuration Manager check STARTOCM check log file location : /home/oracle/deinstall/./logs//ocm_check_2015-08-22_12-42-35-AM.logOracle Configuration Manager check END######################### CHECK OPERATION END ################################################ CHECK OPERATION SUMMARY #######################Oracle Home selected for deinstall is: /u01/app/oracle/product/11.2.0/db_1Inventory Location where the Oracle home registered is: /u01/app/oraInventoryThe following databases were selected for de-configuration : orclDatabase unique name : orclStorage 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: '/home/oracle/deinstall/./logs/deinstall_deconfig2015-08-22_12-34-51-AM.out'Any error messages from this session will be written to: '/home/oracle/deinstall/./logs/deinstall_deconfig2015-08-22_12-34-51-AM.err'######################## CLEAN OPERATION START ########################Enterprise Manager Configuration Assistant STARTEMCA de-configuration trace file location: /home/oracle/deinstall/./logs/emcadc_clean2015-08-22_12-42-35-AM.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: /home/oracle/deinstall/./logs/databasedc_clean2015-08-22_12-42-38-AM.logDatabase Clean Configuration START orclThis operation may take few minutes.Database Clean Configuration END orclNetwork Configuration clean config STARTNetwork de-configuration trace file location: /home/oracle/deinstall/./logs/netdc_clean2015-08-22_12-43-44-AM.logDe-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 : /home/oracle/deinstall/./logs//ocm_clean_2015-08-22_12-42-35-AM.logOracle Configuration Manager clean ENDSetting the force flag to falseSetting the force flag to cleanup the Oracle BaseOracle Universal Installer clean STARTDetach Oracle home '/u01/app/oracle/product/11.2.0/db_1' from the central inventory on the local node : DoneDelete directory '/u01/app/oracle/product/11.2.0/db_1' on the local node : DoneDelete directory '/u01/app/oraInventory' on the local node : DoneDelete directory '/u01/app/oracle' on the local node : DoneOracle Universal Installer cleanup was successful.Oracle Universal Installer clean END## [START] Oracle install clean ##Clean install operation removing temporary directory '/tmp/deinstall2015-08-22_00-34-49AM' on node 'localhost'## [END] Oracle install clean ########################### CLEAN OPERATION END ################################################ CLEAN OPERATION SUMMARY #######################Successfully de-configured the following database instances : orclCleaning the config for CCRAs CCR is not configured, so skipping the cleaning of CCR configurationCCR clean is finishedSuccessfully detached Oracle home '/u01/app/oracle/product/11.2.0/db_1' from the central inventory on the local node.Successfully deleted directory '/u01/app/oracle/product/11.2.0/db_1' on the local node.Successfully deleted directory '/u01/app/oraInventory' on the local node.Successfully deleted directory '/u01/app/oracle' on the local node.Oracle Universal Installer cleanup was successful.Run 'rm -rf /etc/oraInst.loc' as root on node(s) 'localhost' at the end of the session.Run 'rm -rf /opt/ORCLfmap' as root on node(s) 'localhost' at the end of the session.Run 'rm -rf /etc/oratab' as root on node(s) 'localhost' at the end of the session.Oracle deinstall tool successfully cleaned up temporary directories.#################################################################################### ORACLE DEINSTALL & DECONFIG TOOL END #############



0