How to Move/Recreate GI Management Repository to Different Shared Storage

羽化殘虹發表於2015-06-14
How to Move/Recreate GI Management Repository to Different Shared Storage (Diskgroup, CFS or NFS etc) (文件 ID 1589394.1) 轉到底部轉到底部

In this Document

Goal
Solution


APPLIES TO:

Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Information in this document applies to any platform.

GOAL

This note outlines the steps to move 12c GIMR (Grid Infrastructure Management Repository) to a different shared storage. 

This procedure will NOT preserve Management Database contents. If necessary, before implementing the procedure, backed up in text format as grid user on any node: 

$ /bin/oclumon dumpnodeview -allnodes

 

SOLUTION

 

1. Stop and disable ora.crf resource.

On each node, as root user:

# /bin/crsctl stop res ora.crf -init
# /bin/crsctl modify res ora.crf -attr ENABLED=0 -init

Do not stop ora.mgmtlsnr or ora.mgmtdb resource or Step 2 will fail with the following:

Oracle Grid Management database is running on node "". Run dbca on node "" to delete the database.


2. Issue the DBCA command to delete the management database

As Grid User, locate the node that the Management Database is running by executing: 

$ /bin/srvctl status mgmtdb


As Grid User on the node where ora.mgmtdb resource is running execute:

/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 "/home/grid/app/grid/cfgtoollogs/dbca/_mgmtdb.log" for further details.

 

3. Recreate the MGMTDB

3A. For 12.1.0.1 only:

As grid user, on any node execute the following dbca command:

/bin/dbca -silent -createDatabase -templateName MGMTSeed_Database.dbc -sid -MGMTDB -gdbName _mgmtdb -storageType ASM -diskGroupName -datafileJarLocation /assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -oui_internal
Copying database files
1% complete
3% complete
10% complete
17% complete
24% complete
31% complete
35% complete
Creating and starting Oracle instance
37% complete
42% complete
47% complete
52% complete
53% complete
56% complete
58% complete
Registering database with Oracle Grid Infrastructure
64% complete
Completing Database Creation
68% complete
78% complete
89% complete
100% complete
Look at the log file "/home/grid/app/grid/cfgtoollogs/dbca/_mgmtdb/_mgmtdb1.log" for further details.


NOTE: It's recommended to set both compatible.asm and compatible.rdbms to 12.1 for the new ASM diskgroup when creating or altering and existing diskgroup. 

Also, this example created the Management Database in a new ASM Diskgroup, to create the database in shared NFS/CFS location:

/bin/dbca -silent -createDatabase -templateName MGMTSeed_Database.dbc -sid -MGMTDB -gdbName _mgmtdb -storageType FS -datafileDestination -datafileJarLocation /assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -oui_internal

 

3B. For 12.1.0.2 only:

a. As Grid User on any node execute the following DBCA command with the desired :

$ /bin/dbca -silent -createDatabase -sid -MGMTDB -createAsContainerDatabase true -templateName MGMTSeed_Database.dbc -gdbName _mgmtdb -storageType ASM -diskGroupName -datafileJarLocation $GI_HOME/assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -skipUserTemplateCheck

Copying database files
1% complete
3% complete
10% complete
17% complete
24% complete
31% complete
35% complete
Creating and starting Oracle instance
37% complete
42% complete
47% complete
52% complete
53% complete
56% complete
58% complete
Registering database with Oracle Grid Infrastructure
64% complete
Completing Database Creation
68% complete
78% complete
89% complete
100% complete
Look at the log file "/cfgtoollogs/dbca/_mgmtdb/_mgmtdb1.log" for further details.

NOTE: It's recommended to set both compatible.asm and compatible.rdbms to 12.1 for the new ASM diskgroup when creating or altering and existing diskgroup.


Ex: CREATE DISKGROUP … ATTRIBUTE 'compatible.rdbms' = '12.1', 'compatible.asm' = '12.1';


The Management Database may be moved to an ASM Diskgroup, in a shared NFS/CFS location with the following command line:

$/bin/dbca -silent -createDatabase -templateName MGMTSeed_Database.dbc -sid -MGMTDB -gdbName _mgmtdb -storageType FS -datafileDestination -datafileJarLocation /assistants/dbca/templates -characterset AL32UTF8 -autoGeneratePasswords -oui_internal


b. Create a PDB within the MGMTDB using DBCA.


As Grid User on any node execute the following DBCA command:

NOTE: The CLUSTER_NAME needs to have any hyphens (“-“) replaced with underscores (“_”)

$ /bin/dbca -silent -createPluggableDatabase -sourceDB -MGMTDB -pdbName -createPDBFrom RMANBACKUP -PDBBackUpfile /assistants/dbca/templates/mgmtseed_pdb.dfb -PDBMetadataFile /assistants/dbca/templates/mgmtseed_pdb.xml -createAsClone true –internalSkipGIHomeCheck
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 "/cfgtoollogs/dbca/_mgmtdb//_mgmtdb2.log" for further details.

 

4. Secure that the Management Database credential:

As Grid User, confirm the node on which MGMTDB is running by executing.

$ /bin/srvctl status MGMTDB
Database is enabled
Instance -MGMTDB is running on node

On :

$ /bin/mgmtca

 

5. Enable and start ora.crf resource.

On each node, as root user:

# /bin/crsctl modify res ora.crf -attr ENABLED=1 -init
# /bin/crsctl start res ora.crf -init

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26175573/viewspace-1699246/,如需轉載,請註明出處,否則將追究法律責任。

相關文章