Sunday, July 18, 2021

DROP ASM Instance using asmca or servctl - How to Delete ASM from Clusterware & GI Home Cleanup?

DROP ASM Instance || servctl remove asm || How to Delete ASM from Clusterware? || GI Home Cleanup


Below are high level steps for drop ASM/DB and cleanup GI Home and Oracle Home:

Steps:

1. Verify the running ASM and Database details:
2. Drop database using dbca:
3. Verify the database dropped and cleanup done:
4. Deinstall Oracle Home :
5. Verify the Oracle Home is cleaned up:
6. Drop or delete ASM instance:
7. Deinstall ASM Clusterware Home:
8. Verify the GI Home is cleaned up:

1. Verify the running ASM and Database details:

[root@oraclelab3 ~]# ps -ef|grep smon
root      3809  3735  0 08:41 pts/1    00:00:00 grep --color=auto smon
oracle    7634     1  0 Jul16 ?        00:00:02 ora_smon_UATDB
oracle   17624     1  0 Jul15 ?        00:00:03 asm_smon_+ASM
[root@oraclelab3 ~]#

[root@oraclelab3 ~]#su - oracle
[oracle@oraclelab3]$ . oraenv
ORACLE_SID = [oracle] ? +UATDB
The Oracle base has been set to /u01/app/oracle
[oracle@oraclelab3]$

2. Drop database using dbca:

[oracle@oraclelab3]$dbca
>>> follow the GUI screen to proceed further and deinstall database

check the reinstall log on the below cfgtoollogs directory:

[root@oraclelab3 ~]# cd /u01/app/oracle/cfgtoollogs/
[root@oraclelab3 cfgtoollogs]# ll
total 12
drwxr-x---. 2 oracle oinstall 4096 Jul 15 10:40 asmca
drwxr-x---. 4 oracle oinstall   72 Jul 18 08:53 dbca
drwxr-x---. 3 oracle oinstall   42 Jul 15 10:50 dbua
drwxrwx---. 2 oracle oinstall    6 Jul 15 09:29 mgmtca
drwxrwx---. 2 oracle oinstall    6 Jul 15 09:29 mgmtua
drwxr-xr-x. 2 oracle oinstall 4096 Jul 15 09:30 netca
drwxrwx---. 2 oracle oinstall    6 Jul 15 10:40 restca
drwxr-x---. 5 oracle oinstall 4096 Jul 15 11:14 sqlpatch
[root@oraclelab3 cfgtoollogs]# cd dbca
[root@oraclelab3 dbca]# ll
total 828
drwxr-x---. 2 oracle oinstall   4096 Jul 18 08:53 DEVDB
-rw-r-----. 1 oracle oinstall 841440 Jul 15 09:44 trace.log_2021-07-15_09-42-23-AM
drwxr-x---. 2 oracle oinstall     27 Jul 18 08:53 UATDB
[root@oraclelab3 dbca]# 

3. Verify the database dropped and cleanup done:

Verify /etc/oratab

[root@oraclelab3 DEVDB]# su - oracle
Last login: Sun Jul 18 03:45:29 IST 2021
[oracle@oraclelab3 ~]$ cat /etc/oratab
#Backup file is  /u01/app/19.0.0.0/grid/srvm/admin/oratab.bak.oraclelab3.oracle line added by Agent
#
# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.
# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM:/u01/app/19.0.0.0/grid:N           # line added by Agent
[oracle@oraclelab3 ~]$

4. Deinstall Oracle Home :

[oracle@oraclelab3 ~]$ /u01/app/oracle/product/19.0.0.0/dbhome_1/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /u01/app/oraInventory/logs/

############ ORACLE DECONFIG TOOL START ############

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

Checking for existence of the Oracle home location /u01/app/oracle/product/19.0.0.0/dbhome_1
Oracle Home type selected for deinstall is: Oracle Single Instance Database
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory

## [END] Install check configuration ##

