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/12.1.0.2/bin/crsctl stop res ora.crf -init
/opt/oracle/product/grid/12.1.0.2/bin/crsctl modify res ora.crf -attr ENABLED=0 -init
/opt/oracle/product/grid/12.1.0.2/bin/srvctl stop MGMTLSNR
/opt/oracle/product/grid/12.1.0.2/bin/srvctl stop mgmtdb
/opt/oracle/product/grid/12.1.0.2/bin/srvctl remove mgmtdb
/opt/oracle/product/grid/12.1.0.2/bin/srvctl 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/12.1.0.2/bin/srvctl stop mgmtdb
/opt/oracle/product/grid/12.1.0.2/bin/srvctl remove mgmtdb

After that you need recreate database as oracle user.

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

/opt/oracle/product/grid/12.1.0.2/bin/dbca -silent -createPluggableDatabase -sourceDB -MGMTDB -pdbName <CLUSTER_NAME> -createPDBFrom RMANBACKUP -PDBBackUpfile /opt/oracle/product/grid/12.1.0.2/assistants/dbca/templates/mgmtseed_pdb.dfb -PDBMetadataFile /opt/oracle/product/grid/12.1.0.2/assistants/dbca/templates/mgmtseed_pdb.xml -createAsClone true
/opt/oracle/product/grid/12.1.0.2/bin/crsctl start res ora.crf -init
/opt/oracle/product/grid/12.1.0.2/bin/srvctl start MGMTLSNR
/opt/oracle/product/grid/12.1.0.2/bin/srvctl start mgmtdb
oclumon manage -get repsize
oclumon dumpnodeview -allnodes -last '01:00:00'
/opt/oracle/product/grid/12.1.0.2/bin/crsctl 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)

Advertisements

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