The purpose of this document is to describe steps to clean clusterware (GI) environment where deinstall fails to work or cannot complete.
Cleaning Steps
1. Remove the current GI home from central inventory
As grid home owner:
$ORACLE_HOME/oui/bin/runInstaller -detachHome -silent -local ORACLE_HOME=$ORACLE_HOME
2. Disable oracle ohasd service on Linux as root user
# /usr/bin/systemctl stop oracle-ohasd.service
# /usr/bin/systemctl disable oracle-ohasd.service
If following appears just ignore and go ahead
# /usr/bin/systemctl stop oracle-ohasd.service
Failed to stop oracle-ohasd.service: Unit oracle-ohasd.service not loaded.
# /usr/bin/systemctl disable oracle-ohasd.service
Failed to disable unit: Unit file oracle-ohasd.service does not exist.
3. Stop ohasd service as super user (‘root’)
# systemctl stop ohasd.service
4. Remove files under ‘/etc/oracle’ as root user:
# rm -Rf /etc/oracle
5. Remove daemon configuration files
# rm /etc/init.d/init.evmd /etc/init.d/init.crsd \
/etc/init.d/init.cssd /etc/init.d/init.crs /etc/init.d/init.ohasd
6. Remove ‘ohas’ related files from /etc
# find /etc -name ‘*ohas*’
Example
# find /etc -name ‘*ohas*’
/etc/systemd/system/oracle-ohasd.service.d
/etc/rc.d/init.d/ohasd
Remove found files related to Grid Infrastructure by ‘rm’ command.
Note: Do not remove OS files。
7. Check any ‘crs’ related file under /etc and remove
# find /etc -name ‘*crs*’
If confirmed to be relevant you can remove by
# find /etc -name ‘*crs*’ |xargs rm -rf
8. [Optional] Remove TFA service files
# systemctl stop oracle-tfa.service
# systemctl disable oracle-tfa.service
Example output
# systemctl disable oracle-tfa.service
Removed /etc/systemd/system/multi-user.target.wants/oracle-tfa.service.
Removed /etc/systemd/system/graphical.target.wants/oracle-tfa.service.
9. [Optional] Remove other TFA related file
# find /etc -name ‘*tfa*’
Remove the found file(s) accordingly.
10. Remove files under grid home
# rm -Rf $ORACLE_HOME/*
# rm -Rf $ORACLE_HOME/.opatchauto_storage
# rm -Rf $ORACLE_HOME/.patch_storage
11. Remove grid base
# rm -Rf <Oracle Base>
12. Remove socket files
# rm -rf /var/tmp/.oracle
# rm -rf /tmp/.oracle
13. Remove temporary files
cd /tmp
rm -rf CVU_xxxx_grid logs Logs OraInstall* deinstall*
14. Remove central inventory directory and /etc/oraInst.loc if there is no need to reserve them.
15. Unset ORACLE_HOME and other environmental variables.
16. Modify /etc/passwd and /etc/group to remove GI related user(s) and group(s).
17. remove all data on OCR disk header.
# dd if=/dev/zero of=/dev/mapper/ocr_disk1 bs=1024k count=1