Network Configuration check config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2021-07-18_08-56-09AM.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2021-07-18_08-56-09AM.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

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

####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Home selected for deinstall is: /u01/app/oracle/product/19.0.0.0/dbhome_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-07-18_08-56-08-AM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-07-18_08

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2021-07-18_08-56-09AM.log

Network Configuration clean config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2021-07-18_08-56-09AM.log

De-configuring Naming Methods configuration file...
Naming Methods configuration file de-configured successfully.

De-configuring Local Net Service Names configuration file...
Local Net Service Names 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

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

####################### DECONFIG CLEAN OPERATION SUMMARY #######################
#######################################################################

############# ORACLE DECONFIG TOOL END #############

Using properties file /tmp/deinstall2021-07-18_08-55-52AM/response/deinstall_2021-07-18_08-56-08-AM.rsp
Location of logs /u01/app/oraInventory/logs/

############ ORACLE DEINSTALL TOOL START ############

####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-07-18_08-56-08-AM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2021-07-18_08

######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to oraclelab3
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2021-07-18_08-55-52AM/oraInst.loc
Setting oracle.installer.local to false

## [END] Preparing for Deinstall ##

Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

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

Delete directory '/u01/app/oracle/product/19.0.0.0/dbhome_1' 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 Hom

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END

## [START] Oracle install clean ##

## [END] Oracle install clean ##

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

####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/oracle/product/19.0.0.0/dbhome_1' from the central inventory on the loca
Successfully deleted directory '/u01/app/oracle/product/19.0.0.0/dbhome_1' on the local node.
Oracle Universal Installer cleanup was successful.

Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'oraclelab3'.
If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete '/u01/app/oracle' and its contents
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################

############# ORACLE DEINSTALL TOOL END #############

[oracle@oraclelab3 ~]$ 

5. Verify the Oracle Home is cleaned up:

Verify /u01/app/oraInventory/ContentsXML/inventory.xml

[oracle@oraclelab3 ~]$ cd /u01/app/oracle/product/19.0.0.0/
[oracle@oraclelab3 19.0.0.0]$ ll
total 0
[oracle@oraclelab3 19.0.0.0]$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
[oracle@oraclelab3 19.0.0.0]$ cd /u01/app/oraInventory
[oracle@oraclelab3 oraInventory]$ ll
total 8
drwxrwx---. 9 oracle oinstall 4096 Jul 18 08:56 backup
drwxrwx---. 2 oracle oinstall   81 Jul 15 10:49 ContentsXML
drwxrwx---. 6 oracle oinstall 4096 Jul 18 08:56 logs
drwxrwx---. 2 oracle oinstall   22 Jul 15 09:36 oui
[oracle@oraclelab3 oraInventory]$ cd ContentsXML
[oracle@oraclelab3 ContentsXML]$ ll
total 16
-rw-rw----. 1 oracle oinstall 300 Jul 18 08:56 comps.xml
-rw-rw----. 1 oracle oinstall 663 Jul 18 08:56 inventory.xml
-rw-rw----. 1 oracle oinstall 292 Jul 18 08:56 libs.xml
-rw-rw----. 1 oracle oinstall 174 Jul 15 10:49 oui-patch.xml
[oracle@oraclelab3 ContentsXML]$

[oracle@oraclelab3 ContentsXML]$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2021, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>12.2.0.7.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraGI19Home1" LOC="/u01/app/19.0.0.0/grid" TYPE="O" IDX="3" CRS="true"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.2.0.1/dbhome_1" TYPE="O" IDX="2" REMOVED="T"/>
<HOME NAME="OraGI12Home1" LOC="/u01/app/12.2.0.1/grid" TYPE="O" IDX="1" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
[oracle@oraclelab3 ContentsXML]$

6. Drop or delete ASM instance:

[oracle@oraclelab3 12.2.0.1]$ . oraenv
ORACLE_SID = [oracle] ? +ASM
The Oracle base has been set to /u01/app/oracle

