mgmtdb
Posted 东南风
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mgmtdb相关的知识,希望对你有一定的参考价值。
1.查看mgmt在那个节点上运行
su - grid
[grid@host01 ~]$ oclumon manage -get master
Master = host01
2.查看状态
[grid@host01 ~]$ srvctl status mgmtdb
Database is enabled
Instance -MGMTDB is running on node host01
3.查看配置信息:
[grid@host01 ~]$ srvctl config mgmtdb
Database unique name: _mgmtdb
Database name:
Oracle home: <CRS home>
Oracle user: grid
Spfile: +OCR/_MGMTDB/PARAMETERFILE/spfile.270.1036567143
Password file:
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Type: Management
PDB name: GIMR_DSCREP_10
PDB service: GIMR_DSCREP_10
Cluster name: rac-cluster
Database instance: -MGMTDB
3.登陆mgmtdb
[grid@host01 ~]$$export ORACLE_SID=-MGMTDB
SQL> connect / as sysdba
Connected.
[[grid@host01 ~]$$sqlplus / as sysdba
查看数据文件和redo日志文件
SQL> select file_name from dba_data_files union select member file_name from V$logfile;
FILE_NAME
--------------------------------------------------------------------------------
+OCR/_MGMTDB/DATAFILE/sysaux.259.1036565765
+OCR/_MGMTDB/DATAFILE/system.258.1036565703
+OCR/_MGMTDB/DATAFILE/undotbs1.260.1036565817
+OCR/_MGMTDB/ONLINELOG/group_1.262.1036565893
+OCR/_MGMTDB/ONLINELOG/group_2.263.1036565893
+OCR/_MGMTDB/ONLINELOG/group_3.264.1036566055
6 rows selected.
查看数据库名称
SQL> select name from v$database;
NAME
------------------
_MGMTDB
查看实例名称
SQL> select instance_name from v$instance;
INSTANCE_NAME
--------------------------------
-MGMTDB
查看控制文件
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+OCR/_MGMTDB/CONTROLFILE/current.261.1036565891
SQL> show parameters spfile;
NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
spfile string
+OCR/_MGMTDB/PARAMETERFILE/spfile.270.1036567143
生产pfile文件
SQL> create pfile=‘/tmp/mgmgdb_pfile.txt‘ from spfile;
File created
[root@host01 tmp]# more mgmgdb_pfile.txt
-MGMTDB.__data_transfer_cache_size=0
-MGMTDB.__db_cache_size=717225984
-MGMTDB.__java_pool_size=4194304
-MGMTDB.__large_pool_size=8388608
-MGMTDB.__oracle_base=‘/u01/app/gridbase‘#ORACLE_BASE set from environment
-MGMTDB.__pga_aggregate_target=524288000
-MGMTDB.__sga_target=1073741824
-MGMTDB.__shared_io_pool_size=50331648
-MGMTDB.__shared_pool_size=281018368
-MGMTDB.__streams_pool_size=0
*._awr_restrict_mode=TRUE
*._disable_txn_alert=3
*._kolfuseslf=TRUE
*._partition_large_extents=‘false‘
*.audit_file_dest=‘/u01/app/gridbase/admin/_mgmtdb/adump‘
*.audit_trail=‘NONE‘
*.cluster_database=FALSE
*.compatible=‘12.2.0.0.0‘
*.control_files=‘+OCR/_MGMTDB/CONTROLFILE/current.261.1036565891‘
*.cpu_count=2
*.db_block_size=8192
*.db_create_file_dest=‘+OCR‘
*.db_name=‘_mgmtdb‘
*.diagnostic_dest=‘/u01/app/gridbase‘
*.dispatchers=‘(PROTOCOL=TCP) (SERVICE=-MGMTDBXDB)‘
*.enable_pluggable_database=true
*.job_queue_processes=1
*.max_string_size=‘EXTENDED‘
*.nls_language=‘AMERICAN‘
*.nls_territory=‘AMERICA‘
*.open_cursors=150
*.parallel_min_servers=0
*.pga_aggregate_target=524288000
*.processes=500
*.recyclebin=‘off‘
*.remote_login_passwordfile=‘EXCLUSIVE‘
*.sga_target=1073741824
*.statistics_level=‘TYPICAL‘
*.undo_tablespace=‘UNDOTBS1‘
create pfile=‘/tmp/mgmgdb_pfile.txt‘ from spfile;
查看是否归档
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/app/grid/product/12.2.0/dbs/arch
Oldest online log sequence 1
Current log sequence 3
查看pdb
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 GIMR_DSCREP_10 READ WRITE NO
SQL> show con_name;
CON_NAME
------------------------------
CDB$ROOT
查看表空间
SQL> Select tablespace_name,status From dba_tablespaces;
TABLESPACE_NAME STATUS
------------------------------------------------------------ ------------------
SYSTEM ONLINE
SYSAUX ONLINE
UNDOTBS1 ONLINE
TEMP ONLINE
查看临时表空间文件
SQL> Select file_name From dba_temp_files;
FILE_NAME
----------------------------------------------------------------------------------------------------
+OCR/_MGMTDB/TEMPFILE/temp.265.1036566355
查看用户
SQL> column username format a16;
SQL> column account_status format a16;
SQL> Select username,account_status From Dba_Users;
USERNAME ACCOUNT_STATUS
---------------- ----------------
SYS OPEN
SYSTEM OPEN
GSMCATUSER EXPIRED & LOCKED
XS$NULL EXPIRED & LOCKED
REMOTE_SCHEDULER EXPIRED & LOCKED
_AGENT
SYSBACKUP EXPIRED & LOCKED
GSMUSER EXPIRED & LOCKED
SYSRAC EXPIRED & LOCKED
AUDSYS LOCKED
USERNAME ACCOUNT_STATUS
---------------- ----------------
DIP EXPIRED & LOCKED
SYSKM EXPIRED & LOCKED
OUTLN EXPIRED & LOCKED
ORACLE_OCM EXPIRED & LOCKED
SYS$UMF EXPIRED & LOCKED
SYSDG EXPIRED & LOCKED
DBSNMP EXPIRED & LOCKED
APPQOSSYS EXPIRED & LOCKED
DBSFWUSER EXPIRED & LOCKED
GGSYS EXPIRED & LOCKED
ANONYMOUS EXPIRED & LOCKED
USERNAME ACCOUNT_STATUS
---------------- ----------------
GSMADMIN_INTERNA EXPIRED & LOCKED
L
XDB EXPIRED & LOCKED
WMSYS EXPIRED & LOCKED
23 rows selected.
查看表空间使用情况
SQL> set linesize 1000;
SQL> Select a.Tablespace_Name,
2 to_char(Round(Total, 2),‘fm9999990.0999‘) || ‘G‘ Total,
3 to_char(Round(Free, 2),‘fm9999990.0999‘) || ‘G‘ Free,
4 to_char(Round(Total - Free, 2),‘fm9999990.0999‘) || ‘G‘ Used
5 From (Select Tablespace_Name,sum(t.BYTES)/1024/1024/1024 As Total
6 From Dba_Data_Files t Group By Tablespace_Name
7 ) a,
8 (Select Tablespace_Name, Sum(Bytes) / 1024 / 1024 / 1024 Free
9 From Dba_Free_Space group By Tablespace_Name
10 ) b
11 Where a.Tablespace_Name = b.Tablespace_Name
12 Order By Total Desc;
TABLESPACE_NAME TOTAL FREE USED
-------------------------------- ---------------------------- ---------------------------- ----------------------------
SYSTEM 0.59G 0.17G 0.42G
SYSAUX 0.39G 0.09G 0.3G
UNDOTBS1 0.09G 0.02G 0.06G
-- The End --
以上是关于mgmtdb的主要内容,如果未能解决你的问题,请参考以下文章