Note: This article declined to reprint.
1 MGMTDB Instructions
In the installation of the Oracle 12.1.0.1 grid Infrastructure, you can choose whether to install the grid Infrastructure Management Repository (GIMR) database: Mgmtdb. Such as:
In the grid Infrastructure 12.1.0.2, no options have been changed, and the MIMR database has become a mandatory option.
In Oracle 12c Management database is used to store cluster HealthMonitor (CHM/OS,ORA.CRF), Oracle database QoS management,rapid Home Pro Visioning and other data.
Managementrepository is a single instance managed by 12c Clusterware, which starts MGMTDG and runs on one of the nodes when cluster is started, and is subject to GI management, if the node running MGMTDG goes down, gi will automatically transfer the MGMTDB to the other nodes.
By default, the data files for the MGMTDB database are stored in a shared device, such as a ocr/voting disk group, but can be moved later in the location.
In 12.1.0.1, GIMR is optional, and all dependent features such as Clusterhealth Monitor (Chm/os) are disabled if the management database is not selected when GI is installed.
Of course, in 12.1.0.2, this problem can be ignored because it is mandatory to install GIMR.
In addition, for the MGMT database, there is no need to manually back it up in the current version.
2 MGMTDB Basic Operation
2.1 View Management DB Related resources:
[Email protected] ~]# crsctl stat res-t
--------------------------------------------------------------------------------
Name Target State Server Statedetails
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
......
Ora. Mgmtlsnr
1 Online online Rac2 169.254.142.79 192.1
68.57.6,stable
Ora.mgmtdb
1 Online Online Rac2 open,stable
......
[Email protected] ~]#
Use the Crsctl command to see ORA.MGMTDB and Ora.mgmtlsnr.
At the operating system level, you can also see that there are 2 corresponding processes:
[Email protected] ~]# ps-ef| grep pmon_-mgmtdb
Grid 7452 1 0 14:59? 00:00:00 Mdb_pmon_-mgmtdb
Root 7756 7727 0 15:02 pts/4 00:00:00 grep pmon_-mgmtdb
[Email protected] ~]# ps-ef| grep Mgmtlsnr
Grid 7411 1 014:58? 00:00:00/u01/gridsoft/12.1.0/bin/tnslsnr Mgmtlsnr-no_crs_notify-inherit
Root 7758 7727 0 15:02 pts/4 00:00:00 grep Mgmtlsnr
[Email protected] ~]#
2.2 Starting and closing Mgmt
Normally, the Mgmtdb will start automatically when the GI starts, but it can also be managed manually, using the SRVCTL operation directly:
Usage:srvctl start mgmtdb[-startoption <start_option>] [-node <node_name>]
Usage:srvctl start Mgmtlsnr [-node <node_name>]
2.3 View Management Database's log and trace files
In general, it is not necessary to view the trace of Mgmt db, if you want to view it, use the following command:
[Email protected] _mgmtdb]$ pwd
/u01/gridbase/diag/rdbms/_mgmtdb
[[email protected] _mgmtdb]$ ls
I_1.mif-mgmtdb
[Email protected] _mgmtdb]$
Enter the trace directory under $oracle_base. But when entering-mgmtdb, be aware that you cannot directly CD:
[Email protected] _mgmtdb]$ Cd-mgmtdb
-BASH:CD:-m:invalid option
CD:USAGE:CD [-l|-p] [dir]
[Email protected] _mgmtdb]$
you must use./-MGMTDB, such as:
[[Email protected] _mgmtdb]$ CD./-mgmtdb
[[email protected]-mgmtdb]$ ls
Alert HM incpkg LCK metadata METADATA_PV sweep
Cdump incident IR Log metadata_dgif stage trace
[Email protected]-mgmtdb]$
[Email protected] trace]$ pwd
/u01/gridbase/diag/rdbms/_mgmtdb/-mgmtdb/trace
[[email protected] trace]$ ls
Alert_-mgmtdb.log-mgmtdb_ckpt_4772.trm-mgmtdb_lgwr_7475.trc-mgmtdb_m001_10288.trm-mgmtdb_ora_10486.trc-mg Mtdb_p001_5645.trm
Cdmp_20140807064254-mgmtdb_ckpt_7477.trc-mgmtdb_lgwr_7475.trm-mgmtdb_m001_10330.trc-mgmtdb_ora_10486.trm-mg Mtdb_p001_7523.trc
Cdmp_20141208110548-mgmtdb_ckpt_7477.trm-mgmtdb_m000_10101.trc-mgmtdb_m001_10330.trm-mgmtdb_ora_10830.trc-mg Mtdb_p001_7523.trm
Cdmp_20141208110550-mgmtdb_dbrm_4764.trc-mgmtdb_m000_10101.trm-mgmtdb_m001_8055.trc-mgmtdb_ora_10830.trm-mg Mtdb_rbal_10460.trc
Cdmp_20141208110553-mgmtdb_dbrm_4764.trm-mgmtdb_m000_10202.trc-mgmtdb_m001_8055.trm-mgmtdb_ora_3770.trc-mg Mtdb_rbal_10460.trm
Cdmp_20141208110555-mgmtdb_dbrm_7469.trc-mgmtdb_m000_10202.trm-mgmtdb_mark_10484.trc-mgmtdb_ora_3770.trm-mg Mtdb_rbal_4782.trc
MGMT DB's log and trace are all in this.
3 Mgmtdb is a CDB database with a PDB
As I said earlier, Mgmtdb is an example, in fact, Mgmtdb is a CDB library with a PDB, and we can use the GI command to directly manipulate the MGMTDB corresponding PDB.
-- View Mgmtdb Current node:
[Email protected]/]$ Oclumon Manage-get Master
Master = Rac1
-- View status :
[Email protected]/]$ srvctl status Mgmtdb
Database is enabled
Instance-mgmtdb is running on node RAC2
-- To view configuration information :
[Email protected]/]$ srvctl config mgmtdb
Database Unique Name: _MGMTDB
Database Name:
Oracle Home:/u01/gridsoft/12.1.0
Oracle User:grid
Spfile:+ocr_voting/_mgmtdb/spfile-mgmtdb.ora
Password file:
Domain:
Start Options:open
Stop options:immediate
Database role:primary
Management policy:automatic
Database instance:-mgmtdb
Type:management
-- Connecting Mgmtdb instances
[Email protected]/]$ export ORACLE_SID=-MGMTDB
[Email protected]/]$ Sqlplus/as SYSDBA
Sql*plus:release 12.1.0.1.0 Production Onmon Dec 8 15:24:37 2014
Copyright (c) 1982, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise editionrelease 12.1.0.1.0-64bit Production
With the partitioning, Automatic storagemanagement and advanced Analytics options
Sql> Select file_name Fromdba_data_files Union Select member file_name from V$logfile;
file_name
--------------------------------------------------------------------------------
+ocr_voting/_mgmtdb/datafile/sysaux.258.854939615
+ocr_voting/_mgmtdb/datafile/sysgridhomedata.261.854939891
+ocr_voting/_mgmtdb/datafile/sysmgmtdata.260.854939737
+ocr_voting/_mgmtdb/datafile/system.259.854939661
+ocr_voting/_mgmtdb/datafile/undotbs1.257.854939605
+ocr_voting/_mgmtdb/onlinelog/group_1.263.854940051
+ocr_voting/_mgmtdb/onlinelog/group_2.264.854940053
+ocr_voting/_mgmtdb/onlinelog/group_3.265.854940057
8 rows selected.
The query here is the path of mgmtdb, or you can query directly with the following command:
[Email protected]/]$ Oclumon manage-get Reppath
CHM Repository Path =+ocr_voting/_mgmtdb/datafile/sysmgmtdata.260.854939737
[Email protected]/]$
--Query Mgmtdb users:
Sql> Select Username,account_status fromdba_users where username like ' ch% ';
USERNAME Account_status
------------- ----------------
CHM OPEN
CHA OPEN
--------------------------------------------------------------------------------------------
All rights reserved, the article prohibits reprint, otherwise investigates the legal liability!
Aboutdave:
--------------------------------------------------------------------------------------------
qq:251097186
Email: [email protected]
Blog:http://blog.csdn.net/tianlesoftware
Weibo:http://weibo.com/tianlesoftware
Twitter:http://twitter.com/tianlesoftware
Facebook:http://www.facebook.com/tianlesoftware
Linkedin:http://cn.linkedin.com/in/tianlesoftware
Dave's QQ Group:
--------------------------------------------------------------------------------------------
Note: Add group must indicate tablespace and data file relationship | Do not repeat the addition group
cndba_1:104207940 (Full) cndba_2:62697716 (full) cndba_3:283816689
cndba_4:391125754 cndba_5:62697850 cndba_6:62697977 cndba_7:142216823 (full)
Oracle 12c RAC mgmtdb Description