[oracle@oraclelab3 12.2.0.1]$ srvctl remove asm -force

[oracle@oraclelab3 12.2.0.1]$ ps -ef|grep smon
oracle   12398  8016  0 09:00 pts/1    00:00:00 grep --color=auto smon
oracle   17624     1  0 Jul15 ?        00:00:03 asm_smon_+ASM

[oracle@oraclelab3 12.2.0.1]$ srvctl config ASM
PRCR-1001 : Resource ora.asm does not exist >>>>>>>>>>>>>>>>>>>>>>>>> ASM got removed from the clusterware

[oracle@oraclelab3 12.2.0.1]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       oraclelab3               STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       oraclelab3               STABLE
ora.RECO.dg
               OFFLINE OFFLINE      oraclelab3               STABLE
ora.ons
               OFFLINE OFFLINE      oraclelab3               STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       oraclelab3               STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       oraclelab3               STABLE
--------------------------------------------------------------------------------
[oracle@oraclelab3 12.2.0.1]$

Connect to ASM and verify the password and spfile:

[oracle@oraclelab3 12.2.0.1]$ . oraenv
ORACLE_SID = [+ASM] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/19.0.0.0/grid
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@oraclelab3 12.2.0.1]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 18 09:01:42 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> 
SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/ASM/ASMPARAMETERFILE/registry.253.1077960677
SQL> 

Connect to asmcmd and verify the password and spfile:

[oracle@oraclelab3 12.2.0.1]$ asmcmd -p
ASMCMD [+] > cd +DATA/ASM
ASMCMD [+DATA/ASM] > ls
ASMPARAMETERFILE/
PASSWORD/
ASMCMD [+DATA/ASM] > cd PASSWORD/
ASMCMD [+DATA/ASM/PASSWORD] > ls
pwdasm.256.1077960677
ASMCMD [+DATA/ASM/PASSWORD] > ls -l
Type      Redund  Striped  Time             Sys  Name
PASSWORD  UNPROT  COARSE   JUL 15 09:00:00  Y    pwdasm.256.1077960677
ASMCMD [+DATA/ASM/PASSWORD] > pwd
+DATA/ASM/PASSWORD
ASMCMD [+DATA/ASM/PASSWORD] > exit
[oracle@oraclelab3 12.2.0.1]$

[oracle@oraclelab3 12.2.0.1]$ srvctl config asm
PRCR-1001 : Resource ora.asm does not exist >>>>>>>>>>>>>>>>>>> Since we removed it from cluster so srvctl command will not work 
[oracle@oraclelab3 12.2.0.1]$

Try to delete ASM instance now which will fail with syntax error:

[oracle@oraclelab3 12.2.0.1]$ asmca -silent -deleteASM –sysAsmPassword +DATA/ASM/PASSWORD/pwdasm.256.1077960677 -for

The command line is not formed properly. Type "asmca -h" to get the command line syntax.

[oracle@oraclelab3 12.2.0.1]$

We will reconfigure ASM Instance and add ASM Instance back to Cluster:

[oracle@oraclelab3 12.2.0.1]$ srvctl add asm -pwfile +DATA/ASM/PASSWORD/pwdasm.256.1077960677
[oracle@oraclelab3 12.2.0.1]$ srvctl config ASM
ASM home: <CRS home>
Password file: +DATA/ASM/PASSWORD/pwdasm.256.1077960677
Backup of Password file:
ASM listener: LISTENER
Spfile:
ASM diskgroup discovery string: ++no-value-at-resource-creation--never-updated-through-ASM++
[oracle@oraclelab3 12.2.0.1]$

Try to delete ASM Instance now using below command:

[oracle@oraclelab3 12.2.0.1]$ asmca -silent -deleteASM
Are you sure you want to delete the ASM instance (Y/N)? y

ASM instance deleted successfully. Check /u01/app/oracle/cfgtoollogs/asmca/asmca-210718AM091240.log for details.

[oracle@oraclelab3 12.2.0.1]$

Verify the logs:

============
[oracle@oraclelab3 12.2.0.1]$ more /u01/app/oracle/cfgtoollogs/asmca/asmca-210718AM091240.log
[main] [ 2021-07-18 09:12:40.624 IST ] [InventoryUtil.getOUIInvSession:349]  setting OUI READ level to ACCESSLEVEL_R
[main] [ 2021-07-18 09:12:40.624 IST ] [InventoryUtil.isCRSHome:386]  Homeinfo /u01/app/19.0.0.0/grid,3
[main] [ 2021-07-18 09:12:40.896 IST ] [HASContext.<init>:128]  moduleInit = 7
[main] [ 2021-07-18 09:12:40.896 IST ] [Library.load:205]  library.load
..............................
..............................
..............................
[main] [ 2021-07-18 09:12:41.776 IST ] [RuntimeExec.runCommand:323]  RunTimeExec: error>
[main] [ 2021-07-18 09:12:41.777 IST ] [RuntimeExec.runCommand:349]  Returning from RunTimeExec.runCommand
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.doexecuteLocally:1536]  retval =  0
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.doexecuteLocally:1537]  exitval =  0
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.doexecuteLocally:1538]  rtErrLength =  0
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.doexecuteLocally:1526]  OS Name is...Linux
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.enforceEnglishVars:1721]  Set environment for English language
[main] [ 2021-07-18 09:12:41.777 IST ] [CmdToolUtil.enforceEnglishVars:1722]  OS Name is...Linux
[oracle@oraclelab3 12.2.0.1]$ 

Verify that ASM Instance has dropped:

[oracle@oraclelab3 12.2.0.1]$ ps -ef|grep smon
oracle   16201  8016  0 09:13 pts/1    00:00:00 grep --color=auto smon
[oracle@oraclelab3 12.2.0.1]$

7. Deinstall ASM Clusterware Home:

Issue 1:
========
Deinstall ASM Clusterware Home failed due to ASM Instance started back using local pfile and not allowed us to create ASM spfile:

Error message cab eb found on the log file:

[oracle@oraclelab3 12.2.0.1]$ env |grep ORA
ORACLE_SID=+ASM
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/19.0.0.0/grid
[oracle@oraclelab3 12.2.0.1]$

[oracle@oraclelab3 12.2.0.1]$ /u01/app/19.0.0.0/grid/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2021-07-18_09-13-37AM/logs/

############ ORACLE DECONFIG TOOL START ############

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

Checking for existence of the Oracle home location /u01/app/19.0.0.0/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Standalone Server
Oracle Base selected for deinstall 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/19.0.0.0/grid

## [END] Install check configuration ##

Traces log file: /tmp/deinstall2021-07-18_09-13-37AM/logs//crsdc_2021-07-18_09-13-50-AM.log

Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/netdc_check2021-07-18_09-13-5

Specify all Oracle Restart enabled listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/asmcadc_check2021-07-18_09-13-50A

ASM configuration was not detected in this Oracle home. Was ASM configured in this Oracle home (y|n) [n]: y
Automatic Storage Management (ASM) instance is detected in this Oracle home /u01/app/19.0.0.0/grid.
ASM Diagnostic Destination : /u01/app/oracle
ASM Diskgroups : +DATA,+RECO
ASM diskstring : <Default>
Diskgroups will be dropped
De-configuring ASM will drop all the diskgroups and their contents at cleanup time. This will affect all of the datathat use this ASM instance(s).
 If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify byDo you  want to modify above information (y|n) [n]:
Database Check Configuration START

Database de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/databasedc_check2021-07-18_0

Database Check Configuration END

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

