Some DBA may consider to remove MGMT database because of resource consuming. I myself found that MGMT database is error-prone when we apply patches on Grid Infrastructure (GI) and Oracle database system.
There're two major steps in this post:
You can either delete MGMT DB by taking only step B for recreate it later, or delete it completely by taking step A and B.
Disable Cluster Health Monitor (ora.crf)
Check CHM Configuration
[root@primary01 ~]# . /home/grid/.bash_profile
[root@primary01 ~]# crsctl status resource ora.crf -init -f
NAME=ora.crf
TYPE=ora.crf.type
STATE=ONLINE
TARGET=ONLINE
ACL=owner:root:rw-,pgrp:oinstall:rw-,other::r--,user:grid:r-x
ACTIONS=
ACTION_SCRIPT=
ACTION_TIMEOUT=60
ACTIVE_PLACEMENT=0
AGENT_FILENAME=%CRS_HOME%/bin/orarootagent%CRS_EXE_SUFFIX%
AUTO_START=always
CARDINALITY=1
CARDINALITY_ID=0
CHECK_ARGS=
CHECK_COMMAND=
CHECK_INTERVAL=30
CHECK_TIMEOUT=0
CLEAN_ARGS=
CLEAN_COMMAND=
CLEAN_TIMEOUT=60
CONFIG_VERSION=1
CSS_CRITICAL=no
DAEMON_LOGGING_LEVELS=CRFMOND=0,CRFLDREP=0,CRFLOGD=0,CRFPROXY=0,OCLUMON=0,OCRAPI=0,OCRCLI=0,OCRMSG=0,CSSCLNT=0,CRFM=0,CRFCLI=0,CRFMI=0,CLSINET=0,GIPCLIB=2,GIPC=2,GIPCGEN=2,GIPCTRAC=2,GIPCWAIT=2,GIPCXCPT=2,GIPCOSD=2,GIPCBASE=2,GIPCCLSA=2,GIPCCLSC=2,GIPCEXMP=2,GIPCGMOD=2,GIPCHEAD=2,GIPCMUX=2,GIPCNET=2,GIPCNULL=2,GIPCPKT=2,GIPCSMEM=2,GIPCHAUP=2,GIPCHALO=2,GIPCHTHR=2,GIPCHGEN=2,GIPCHLCK=2,GIPCHDEM=2,GIPCHWRK=2,GIPCTLS=2,GIPCHGNS=2
DAEMON_TRACE_FILE_OPTIONS=filesize=26214400,numsegments=10
DELETE_TIMEOUT=60
DESCRIPTION="Resource type for Crf Agents"
DETACHED=true
ENABLED=1
FAILOVER_DELAY=0
FAILURE_INTERVAL=3
FAILURE_THRESHOLD=5
HOSTING_MEMBERS=
ID=ora.crf
IGNORE_TARGET_ON_FAILURE=no
INSTANCE_COUNT=1
INSTANCE_FAILOVER=1
INTERMEDIATE_TIMEOUT=0
LOAD=1
LOGGING_LEVEL=1
MODIFY_TIMEOUT=60
OFFLINE_CHECK_INTERVAL=0
OS_CRASH_THRESHOLD=0
OS_CRASH_UPTIME=0
OXR_SECTION=0
PID_FILE=
PLACEMENT=balanced
PROCESS_TO_MONITOR=
RELOCATE_BY_DEPENDENCY=1
RELOCATE_KIND=offline
RESOURCE_GROUP=
RESTART_ATTEMPTS=5
RESTART_DELAY=0
SCRIPT_TIMEOUT=60
SERVER_CATEGORY=
SERVER_POOLS=
START_ARGS=
START_COMMAND=
START_CONCURRENCY=0
START_DEPENDENCIES=hard(ora.gpnpd) pullup(ora.gpnpd)
START_TIMEOUT=120
STOP_ARGS=
STOP_COMMAND=
STOP_CONCURRENCY=0
STOP_DEPENDENCIES=hard(shutdown:ora.gipcd)
STOP_TIMEOUT=120
TARGET_DEFAULT=default
UNRESPONSIVE_TIMEOUT=180
UPTIME_THRESHOLD=1m
USER_WORKLOAD=no
USE_STICKINESS=0
USR_ORA_ENV=
WORKLOAD_CPU=0
WORKLOAD_CPU_CAP=0
WORKLOAD_MEMORY_MAX=0
WORKLOAD_MEMORY_TARGET=0
Stop CHM Service
Node 1
[root@primary01 ~]# crsctl stop resource ora.crf -init
CRS-2673: Attempting to stop 'ora.crf' on 'primary01'
CRS-2677: Stop of 'ora.crf' on 'primary01' succeeded
Node 2
[root@primary02 ~]# crsctl stop resource ora.crf -init
CRS-2673: Attempting to stop 'ora.crf' on 'primary02'
CRS-2677: Stop of 'ora.crf' on 'primary02' succeeded
Disable CHM Service
Node 1
[root@primary01 ~]# crsctl modify resource ora.crf -init -attr "ENABLED=0"
[root@primary01 ~]# crsctl status resource ora.crf -init -f | grep -i "ENABLED"
ENABLED=0
Node 2
[root@primary02 ~]# crsctl modify resource ora.crf -init -attr "ENABLED=0"
[root@primary02 ~]# crsctl status resource ora.crf -init -f | grep -i "ENABLED"
ENABLED=0
Delete MGMT Database
Check MGMTDB Configuration
[root@primary01 ~]# su - grid
[grid@primary01 ~]$ srvctl config mgmtdb
Database unique name: _mgmtdb
Database name:
Oracle home: <CRS home>
Oracle user: grid
Spfile: +MGMT/_MGMTDB/PARAMETERFILE/spfile.270.1052406353
Password file: +MGMT/_MGMTDB/PASSWORD/pwd_mgmtdb.257.1052403215
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Type: Management
PDB name: GIMR_DSCREP_10
PDB service: GIMR_DSCREP_10
Cluster name: primary-cluster
Database instance: -MGMTDB
Check MGMTDB Status
We use command srvctl status mgmtdb to see which node that MGMTDB is running on.
[grid@primary01 ~]$ srvctl status mgmtdb
Database is enabled
Instance -MGMTDB is running on node primary02
As you can see, MGMTDB is running on node 2. To operate on the right node, you can either relocate MGMTDB to node 1, or go to node 2 to perform remaining steps.
Delete MGMTDB Completely
I decide to delete it on node 2 silently by using Database Configuration Assistant (DBCA).
[grid@primary02 ~]$ dbca -silent -deleteDatabase -sourceDB -MGMTDB
[WARNING] [DBT-19202] The Database Configuration Assistant will delete the Oracle instances and datafiles for your database. All information in the database will be destroyed.
Prepare for db operation
32% complete
Connecting to database
35% complete
39% complete
42% complete
45% complete
48% complete
52% complete
65% complete
Updating network configuration files
68% complete
Deleting instance and datafiles
84% complete
100% complete
Database deletion completed.
Look at the log file "/u01/app/grid/cfgtoollogs/dbca/_mgmtdb/_mgmtdb.log" for further details.
Please note that, you should keep the database running in order to delete it.
Check Any MGMTDB
[grid@primary02 ~]$ srvctl status mgmtdb
PRCD-1120 : The resource for database _mgmtdb could not be found.
PRCR-1001 : Resource ora.mgmtdb does not exist
PRCD-1120 means that there's no MGMTDB in this cluster, at least, it can't find any. In this case, this is what we expect.
After that, the resource has been removed from the cluster. Moreover, all data files are removed from ASM completely.
Disable MGMTLSNR
Optionally, you can disable MGMTLSNR.
[grid@primary01 ~]$ srvctl stop mgmtlsnr
[grid@primary01 ~]$ srvctl disable mgmtlsnr
It's no longer used.
Excellent. Clear, easy to follow, cut/past….well done. Exactly what I was looking for.
I’m so glad.