Saturday, September 05, 2009

Deinstallation Tool

The Deinstallation Tool (deinstall) is available in the installation media before installation, and is available in Oracle home directories after installation. It is located in the path $ORACLE_HOME/deinstall.

On 11gR2 ,we don't find deinstall/uninstall on Oracle Installer page. we need to use the Deinstallation Tool.

However we can download the Deinstallation Tool.

$ ls linux.x64_11gR2_deinstall.zip
linux.x64_11gR2_deinstall.zip
$ unzip linux.x64_11gR2_deinstall.zip
$ cd deinstall

$ ./deinstall
Location of logs /oracle/oraInventory/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############
Usage:
deinstall -home <Complete path of Oracle home>
[ -silent ]
[ -checkonly ]
[ -local ]
[ -paramfile <complete path of input parameter property file> ]
[ -params <name1=value[ name2=value ...]> ]
[ -o <complete path of directory for saving files> ]
[ -help | -h: Type -h or -help to get more information on each of the above options. ]
Specify any of the above options.
############# ORACLE DEINSTALL & DECONFIG TOOL END #############

$ ./deinstall -home /oracle/product/11.2.0/db_2
ORACLE_HOME = /oracle/product/11.2.0/db_2
Location of logs /oracle/oraInventory/logs/

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

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

Checking for existence of the Oracle home location /oracle/product/11.2.0/db_2
Oracle Home type selected for de-install is: SIDB
Oracle Base selected for de-install is: /oracle/product
Checking for existence of central inventory location /oracle/oraInventory

Install check configuration END

Network Configuration check config START

Network de-configuration trace file location: /oracle/oraInventory/logs/netdc_check16937.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /oracle/oraInventory/logs/databasedc_check16938.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: /oracle/oraInventory/logs/emcadc_check.log

Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /oracle/oraInventory/logs//ocm_check8092.log
Oracle Configuration Manager check END

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

####################### CHECK OPERATION SUMMARY #######################
Oracle Home selected for de-install is: /oracle/product/11.2.0/db_2
Inventory Location where the Oracle home registered is: /oracle/oraInventory
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: '/oracle/oraInventory/logs/deinstall_deconfig2009-09-05_10-01-12-PM.out'
Any error messages from this session will be written to: '/oracle/oraInventory/logs/deinstall_deconfig2009-09-05_10-01-12-PM.err'

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

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /oracle/oraInventory/logs/emcadc_clean.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: /oracle/oraInventory/logs/databasedc_clean16939.log

Network Configuration clean config START

Network de-configuration trace file location: /oracle/oraInventory/logs/netdc_clean16940.log

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 END

Oracle Configuration Manager clean START
OCM clean log file location : /oracle/oraInventory/logs//ocm_clean8092.log
Oracle Configuration Manager clean END
Oracle Universal Installer clean START

Detach Oracle home '/oracle/product/11.2.0/db_2' from the central inventory on the local node : Done

Delete directory '/oracle/product/11.2.0/db_2' 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/install' on node 'RHEL5-TEST'

Oracle install clean END

Moved default properties file /home/oracle/deinstall/response/deinstall_OraDb11g_home2.rsp as /home/oracle/deinstall/response/deinstall_OraDb11g_home2.rsp1

######################### 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
Successfully detached Oracle home '/oracle/product/11.2.0/db_2' from the central inventory on the local node.
Successfully deleted directory '/oracle/product/11.2.0/db_2' on the local node.
Oracle Universal Installer cleanup was successful.

Oracle install successfully cleaned up the temporary directories.
#######################################################################
############# ORACLE DEINSTALL & DECONFIG TOOL END #############

Example: deinstall Oracle Home and Database's register on Oracle Restart
$ crsstat
HA Resource Type Target State (Host)
----------- ------ ------ -----
ora.LISTENER.lsnr ora.listener.type ONLINE ONLINE on rhel5-test
ora.cssd ora.cssd.type ONLINE ONLINE on rhel5-test
ora.diskmon ora.diskmon.type ONLINE ONLINE on rhel5-test
ora.testdb.db ora.database.type ONLINE ONLINE on rhel5-test

$ ./deinstall -home /oracle/product/11.2.0/dbhome_1
ORACLE_HOME = /oracle/product/11.2.0/dbhome_1
Location of logs /oracle/oraInventory/logs/

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

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

