Hey all!

In the last post I explained briefly about the contents for GRID DiskGroup when we decide to not create a separated DiskGroup for GIMR/MGMTDB.

Well, this situation really often! But, we don’t want to store MGMTDB in the same DiskGroup that we have the main files for GI: OCR, Voting Disk, passwordfile e spfile do ASM.

There is a PERL script provided by Oracle that allow us to move MGMTDB to a different DiskGroup.

You can download script from the following Metalink/MOS Note: MOS Note 2065175.1: MDBUtil: GI Management Repository configuration tool

After you have downloaded the script, let’s see what are the options that we have with it:

[grid@dbnode01 ~]$ ./mdbutil.pl 
mdbutil.pl version : 1.98
Unrecognized options passed!
Usage:
Create/Enable MGMTDB & CHM
mdbutil.pl --addmdb --target=
Move MGMTDB to another location
mdbutil.pl --mvmgmtdb --target=
Check MGMTDB status
mdbutil.pl --status
 mdbutil.pl OPTIONS
   --addmdb            Create MGMTDB/CHM and reconfigure related functions
   --mvmgmtdb          Migrate MGMTDB to another location   
   --target='+DATA'    MGMTDB Disk Group location
   --status            Check the CHM & MGMTDB status
   --help              Display this help and exit
   --debug             Verbose commands output/trace

 Example:
   Create/Enable MGMTDB:
     mdbutil.pl --addmdb --target=+DATA
   Move MGMTDB to another location:
     mdbutil.pl --mvmgmtdb --target=+REDO             
   Check CHM:
     mdbutil.pl --status

We have a lot of options with this script. For now, we just want to move MGMTDB to a different DiskGroup:

[grid@dbnode01 ~]$ ./mdbutil.pl --mvmgmtdb --target=+OBQ_DATA
mdbutil.pl version : 1.98
2019-06-13 17:32:33: E Error: The MGMTDB is not running locally, relocate MGMTDB on local node and retry

We received an error. This error is normal for that situation because MGMTDB is not running in the same node that I had executed mdbutil.pl. We have two options: execute mdbutil.pl from the same node that we have MGMTDB running or we can relocate MGMTDB. Just for illustrate, let’s relocate MGMTDB to the node that we have the script mdbutil.pl:

[grid@dbnode01 ~]$ srvctl relocate mgmtdb

After MGMTDB relocation, we can move forward:

[grid@dbnode01 ~]$ ./mdbutil.pl --mvmgmtdb --target=+OBQ_DATA
 mdbutil.pl version : 1.98
 Moving MGMTDB, it will be stopped, are you sure (Y/N)? Y
 2019-06-13 17:36:53: I Checking for the required paths under +OBQ_DATA
 2019-06-13 17:36:54: I Creating new path +OBQ_DATA/_MGMTDB/PARAMETERFILE
 2019-06-13 17:36:57: I Creating new path +OBQ_DATA/_MGMTDB/CONTROLFILE
 2019-06-13 17:36:59: I Creating new path +OBQ_DATA/_MGMTDB/ONLINELOG
 2019-06-13 17:37:01: I Creating new path +OBQ_DATA/_MGMTDB/DATAFILE
 2019-06-13 17:37:04: I Creating new path +OBQ_DATA/_MGMTDB/TEMPFILE
 2019-06-13 17:37:06: I Creating new path +OBQ_DATA/_MGMTDB/DATAFILE/PDB$SEED
 2019-06-13 17:37:08: I Creating new path +OBQ_DATA/_MGMTDB/DATAFILE/TEMPFILE/PDB$SEED
 2019-06-13 17:37:09: I Creating new path +OBQ_DATA/_MGMTDB/DATAFILE/crsdrlq2db
 2019-06-13 17:37:12: I Creating new path +OBQ_DATA/_MGMTDB/TEMPFILE/crsdrlq2db
 2019-06-13 17:37:14: I Getting MGMTDB Database files location
 2019-06-13 17:37:14: I Getting MGMTDB Temp files location
 2019-06-13 17:37:14: I Getting MGMTDB PDB PDB$SEED files location
 2019-06-13 17:37:14: I Getting MGMTDB PDB PDB$SEED Temp files location
 2019-06-13 17:37:15: I Getting MGMTDB PDB GIMR_DSCREP_10 files location
 2019-06-13 17:37:15: I Getting MGMTDB PDB GIMR_DSCREP_10 Temp files location
 2019-06-13 17:37:20: I Creating temporary PFILE
 2019-06-13 17:37:20: I Creating target SPFILE
 2019-06-13 17:37:24: I Stopping the Cluster Health Analysis Resource
 2019-06-13 17:37:35: I Stopping mgmtdb
 2019-06-13 17:37:56: I Copying MGMTDB DBFiles to +OBQ_DATA
 2019-06-13 17:38:09: I Copying MGMTDB PDB$SEED DBFiles to +OBQ_DATA
 2019-06-13 17:38:18: I Copying MGMTDB PDB DBFiles to +OBQ_DATA
 2019-06-13 17:43:18: I Creating the CTRL File
 2019-06-13 17:44:39: I The CTRL File has been created and MGMTDB is now running from +OBQ_DATA
 2019-06-13 17:44:39: I Setting MGMTDB SPFile location
 2019-06-13 17:44:41: I Modifing the init parameter
 2019-06-13 17:44:41: I Removing old MGMTDB
 2019-06-13 17:45:17: I Changing START_DEPENDENCIES
 2019-06-13 17:45:17: I Changing STOP_DEPENDENCIES
 2019-06-13 17:45:18: I Restarting MGMTDB using target SPFile
 2019-06-13 17:46:24: I Starting the Cluster Health Analysis Resource
 2019-06-13 17:46:32: I MGMTDB Successfully moved to +OBQ_DATA!

MGMTDB was moved successfully to the DiskGroup +OBQ_DATA.

Let’s check now the content for DiskGroup GRID?

[grid@dbnode01 ~]$ asmcmd
ASMCMD>
ASMCMD>
ASMCMD> find +obq_grid1 *
+obq_grid1/ASM/
+obq_grid1/ASM/PASSWORD/
+obq_grid1/ASM/PASSWORD/pwdasm.256.1010754289
+obq_grid1/ASM/PASSWORD/pwdasm.257.1010754749
+obq_grid1/crsdrlq2db/
+obq_grid1/crsdrlq2db/ASMPARAMETERFILE/
+obq_grid1/crsdrlq2db/ASMPARAMETERFILE/REGISTRY.253.1010754285
+obq_grid1/crsdrlq2db/OCRFILE/
+obq_grid1/crsdrlq2db/OCRFILE/REGISTRY.255.1010754291
+obq_grid1/orapwasm
+obq_grid1/orapwasm_backup

As we can see in the above list, we don’t have anymore MGMTDB in DiskGroup GRID. That’s fine and is what we want! Just to compare, you can read my last post about it and you will confirm that before move MGMTDB, all the files from MGMTDB were in DiskGroup GRID. Click here to see last post about it.

Peace!

Vinicius