Uninstall oracle

Often,we install oracle database and database software in day to day life.But have you ever completely cleanup the old debris and software from your machine frequently? In oracle we call it as deinstall the software

Here i show a basic deinstall steps to gracefully wipe out all the database files and temporary files

Delete the database using dbca

choose existing database to delete

Confirm to delete the database

After database deletion deconfig the high availability service forcefully using the perl script in grid home

[root@exdbadm01 apps01]# /apps01/base/product/11.2.0/grid/crs/install/roothas.pl -deconfig -force
Using configuration parameter file: /apps01/base/product/11.2.0/grid/crs/install/crsconfig_params
CRS resources for listeners are still configured
PRKO-2573 : ONS daemon is already stopped.
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'exdbadm01'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'exdbadm01'
CRS-2677: Stop of 'ora.FRA.dg' on 'exdbadm01' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'exdbadm01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'exdbadm01'
CRS-2677: Stop of 'ora.asm' on 'exdbadm01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'exdbadm01'
CRS-2677: Stop of 'ora.cssd' on 'exdbadm01' succeeded
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'exdbadm01'
CRS-2673: Attempting to stop 'ora.diskmon' on 'exdbadm01'
CRS-2677: Stop of 'ora.diskmon' on 'exdbadm01' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'exdbadm01'
CRS-2677: Stop of 'ora.evmd' on 'exdbadm01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'exdbadm01' has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle Restart stack

Deinstall the grid software from grid home

[oracle@exdbadm01 dbhome_1]$ pwd
/data01/base/product/11.2.0/dbhome_1
[oracle@exdbadm01 dbhome_1]$ cd deinstall/
[oracle@exdbadm01 deinstall]$ ./deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /data01/orainventory/logs/

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


######################### CHECK OPERATION START #########################
## [START] Install check configuration ##


Checking for existence of the Oracle home location /data01/base/product/11.2.0/dbhome_1
Oracle Home type selected for deinstall is: Oracle Single Instance Database
Oracle Base selected for deinstall is: /data01/base
Checking for existence of central inventory location /data01/orainventory
Checking for sufficient temp space availability on node(s) : 'exdbadm01'

## [END] Install check configuration ##


Network Configuration check config START

Network de-configuration trace file location: /data01/orainventory/logs/netdc_check2021-01-27_08-43-16-PM.log
clsc_ginit: CLSD initialization failed, rc -1, ecode 64

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /data01/orainventory/logs/databasedc_check2021-01-27_08-43-17-PM.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 [exdbx]:

###### For Database 'exdbx' ######

Specify the type of this database (1.Single Instance Database|2.Oracle Restart Enabled Database) [1]: 1
Specify the diagnostic destination location of the database [/data01/base/diag/rdbms/exdbx]:
Specify the storage type used by the Database ASM|FS []: ASM


Database Check Configuration END

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /data01/orainventory/logs/emcadc_check2021-01-27_08-46-28-PM.log

Checking configuration for database exdbx
Enterprise Manager Configuration Assistant END
Oracle Configuration Manager check START
OCM check log file location : /data01/orainventory/logs//ocm_check2031.log
Oracle Configuration Manager check END

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


####################### CHECK OPERATION SUMMARY #######################
Oracle Home selected for deinstall is: /data01/base/product/11.2.0/dbhome_1
Inventory Location where the Oracle home registered is: /data01/orainventory
The following databases were selected for de-configuration : exdbx
Database unique name : exdbx
Storage used : ASM
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: '/data01/orainventory/logs/deinstall_deconfig2021-01-27_08-43-09-PM.out'
Any error messages from this session will be written to: '/data01/orainventory/logs/deinstall_deconfig2021-01-27_08-43-09-PM.err'

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

Enterprise Manager Configuration Assistant START

EMCA de-configuration trace file location: /data01/orainventory/logs/emcadc_clean2021-01-27_08-46-28-PM.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: /data01/orainventory/logs/databasedc_clean2021-01-27_10-26-45-PM.log
Database Clean Configuration START exdbx
This operation may take few minutes.
Database Clean Configuration END exdbx

Network Configuration clean config START

Network de-configuration trace file location: /data01/orainventory/logs/netdc_clean2021-01-27_10-26-59-PM.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 : /data01/orainventory/logs//ocm_clean2031.log
Oracle Configuration Manager clean END
Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

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

Delete directory '/data01/base/product/11.2.0/dbhome_1' on the local node : Done

Delete directory '/data01/base' on the local node : Done

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END


## [START] Oracle install clean ##

Clean install operation removing temporary directory '/tmp/deinstall2021-01-27_08-41-48PM' on node 'exdbadm01'

## [END] Oracle install clean ##


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


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

Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


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

Clean up the grid directories

[root@exdbadm01 apps01]# ls
base  orainventory
[root@exdbadm01 apps01]# rm -rf base/

At last the asm disk headers entries should be erased if asm disks are reused

You can refer this post for more info

https://wordpress.com/post/alphaoragroup.com/1109

Now a fresh software can be installed

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s