Checking for existence of the Oracle home location /oracle/product/11.2.0/dbhome_1
Oracle Home type selected for de-install is: SIDB
Oracle Base selected for de-install is: /oracle/product
Checking for existence of central inventory location /oracle/oraInventory

Install check configuration END

Network Configuration check config START

Network de-configuration trace file location: /oracle/oraInventory/logs/netdc_check6881.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /oracle/oraInventory/logs/databasedc_check6882.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 [testdb]:

###### For Database 'testdb' ######
Specify the type of this database (1.Single Instance Database|2.Oracle Restart Enabled Database) [2]:
Specify the list of nodes on which this database has instances [rhel5-test]:
Specify the diagnostic destination location of the database [/oracle/product/diag/rdbms/testdb]:
Specify the storage type used by the Database ASM|FS []: FS

Specify the list of directories if any database files exist on a shared file system. If 'testdb' 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 [ ]: /oracle/product/oradata

Specify the flash recovery area location, if it is configured on the file system. If 'testdb' subdirectory is found, then it will be deleted. []:

Specify the database spfile location [ ]:

Database Check Configuration END

Enterprise Manager Configuration Assistant START

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

Checking configuration for database testdb
Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /oracle/oraInventory/logs//ocm_check6867.log
Oracle Configuration Manager check END

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

####################### CHECK OPERATION SUMMARY #######################
Oracle Home selected for de-install is: /oracle/product/11.2.0/dbhome_1
Inventory Location where the Oracle home registered is: /oracle/oraInventory
The following databases were selected for de-configuration : testdb
Database unique name : testdb
Storage used : FS
Will update the Enterprise Manager configuration for the following database(s): testdb
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: '/oracle/oraInventory/logs/deinstall_deconfig2009-09-06_03-24-28-PM.out'
Any error messages from this session will be written to: '/oracle/oraInventory/logs/deinstall_deconfig2009-09-06_03-24-28-PM.err'

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

Enterprise Manager Configuration Assistant START
EMCA de-configuration trace file location: /oracle/oraInventory/logs/emcadc_clean.log

Updating Enterprise Manager Database Control configuration for database testdb
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: /oracle/oraInventory/logs/databasedc_clean6883.log
Database Clean Configuration START testdb
This operation may take few minutes.
Database Clean Configuration END testdb

Network Configuration clean config START

Network de-configuration trace file location: /oracle/oraInventory/logs/netdc_clean6884.log

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 END

Oracle Configuration Manager clean START
OCM clean log file location : /oracle/oraInventory/logs//ocm_clean6867.log
Oracle Configuration Manager clean END
Oracle Universal Installer clean START

Detach Oracle home '/oracle/product/11.2.0/dbhome_1' from the central inventory on the local node : Done

Delete directory '/oracle/product/11.2.0/dbhome_1' 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/install' on node 'RHEL5-TEST'

Oracle install clean END

Moved default properties file /home/oracle/De-install/deinstall/response/deinstall_OraDb11g_home2.rsp as /home/oracle/De-install/deinstall/response/deinstall_OraDb11g_home2.rsp3

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

####################### CLEAN OPERATION SUMMARY #######################
Updated Enterprise Manager configuration for database testdb
Successfully de-configured the following database instances : testdb
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 '/oracle/product/11.2.0/dbhome_1' from the central inventory on the local node.
Successfully deleted directory '/oracle/product/11.2.0/dbhome_1' on the local node.
Oracle Universal Installer cleanup was successful.

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

############# ORACLE DEINSTALL & DECONFIG TOOL END #############
$ crsstat
HA Resource Type Target State (Host)
----------- ------ ------ -----
ora.LISTENER.lsnr ora.listener.type ONLINE ONLINE on rhel5-test
ora.cssd ora.cssd.type ONLINE ONLINE on rhel5-test
ora.diskmon ora.diskmon.type ONLINE ONLINE on rhel5-test

2 comments:

Alannd said...

Very handy to be able to deinstall without the need for the OUI GUI.

I didn't notice any "are you sure?" messages though.

Would the deinstall fail if the database was mounted?

Another thing to play with :-)

Surachart said...

Thank You for Good idea to play...

If "deinstall" found DB instance, it'll lists...

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

if database's mounted... deinstall will stop database... and then clean database


Database Clean Configuration START testdb
This operation may take few minutes.
Database Clean Configuration END testdb


By the way, I think just read "CHECK OPERATION SUMMARY" before type "y"