Recently I discovered on Oracle Grid Infrastructure 12cR2 that the ASM disk group hosting the Management DB (-MGMTDB) was filling up the disk space very quickly.
This is due to a bug on the oclumon data purge procedure.
To fix the problem, two possibilities are available:
- Recreate the Management DB
- Manually truncate the tables not purged and shrinking the Tablespace Size
Below are described the two options.
Option 1 – Recreate the Management DB
As root user on each cluster node:
# /u01/app/12.2.0.1/grid/bin/crsctl stop res ora.crf -init # /u01/app/12.2.0.1/grid/bin/crsctl modify res ora.crf -attr ENABLED=0 -init
As Grid from the local node hosting the Management Database Instance run the commands:
$ /u01/app/12.2.0.1/grid/bin/srvctl status mgmtdb $ /u01/app/12.2.0.1/grid/bin/dbca -silent -deleteDatabase -sourceDB -MGMTDB Connecting to database 4% complete 9% complete 14% complete 19% complete 23% complete 28% complete 47% complete Updating network configuration files 48% complete 52% complete Deleting instance and datafiles 76% complete 100% complete
How to recreate the MGMTDB:
$ /u01/app/12.2.0.1/grid/bin/dbca -silent -createDatabase -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc
-sid -MGMTDB
-gdbName _mgmtdb
-storageType ASM
-diskGroupName GIMR
-datafileJarLocation <GI HOME>/assistants/dbca/templates
-characterset AL32UTF8
-autoGeneratePassword
-skipUserTemplateCheck
Create the pluggable GIMR database
$ /u01/app/12.2.0.1/grid/bin/mgmtca -local
Option 2 – Manually truncate the tables
As root user stop and disable ora.crf resource on each cluster node:
# /u01/app/12.2.0.1/grid/bin/crsctl stop res ora.crf -init # /u01/app/12.2.0.1/grid/bin/crsctl modify res ora.crf -attr ENABLED=0 -init
Connect to MGMTDB and identify the segments to truncate:
export ORACLE_SID=-MGMTDB $ORACLE_HOME/bin/sqlplus / as sysdba SQL> select pdb_name from dba_pdbs where pdb_name!='PDB$SEED'; SQL> alter session set container=GIMR_DSCREP_10; Session altered. SQL> col obj format a50 SQL> select owner||'.'||SEGMENT_NAME obj, BYTES from dba_segments where owner='CHM' order by 2 asc;
Likely those two tables are much bigger than the rest :
- CHM.CHMOS_PROCESS_INT_TBL
- CHM.CHMOS_DEVICE_INT_TBL
Truncate the tables:
SQL> truncate table CHM.CHMOS_PROCESS_INT_TBL; SQL> truncate table CHM.CHMOS_DEVICE_INT_TBL;
Then if needed shrink the tablespace and job done!