####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/19.0.0.0/grid
Oracle Home selected for deinstall is: /u01/app/19.0.0.0/grid
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following Oracle Restart enabled listener(s) will be de-configured: LISTENER
ASM instance will be de-configured from this Oracle home
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/tmp/deinstall2021-07-18_09-13-37AM/logs/deinstall_deconfig2021-07-18_09-
Any error messages from this session will be written to: '/tmp/deinstall2021-07-18_09-13-37AM/logs/deinstall_deconfi13-49-AM.err'

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/databasedc_clean2021-07-18_0
ASM de-configuration trace file location: /tmp/deinstall2021-07-18_09-13-37AM/logs/asmcadc_clean2021-07-18_09-13-50A
ASM Clean Configuration START
ERROR: Exception while creating local spfile for ASMORA-29786: Oracle Restart attribute GET failed with error [Attrits[200] lsts[0]]

Exited from program.

############# ORACLE DECONFIG TOOL END #############

[oracle@oraclelab3 12.2.0.1]$

Logfile:

[oracle@oraclelab3 ~]$ more /tmp/deinstall2021-07-18_09-13-37AM/logs/asmcadc_clean2021-07-18_09-13-50AM.log
[main] [ 2021-07-18 09:15:44.686 IST ] [USMCleanConfig.cleanConfigInternal:293]  DC home value /tmp/deinstall2021-07
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:713]  ORACLE_HOME=/u01/app/19.0.0.0/grid
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:714]  ORACLE_BASE=/u01/app/oracle
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:715]  ORACLE_SID=+ASM
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:716]  ORA_CRS_HOME=null
[main] [ 2021-07-18 09:15:44.686 IST ] [DeconfigUtil.printAllEnvs:717]  PATH=/usr/local/bin:/bin:/usr/bin:/usr/local
:/home/oracle/.local/bin:/home/oracle/bin:/u01/app/19.0.0.0/grid/bin
........................
........................
........................
[main] [ 2021-07-18 09:15:52.842 IST ] [OracleHome.getVersion:1182]  /u01/app/19.0.0.0/grid/bin/sqlplus Banner:

SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1200]  Current version from sqlplus: 19.0.0.0.0
[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1066]  OracleHome.getVersion called.  Current Version:
[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1134]  Current Version From Inventory: 19.0.0.0.0
[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1066]  OracleHome.getVersion called.  Current Version:
[main] [ 2021-07-18 09:15:52.843 IST ] [OracleHome.getVersion:1134]  Current Version From Inventory: 19.0.0.0.0
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLPlusEngine.getCmmdParams:226]  m_home 19.0.0.0.0
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLPlusEngine.getCmmdParams:227]  version > 112 true
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLEngine.getEnvParams:619]  Default NLS_LANG: AMERICAN_AMERICA.AL32UTF8
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLEngine.getEnvParams:629]  NLS_LANG: AMERICAN_AMERICA.AL32UTF8
[main] [ 2021-07-18 09:15:52.843 IST ] [SQLEngine.initialize:376]  Execing SQLPLUS/SVRMGR process...
[main] [ 2021-07-18 09:15:52.846 IST ] [SQLEngine.initialize:413]  m_bReaderStarted: false
[main] [ 2021-07-18 09:15:52.846 IST ] [SQLEngine.initialize:417]  Starting Reader Thread...
[main] [ 2021-07-18 09:15:53.873 IST ] [ASMUtils.discoverASMClients:1017]  SQL select unique(db_name) from v$asm_cli
me != '+ASM'
[main] [ 2021-07-18 09:15:53.875 IST ] [SQLEngine.done:2362]  Done called
[main] [ 2021-07-18 09:15:53.876 IST ] [ASMUtils.discoverASMClients:1022]  SQFatalErrorException while retrieving AS
-01034: ORACLE not available

[main] [ 2021-07-18 09:15:53.876 IST ] [SQLEngine.done:2362]  Done called
[main] [ 2021-07-18 09:15:53.876 IST ] [USMCleanConfig.createSPFileLocal:1444]  SPFile is not yet localized
[main] [ 2021-07-18 09:15:53.876 IST ] [USMCleanConfig.createSPFileLocal:1446]  create temp spfile sql= create spfil
0.0.0/grid/dbs/spfile+ASM.ora' from memory
[main] [ 2021-07-18 09:15:53.965 IST ] [SQLEngine.done:2362]  Done called
[main] [ 2021-07-18 09:15:53.967 IST ] [USMCleanConfig.createSPFileLocal:1459]  ORA-29786: Oracle Restart attribute
 error [Attribute 'SPFILE' sts[200] lsts[0]]

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at oracle.install.db.deinstall.wrapper.Deinstall.callCleanImpl(Deinstall.java:1867)
        at oracle.install.db.deinstall.wrapper.Deinstall.main(Deinstall.java:907)
Caused by: oracle.ops.util.FatalException: Exception while creating local spfile for ASMORA-29786: Oracle Restart at
led with error [Attribute 'SPFILE' sts[200] lsts[0]]

        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.createSPFileLocal(USMCleanConfig.java:1460)
        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.cleanSIHAASM(USMCleanConfig.java:541)
        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.cleanCreateASM(USMCleanConfig.java:466)
        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.cleanConfigInternal(USMCleanConfig.java:357)
        at oracle.sysman.assistants.util.deconfig.USMCleanConfig.cleanConfig(USMCleanConfig.java:248)
        ... 6 more
[oracle@oraclelab3 ~]$ 

Verify that ASM Instance started and running from local pfile:
Kill that ASM Instance manually

[oracle@oraclelab3 12.2.0.1]$ ps -ef|grep smon
oracle   19571     1  0 09:15 ?        00:00:00 asm_smon_+ASM
oracle   19939  8016  0 09:17 pts/1    00:00:00 grep --color=auto smon

[oracle@oraclelab3 12.2.0.1]$ . oraenv
ORACLE_SID = [+ASM] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/19.0.0.0/grid
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@oraclelab3 12.2.0.1]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Sun Jul 18 09:18:12 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle.  All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> show parameter spfile;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

[oracle@oraclelab3 12.2.0.1]$ ps -ef|grep smon
oracle   19571     1  0 09:15 ?        00:00:00 asm_smon_+ASM
oracle   20046  8016  0 09:18 pts/1    00:00:00 grep --color=auto smon
[oracle@oraclelab3 12.2.0.1]$

[oracle@oraclelab3 12.2.0.1]$ kill -9 19571

Start Deinstall Clusterware home now:

[oracle@oraclelab3 12.2.0.1]$ /u01/app/19.0.0.0/grid/deinstall/deinstall
Checking for required files and bootstrapping ...
Please wait ...
Location of logs /tmp/deinstall2021-07-18_09-18-40AM/logs/

############ ORACLE DECONFIG TOOL START ############

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

Checking for existence of the Oracle home location /u01/app/19.0.0.0/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Standalone Server
Oracle Base selected for deinstall 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/19.0.0.0/grid

## [END] Install check configuration ##

Traces log file: /tmp/deinstall2021-07-18_09-18-40AM/logs//crsdc_2021-07-18_09-18-46-AM.log

Network Configuration check config START

Network de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/netdc_check2021-07-18_09-18-4

Specify all Oracle Restart enabled listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/asmcadc_check2021-07-18_09-18-47A

ASM configuration was not detected in this Oracle home. Was ASM configured in this Oracle home (y|n) [n]: y
Automatic Storage Management (ASM) instance is detected in this Oracle home /u01/app/19.0.0.0/grid.
ASM Diagnostic Destination : /u01/app/oracle
ASM Diskgroups : +DATA,+RECO
ASM diskstring : <Default>
Diskgroups will be dropped
De-configuring ASM will drop all the diskgroups and their contents at cleanup time. This will affect all of the datathat use this ASM instance(s).
 If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify byDo you  want to modify above information (y|n) [n]:
Database Check Configuration START

Database de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/databasedc_check2021-07-18_0

Database Check Configuration END

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

