oracle在11.2.0.2版本的补丁包中提供了一个deinstall的工具,专门用来卸载oracle的软件,包括GRID INFRA和RAC软件都可以。下面是删除的过程:
1、先解压缩包p10098816_112020_Linux-x86-64_7of7到/grid目录下面
2、不能用root用户运行deinstall,使用root运行结果如下:
3、使用GRID_HOME的owner grid用户执行删除操作:
grid用户删除GRID_HOME,2个节点都删除
[grid@node1-11gr2-rac ~]$ /grid/deinstall/deinstall -home /grid/app/11.2.0
Location of logs /u01/oraInventory/logs/
############ ORACLE DEINSTALL & DECONFIG TOOL START ############
Checking for existence of the Oracle home location /grid/app/11.2.0
Oracle Home type selected for de-install is: CRS
Oracle Base selected for de-install is: /grid/app/grid
Checking for existence of central inventory location /u01/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /grid/app/11.2.0.2
The following nodes are part of this cluster: node1-11gr2-rac,node2-11gr2-rac
Install check configuration END
Skipping Windows and .NET products configuration check
Checking Windows and .NET products configuration END
Traces log file: /u01/oraInventory/logs//crsdc.log
Network Configuration check config START
Network de-configuration trace file location: /u01/oraInventory/logs/netdc_check2010-12-05_12-34-55-PM.log
Network Configuration check config END
Asm Check Configuration START
ASM de-configuration trace file location: /u01/oraInventory/logs/asmcadc_check2010-12-05_12-34-58-PM.log
ASM was not detected in the Oracle Home
######################### CHECK OPERATION END #########################
####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /grid/app/11.2.0.2
The cluster node(s) on which the Oracle home de-installation will be performed are:node1-11gr2-rac,node2-11gr2-rac
Oracle Home selected for de-install is: /grid/app/11.2.0 这个老的GIRD_HOME
Inventory Location where the Oracle home registered is: /u01/oraInventory
Skipping Windows and .NET products configuration check
The home being deconfigured is NOT a configured Grid Infrastructure home (/grid/app/11.2.0.2)
ASM was not detected in the Oracle Home
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/u01/oraInventory/logs/deinstall_deconfig2010-12-05_12-34-36-PM.out'
Any error messages from this session will be written to: '/u01/oraInventory/logs/deinstall_deconfig2010-12-05_12-34-36-PM.err'
######################## CLEAN OPERATION START ########################
ASM de-configuration trace file location: /u01/oraInventory/logs/asmcadc_clean2010-12-05_12-36-04-PM.log
ASM Clean Configuration END
Network Configuration clean config START
最后提示:
/bin/rm: cannot remove directory `/grid/app/11.2.0//crs/sbs': Permission denied
/bin/rm: cannot remove `/grid/app/11.2.0//ctss/init/node2-11gr2-rac': Permission denied
/bin/rm: cannot remove `/grid/app/11.2.0//ctss/init/node2-11gr2-rac.pid': Permission denied]
The Oracle Base directory '/grid/app/grid' will not be removed on node 'node2-11gr2-rac'. The directory is in use by Oracle Home '/grid/app/11.2.0.2'.
Oracle Universal Installer cleanup completed with errors.
Oracle Universal Installer clean END
Oracle install clean START
Clean install operation removing temporary directory '/tmp/deinstall2010-12-05_00-34-34PM' on node 'node1-11gr2-rac'
Clean install operation removing temporary directory '/tmp/deinstall2010-12-05_00-34-34PM' on node 'node2-11gr2-rac'
Oracle install clean END
######################### CLEAN OPERATION END #########################
####################### CLEAN OPERATION SUMMARY #######################
The home being deconfigured is NOT a configured Grid Infrastructure home (/grid/app/11.2.0.2)
Skipping Windows and .NET products configuration clean
Successfully detached Oracle home '/grid/app/11.2.0' from the central inventory on the local node.
Failed to delete directory '/grid/app/11.2.0' on the local node.
Successfully detached Oracle home '/grid/app/11.2.0' from the central inventory on the remote nodes 'node2-11gr2-rac'.
。。。。。。。。。
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################
自此,GIRD_HOME删除成功。当然使用这个deinstall也可以删除RAC软件,大致过程如下:
[oracle@node1-11gr2-rac home]$ cd /u01/app/11.2.0/
[oracle@node1-11gr2-rac 11.2.0]$ ls
oracle
oracle是11.2.0.2的oracle_home
oracle.backupo是11.2.0.1的oracle_home
[oracle@node1-11gr2-rac 11.2.0]$ du -s -m *
3802
3850
[oracle@node1-11gr2-rac 11.2.0]$ pwd
[oracle@node1-11gr2-rac deinstall]$ /grid/deinstall/deinstall -home /u01/app/11.2.0/oracle.backup
Location of logs /u01/oraInventory/logs/
############ ORACLE DEINSTALL & DECONFIG TOOL START ############
######################### CHECK OPERATION START #########################
Install check configuration START
The deinstall tool cannot determine the home type needed to deconfigure the selected home.
Single Instance database - Enter 1
Real Application Cluster database - Enter 2
Grid Infrastructure for a cluster - Enter 3
Grid Infrastructure for a stand-alone server - Enter 4
Client Oracle Home - Enter 5
Transparent Gateways Oracle Home - Enter 6
2
The product version number of the specified home cannot be determined. Is the product version at least 11.2.0.1.0 (y - yes, n - no)? [n]
y
Specify a comma-separated list of nodes on which to perform the de-installation task:node1-11gr2-rac
Checking for existence of the Oracle home location /u01/app/11.2.0/oracle.backup
Oracle Home type selected for de-install is: RACDB
Oracle Base selected for de-install is:
Checking for existence of central inventory location /u01/oraInventory
Checking for existence of the Oracle Grid Infrastructure home
The following nodes are part of this cluster: node1-11gr2-rac
Install check configuration END
Skipping Windows and .NET products configuration check
Checking Windows and .NET products configuration END
Network Configuration check config START
Network de-configuration trace file location: /u01/oraInventory/logs/netdc_check2010-12-05_10-41-37-AM.log
Network Configuration check config END
Database Check Configuration START
Database de-configuration trace file location: /u01/oraInventory/logs/databasedc_check2010-12-05_10-41-39-AM.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 []:
Database Check Configuration END
Enterprise Manager Configuration Assistant START
EMCA de-configuration trace file location: /u01/oraInventory/logs/emcadc_check2010-12-05_10-41-47-AM.log
Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /u01/oraInventory/logs//ocm_check_2010-12-05_10-41-47-AM.log
Oracle Configuration Manager check END
######################### CHECK OPERATION END #########################
####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is:
The cluster node(s) on which the Oracle home de-installation will be performed are:node1-11gr2-rac
Oracle Home selected for de-install is: /u01/app/11.2.0/oracle.backup
Inventory Location where the Oracle home registered is: /u01/oraInventory
Skipping Windows and .NET products configuration check
No Enterprise Manager configuration to be updated for any database(s)
No Enterprise Manager ASM targets to update
No Enterprise Manager listener targets to migrate
Checking the config status for CCR
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
A log of this session will be written to: '/u01/oraInventory/logs/deinstall_deconfig2010-12-05_10-40-35-AM.out'
Any error messages from this session will be written to: '/u01/oraInventory/logs/deinstall_deconfig2010-12-05_10-40-35-AM.err'
######################## CLEAN OPERATION START ########################
Enterprise Manager Configuration Assistant START
EMCA de-configuration trace file location: /u01/oraInventory/logs/emcadc_clean2010-12-05_10-41-47-AM.log
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/oraInventory/logs/databasedc_clean2010-12-05_10-41-56-AM.log
Network Configuration clean config START
Network de-configuration trace file location: /u01/oraInventory/logs/netdc_clean2010-12-05_10-41-56-AM.log
De-configuring backup files...
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/oraInventory/logs//ocm_clean_2010-12-05_10-41-47-AM.log
Oracle Configuration Manager clean END
Removing Windows and .NET products configuration END
Oracle Universal Installer clean START
Delete directory '/u01/app/11.2.0/oracle.backup' on the local node : Done
Oracle Universal Installer cleanup was successful.
Oracle Universal Installer clean END
Oracle install clean START
Clean install operation removing temporary directory '/tmp/deinstall2010-12-05_10-40-34AM' on node 'node1-11gr2-rac'
Oracle install clean END
######################### CLEAN OPERATION END #########################
####################### CLEAN OPERATION SUMMARY #######################
Cleaning the config for CCR
As CCR is not configured, so skipping the cleaning of CCR configuration
CCR clean is finished
Skipping Windows and .NET products configuration clean
Successfully deleted directory '/u01/app/11.2.0/oracle.backup' on the local node.
Oracle Universal Installer cleanup was successful.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################
############# ORACLE DEINSTALL & DECONFIG TOOL END #############
删除后的结果:
删除完成后。。。
[oracle@node1-11gr2-rac 11.2.0]$ du -s -m *
3802
oracle.backup目录被删除了。