在ORACLE 11g R2以前如果想要卸载ORACLE数据库是件非常麻烦的事情,除了卸载CRS和database外还要手工清除很多信息,从11g R2版本开始ORACLE增加了deinstall自动化卸载工具,下面对一个11g R2+ASM的库做卸载的演示。

进入deinstall目录,该目录一般位于ORACLE_HOME目录下,我的路径如下:

[oracle@rac1]$cd /u01/app/oracle/product/11.2/db/deinstall

开始卸载

[oracle@rac1 deinstall]$ ./deinstall
Checking for required files and bootstrapping …
Please wait …
Location of logs /u01/app/oraInventory/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############

######################## CHECK OPERATION START ########################
Install check configuration START

Checking for existence of the Oracle home location /u01/app/oracle/product/11.2/db
Oracle Home type selected for de-install is: RACDB
Oracle Base selected for de-install is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/grid/11.2
The following nodes are part of this cluster: rac1,rac2

Install check configuration END

Network Configuration check config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check4888537112946740838.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check9019528162378551803.log

Use comma as separator when specifying list of values as input

Specify the list of database names that are configured in this Oracle home [rac]:     此处默认,回车即可

###### For Database ‘rac’ ######

RAC Database
The nodes on which this database has instances: [rac1, rac2]
The instance names: [rac1, rac2]
The local instance name on node: rac1
The diagnostic destination location of the database: /u01/app/oracle/diag/rdbms/rac
Storage type used by the Database: ASM

The details of database(s) rac have been discovered automatically. Do you still want to modify the details of rac database(s)? [n]:    此处默认,回车即可

Database Check Configuration END

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /u01/app/oraInventory/logs/emcadc_check.log

Checking configuration for database rac
Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /u01/app/oraInventory/logs//ocm_check9751.log
Oracle Configuration Manager check END

######################### CHECK OPERATION END #########################

####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/grid/11.2
The cluster node(s) on which the Oracle home exists are: (Please input nodes seperated by “,”, eg: node1,node2,…)rac1,rac2
Oracle Home selected for de-install is: /u01/app/oracle/product/11.2/db
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
The following databases were selected for de-configuration : rac
Database unique name : rac
Storage used : ASM
Will update the Enterprise Manager configuration for the following database(s): rac
No Enterprise Manager ASM targets to update
No Enterprise Manager listener targets to migrate
Checking the config status for CCR
rac1 : Oracle Home exists with CCR directory, but CCR is not configured
rac2 : Oracle Home exists with CCR directory, but CCR is not configured
CCR check is finished
Do you want to continue (y – yes, n – no)? [n]: y       此处输入y 回车
A log of this session will be written to: ‘/u01/app/oraInventory/logs/deinstall_deconfig2012-05-07_06-23-47-AM.out’
Any error messages from this session will be written to: ‘/u01/app/oraInventory/logs/deinstall_deconfig2012-05-07_06-23-47-AM.err’

######################## CLEAN OPERATION START ########################

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /u01/app/oraInventory/logs/emcadc_clean.log

Updating Enterprise Manager Database Control configuration for database rac
Updating Enterprise Manager ASM targets (if any)
Updating Enterprise Manager listener targets (if any)
Enterprise Manager Configuration Assistant END
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean4515165418037009919.log
Database Clean Configuration START rac
This operation may take few minutes.
Database Clean Configuration END rac

Network Configuration clean config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean4980163345251278375.log

De-configuring Listener configuration file on all nodes…
Listener configuration file de-configured successfully.

De-configuring Naming Methods configuration file on all nodes…
Naming Methods configuration file de-configured successfully.

De-configuring Local Net Service Names configuration file on all nodes…
Local Net Service Names configuration file de-configured successfully.

De-configuring Directory Usage configuration file on all nodes…
Directory Usage configuration file de-configured successfully.

De-configuring backup files on all nodes…
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

Oracle Configuration Manager clean START
OCM clean log file location : /u01/app/oraInventory/logs//ocm_clean9751.log
Oracle Configuration Manager clean END
Oracle Universal Installer clean START

Detach Oracle home ‘/u01/app/oracle/product/11.2/db’ from the central inventory on the local node : Done

Delete directory ‘/u01/app/oracle/product/11.2/db’ on the local node : Done

The Oracle Base directory ‘/u01/app/oracle’ will not be removed on local node. The directory is in use by Oracle Home ‘/u01/app/grid/11.2′.

Detach Oracle home ‘/u01/app/oracle/product/11.2/db’ from the central inventory on the remote nodes ‘rac2′ : Done

Delete directory ‘/u01/app/oracle/product/11.2/db’ on the remote nodes ‘rac2′ : Done

The Oracle Base directory ‘/u01/app/oracle’ will not be removed on node ‘rac2′. The directory is in use by Oracle Home ‘/u01/app/grid/11.2′.

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END

Oracle install clean START

Clean install operation removing temporary directory ‘/tmp/install’ on node ‘rac1′
Clean install operation removing temporary directory ‘/tmp/install’ on node ‘rac2′

Oracle install clean END

######################### CLEAN OPERATION END #########################

####################### CLEAN OPERATION SUMMARY #######################
Updated Enterprise Manager configuration for database rac
Successfully de-configured the following database instances : rac
Cleaning the config for CCR
As CCR is not configured, so skipping the cleaning of CCR configuration
CCR clean is finished
Successfully detached Oracle home ‘/u01/app/oracle/product/11.2/db’ from the central inventory on the local node.
Successfully deleted directory ‘/u01/app/oracle/product/11.2/db’ on the local node.
Successfully detached Oracle home ‘/u01/app/oracle/product/11.2/db’ from the central inventory on the remote nodes ‘rac2′.
Successfully deleted directory ‘/u01/app/oracle/product/11.2/db’ on the remote nodes ‘rac2′.
Oracle Universal Installer cleanup was successful.

Oracle install successfully cleaned up the temporary directories.
#######################################################################

############# ORACLE DEINSTALL & DECONFIG TOOL END #############

删除成功,清除完毕后删除ORACLE软件即可!