####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/19.0.0.0/grid
Oracle Home selected for deinstall is: /u01/app/19.0.0.0/grid
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Following Oracle Restart enabled listener(s) will be de-configured: LISTENER
ASM instance will be de-configured from this Oracle home
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/tmp/deinstall2021-07-18_09-18-40AM/logs/deinstall_deconfig2021-07-18_09-
Any error messages from this session will be written to: '/tmp/deinstall2021-07-18_09-18-40AM/logs/deinstall_deconfi18-45-AM.err'

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/databasedc_clean2021-07-18_0
ASM de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/asmcadc_clean2021-07-18_09-18-47A
ASM Clean Configuration START
ASM Clean Configuration END

Network Configuration clean config START

Network de-configuration trace file location: /tmp/deinstall2021-07-18_09-18-40AM/logs/netdc_clean2021-07-18_09-18-4

De-configuring Oracle Restart enabled listener(s): LISTENER

De-configuring listener: LISTENER
    Stopping listener: LISTENER
    Listener stopped successfully.
    Unregistering listener: LISTENER
    Listener unregistered successfully.
    Deleting listener: LISTENER
    Listener deleted successfully.
Listener de-configured successfully.

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

---------------------------------------->

Run the following command as the root user or the administrator on node "oraclelab3".

/u01/app/19.0.0.0/grid/crs/install/roothas.sh -force  -deconfig -paramfile "/tmp/deinstall2021-07-18_09-18-40AM/respOraGI19Home1.rsp"

Press Enter after you finish running the above commands

<----------------------------------------

*********************************************************************************************
Take A new session and run the above command and come back here and hit enter
*********************************************************************************************
[root@oraclelab3 ~]# /u01/app/19.0.0.0/grid/crs/install/roothas.sh -force  -deconfig -paramfile "/tmp/deinstall2021-M/response/deinstall_OraGI19Home1.rsp"
Using configuration parameter file: /tmp/deinstall2021-07-18_09-18-40AM/response/deinstall_OraGI19Home1.rsp
The log of current session can be found at:
  /tmp/deinstall2021-07-18_09-18-40AM/logs/hadeconfig.log
2021/07/18 09:20:12 CLSRSC-337: Successfully deconfigured Oracle Restart stack
[root@oraclelab3 ~]#
*********************************************************************************************
*********************************************************************************************
######################### DECONFIG CLEAN OPERATION END #########################

####################### DECONFIG CLEAN OPERATION SUMMARY #######################
ASM instance was de-configured successfully from the Oracle home
Following Oracle Restart enabled listener(s) were de-configured successfully: LISTENER
Oracle Restart was already stopped and de-configured on node "oraclelab3"
Oracle Restart is stopped and de-configured successfully.
#######################################################################

############# ORACLE DECONFIG TOOL END #############

Using properties file /tmp/deinstall2021-07-18_09-18-40AM/response/deinstall_2021-07-18_09-18-45-AM.rsp
Location of logs /tmp/deinstall2021-07-18_09-18-40AM/logs/

############ ORACLE DEINSTALL TOOL START ############

####################### DEINSTALL CHECK OPERATION SUMMARY #######################
A log of this session will be written to: '/tmp/deinstall2021-07-18_09-18-40AM/logs/deinstall_deconfig2021-07-18_09-
Any error messages from this session will be written to: '/tmp/deinstall2021-07-18_09-18-40AM/logs/deinstall_deconfi18-45-AM.err'

######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to oraclelab3
Setting CRS_HOME to true
Setting oracle.installer.invPtrLoc to /tmp/deinstall2021-07-18_09-18-40AM/oraInst.loc
Setting oracle.installer.local to false

## [END] Preparing for Deinstall ##

Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home '/u01/app/19.0.0.0/grid' from the central inventory on the local node : Done

Delete directory '/u01/app/19.0.0.0/grid' on the local node : Done

Delete directory '/u01/app/oraInventory' on the local node : Done

Failed to delete the directory '/u01/app/oracle/tfa/oraclelab3/output/dbzip'. Either user has no permission to deletse.
Failed to delete the directory '/u01/app/oracle/tfa/oraclelab3/output/tracefiles'. Either user has no permission to  in use.
Failed to delete the directory '/u01/app/oracle/tfa/oraclelab3/diagnostics_to_collect'. Either user has no permissioit is in use.
The Oracle Base directory '/u01/app/oracle' will not be removed on local node. The directory is not empty. User needleanup this directory.

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END

## [START] Oracle install clean ##

## [END] Oracle install clean ##

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

####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/19.0.0.0/grid' from the central inventory on the local node.
Successfully deleted directory '/u01/app/19.0.0.0/grid' on the local node.
Successfully deleted directory '/u01/app/oraInventory' on the local node.
Oracle Universal Installer cleanup was successful.

Run 'rm -r /etc/oraInst.loc' as root on node(s) 'oraclelab3' at the end of the session.

Run 'rm -r /opt/ORCLfmap' as root on node(s) 'oraclelab3' at the end of the session.
Run 'rm -r /etc/oratab' as root on node(s) 'oraclelab3' at the end of the session.
Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'oraclelab3'.
If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete '/u01/app/oracle' and its contents
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################

############# ORACLE DEINSTALL TOOL END #############

[oracle@oraclelab3 12.2.0.1]$

8. Verify the GI Home is cleaned up:

Verify the ASM home cleanup done and manually remove the forlders woned by root user:

[root@oraclelab3 ~]# rm -r /etc/oraInst.loc
rm: remove regular file ‘/etc/oraInst.loc’? y
[root@oraclelab3 ~]# rm -r /opt/ORCLfmap
rm: descend into directory ‘/opt/ORCLfmap’? y
rm: descend into directory ‘/opt/ORCLfmap/prot1_64’? y
rm: descend into directory ‘/opt/ORCLfmap/prot1_64/bin’? y
rm: remove regular file ‘/opt/ORCLfmap/prot1_64/bin/fmputl’? y
rm: remove regular file ‘/opt/ORCLfmap/prot1_64/bin/fmputlhp’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64/bin’? y
rm: descend into directory ‘/opt/ORCLfmap/prot1_64/etc’? y
rm: remove regular file ‘/opt/ORCLfmap/prot1_64/etc/filemap.ora’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64/etc’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64/log’? y
rm: remove directory ‘/opt/ORCLfmap/prot1_64’? y
rm: remove directory ‘/opt/ORCLfmap’? y
[root@oraclelab3 ~]# rm -r /etc/oratab
rm: remove regular file ‘/etc/oratab’? y
[root@oraclelab3 ~]# cd /u01/app/oracle
[root@oraclelab3 oracle]# ll
total 4
drwxr-x---. 3 oracle oinstall   21 Jul 18 09:19 admin
drwxr-xr-x. 3 oracle oinstall   18 Jul 15 09:32 log
drwxr-x---. 2 oracle oinstall 4096 Jul 15 02:42 oradata
drwxr-xr-x. 5 root   root       79 Jul 15 09:39 tfa
[root@oraclelab3 oracle]# rm -rf tfa/
[root@oraclelab3 oracle]# rm -rf *
[root@oraclelab3 oracle]# cd ..
[root@oraclelab3 app]# ll
total 0
drwxr-xr-x. 2 oracle oinstall 6 Jul 16 08:20 12.2.0.1
drwxr-xr-x. 2 oracle oinstall 6 Jul 18 09:20 19.0.0.0
drwxr-xr-x. 2 oracle oinstall 6 Jul 18 09:22 oracle
[root@oraclelab3 app]# 
[root@oraclelab3 12.2.0.1]# cd ../19.0.0.0/
[root@oraclelab3 19.0.0.0]# ll
total 0
[root@oraclelab3 19.0.0.0]#

Regards,
Mallik

No comments:

Post a Comment

Automation Script | Archivelog Generation Hourly Monitoring

1. List out all the running databases and pic one database where we want to monitore the archive log generation from last 1 month. [oracle@o...