DBA Hub

📋Steps in this guide1/9

How to recreate MGMT database in ORACLE 12C GRID - DBACLASS DBACLASS

This articles contains steps for dropping and recreating MGMTDB database in ORACLE 12C grid infrastructure. Follow them sequentially.

oracle clusteringintermediate
by OracleDba
21 views
1

1. Find on which node mgmt db is running:

MGMT always runs only on one node.

Code/Command (click line numbers to comment):

1
2
3
oracle@hostdb1-6:~$ srvctl status mgmtdb
Database is enabled
Instance -MGMTDB is running on node hostdb1-6
2

2. Stop and disable CRF component as root user. ( on both the nodes)

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- ON NODE 1:
root@hostdb01# echo $ORACLE_HOME
/gridapp/app/oracle/product/grid12c


root@hostdb1-6:~# cd /gridapp/app/oracle/product/grid12c/bin

root@hostdb1-6:/gridapp/app/oracle/product/grid12c/bin# ./crsctl stop res ora.crf -init
CRS-2673: Attempting to stop 'ora.crf' on 'hostdb1-6'
CRS-2677: Stop of 'ora.crf' on 'hostdb1-6' succeeded

root@hostdb1-6:/gridapp/app/oracle/product/grid12c/bin# ./crsctl modify res ora.crf -attr ENABLED=0 -init




-- ON NODE 2:

root@hostdb2-6:~# cd /gridapp/app/oracle/product/grid12c/bin

root@hostdb2-6:/gridapp/app/oracle/product/grid12c/bin#  ./crsctl stop res ora.crf -init
CRS-2673: Attempting to stop 'ora.crf' on 'hostdb2-6'
CRS-2677: Stop of 'ora.crf' on 'hostdb2-6' succeeded

root@hostdb2-6:/gridapp/app/oracle/product/grid12c/bin#  ./crsctl modify res ora.crf -attr ENABLED=0 -init
3

3. Delete the mgmt db ( from grid owner)

— In our setup grid owner is oracle

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
oracle@hostdb1-6:~$ cd $ORACLE_HOME/bin

oracle@hostdb1-6:...app/oracle/product/grid12c/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
Look at the log file "/gridapp/app/grid/cfgtoollogs/dbca/_mgmtdb0.log" for further details.
oracle@hostdb1-6:...app/oracle/product/grid12c/bin$
4

4. Now create the NEW MGMT container DB ( ONLY ONE ONE NODE)

dbca -silent -createDatabase -sid -MGMTDB -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc -gdbName _mgmtdb -storageType ASM -diskGroupName +MGMTDB -datafileJarLocation /gridapp/app/oracle/product/grid12c/assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -skipUserTemplateCheck

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
oracle@hostdb1-6:...app/oracle/product/grid12c/bin$ dbca -silent -createDatabase -sid -MGMTDB -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc -gdbName _mgmtdb
-storageType ASM -diskGroupName +MGMTDB -datafileJarLocation /gridapp/app/oracle/product/grid12c/assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -skipUserTemplateCheck


Registering database with Oracle Grid Infrastructure
5% complete
Copying database files
7% complete
9% complete
16% complete
23% complete
30% complete
37% complete
41% complete
Creating and starting Oracle instance
43% complete
48% complete
49% complete
50% complete
55% complete
60% complete
61% complete
64% complete
Completing Database Creation
68% complete
79% complete
89% complete
100% complete
Look at the log file "/gridapp/app/grid/cfgtoollogs/dbca/_mgmtdb/_mgmtdb4.log" for further details.
5

5. Now create the NEW MGMT pluggable DB ( ONLY ONE ONE NODE)

dbca -silent -createPluggableDatabase -sourceDB -MGMTDB -pdbName preom -createPDBFrom RMANBACKUP -PDBBackUpfile /gridapp/app/oracle/product/grid12c/assistants/dbca/templates/mgmtseed_pdb.dfb -PDBMetadataFile /gridapp/app/oracle/product/grid12c/assistants/dbca/templates/mgmtseed_pdb.xml -createAsClone true

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
oracle@hostdb1-6:...app/oracle/product/grid12c/bin$ dbca -silent -createPluggableDatabase -sourceDB -MGMTDB -pdbName preom -createPDBFrom RMANBACKUP -PDBBackUpfile /gridapp/app/oracle/product/grid12c/assistants/dbca/templates/mgmtseed_pdb.dfb -PDBMetadataFile /gridapp/app/oracle/product/grid12c/assistants/dbca/templates/mgmtseed_pdb.xml -createAsClone true


[Finalizer] [ 2020-08-13 19:40:10.915 AST ] [ClusterUtil.finalize:117]  ClusterUtil: finalized called for oracle.ops.mgmt.has.ClusterUtil@1f248f2b
Creating Pluggable Database
4% complete
12% complete
21% complete
38% complete
55% complete
85% complete
Completing Pluggable Database Creation
100% complete
Look at the log file "/gridapp/app/grid/cfgtoollogs/dbca/_mgmtdb/preom/_mgmtdb2.log" for further details.
oracle@hostdb1-6:...app/oracle/product/grid12c/bin$
6

6. Check the MGMTDB status:

Code/Command (click line numbers to comment):

1
2
3
oracle@hostdb1-6:...app/oracle/product/grid12c/bin$ srvctl status mgmtdb
Database is enabled
Instance -MGMTDB is running on node hostdb1-6
7

7 . Run the mgmtca config tool: ( only on node node)

Code/Command (click line numbers to comment):

1
2
3
oracle@hostdb1-6:...app/oracle/product/grid12c/bin$ which mgmtca
/gridapp/app/oracle/product/grid12c/bin/mgmtca
oracle@hostdb1-6:...app/oracle/product/grid12c/bin$ mgmtca
8

8 . Start and enable the CRF component ( ON BOTH NODES)– Run as root user

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-- ON NODE 1:

root@hostdb1-6:~#  cd /gridapp/app/oracle/product/grid12c
root@hostdb1-6:/gridapp/app/oracle/product/grid12c# cd bin
root@hostdb1-6:/gridapp/app/oracle/product/grid12c/bin# ./crsctl modify res ora.crf -attr ENABLED=1 -init
root@hostdb1-6:/gridapp/app/oracle/product/grid12c/bin# ./crsctl start res ora.crf -init
CRS-2672: Attempting to start 'ora.crf' on 'hostdb1-6'
CRS-2676: Start of 'ora.crf' on 'hostdb1-6' succeeded


-- ON NODE 2:

root@hostdb2-6:~#  cd /gridapp/app/oracle/product/grid12c
root@hostdb2-6:/gridapp/app/oracle/product/grid12c# cd bin
root@hostdb2-6:/gridapp/app/oracle/product/grid12c/bin# ./crsctl modify res ora.crf -attr ENABLED=1 -init
root@hostdb2-6:/gridapp/app/oracle/product/grid12c/bin# ./crsctl start res ora.crf -init
CRS-2672: Attempting to start 'ora.crf' on 'hostdb2-6'
CRS-2676: Start of 'ora.crf' on 'hostdb2-6' succeeded
9

9 . Do post check:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
oracle@hostdb1-6:~$ export ORACLE_SID=-MGMTDB
oracle@hostdb1-6:~$ s

SQL*Plus: Release 12.1.0.2.0 Production on Thu Aug 13 21:36:41 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management and Advanced Analytics options

SQL> select comp_id,status from dba_registry;

COMP_ID                        STATUS
------------------------------ --------------------------------------------
OWM                            VALID
XDB                            VALID
CATALOG                        VALID
CATPROC                        VALID
RAC                            OPTION OFF

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PREOM                          READ WRITE NO

Comments (0)

Please to add comments

No comments yet. Be the first to comment!