What we can do if we’ve lost all MGMTDB data.

Assumed that you are recreated OCRVT group where placed OCR, Voting and MGMTDB. You successfully restored OCR and replaced Voting files, but all MGMTDB data was lost. If you want just go through this and you don’t need anymore MGMTDB you can just remove MGMTDB resources.

/opt/oracle/product/grid/ stop res ora.crf -init
/opt/oracle/product/grid/ modify res ora.crf -attr ENABLED=0 -init
/opt/oracle/product/grid/ stop MGMTLSNR
/opt/oracle/product/grid/ stop mgmtdb
/opt/oracle/product/grid/ remove mgmtdb
/opt/oracle/product/grid/ remove MGMTLSNR

But if you need this database, then you need remove mgmtdb resource through srvctl but must keep MGMTLSNR and ora.crf.

/opt/oracle/product/grid/ stop mgmtdb
/opt/oracle/product/grid/ remove mgmtdb

After that you need recreate database as oracle user.

/opt/oracle/product/grid/ add mgmtlsnr
/opt/oracle/product/grid/ -silent -createDatabase -sid -MGMTDB -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc -gdbName _mgmtdb -storageType ASM -diskGroupName +OCRVT -datafileJarLocation /opt/oracle/product/grid/ -characterset AL32UTF8 -skipUserTemplateCheck

/opt/oracle/product/grid/ -silent -createPluggableDatabase -sourceDB -MGMTDB -pdbName <CLUSTER_NAME> -createPDBFrom RMANBACKUP -PDBBackUpfile /opt/oracle/product/grid/ -PDBMetadataFile /opt/oracle/product/grid/ -createAsClone true
/opt/oracle/product/grid/ start res ora.crf -init
/opt/oracle/product/grid/ start MGMTLSNR
/opt/oracle/product/grid/ start mgmtdb
oclumon manage -get repsize
oclumon dumpnodeview -allnodes -last '01:00:00'
/opt/oracle/product/grid/ modify res ora.crf -attr ENABLED=1 -init

In normal situation use this documentation: How to Move/Recreate GI Management Repository to Different Shared Storage (Diskgroup, CFS or NFS etc) (Doc ID 1589394.1)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s