How to Remove MGMT Database

  • by

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 sections in this post:

  1. Disable Cluster Health Monitor
  2. Delete MGMT Database

A. Disable Cluster Health Monitor

1. 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

2. 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

2. 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 res ora.crf -init -attr "ENABLED=0"
[root@primary02 ~]# crsctl status resource ora.crf -init -f | grep -i "ENABLED"
ENABLED=0

B. Delete MGMT Database

1. Check MGMTDB Configuration

[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

2. Check MGMTDB Status

[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. Now, you can decide to either relocate MGMTDB to node 1, or go to node 2 to operate remaining steps.

3. 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 online in order to delete it.

4. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *