[20161229]linux下使用oclumon命令(rac).txt
--11G RAC下grid 存在一个命令oclumon可以了解监测群集健康.简单了解一下.
1.环境:
SYS@+ASM1> select * from v$version where rownum<=1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
$ oclumon version
Cluster Health Monitor (OS), Version 11.2.0.4.0 - Production Copyright 2011 Oracle. All rights reserved.
-//真不知道为什么这样命名这个命令, o表示oracle,clu表示cluster. mon表示monitor.我的理解不知道是否正确.
2.测试与学习:
$ oclumon -h
For help from command line : oclumon <verb> -h
For help in interactive mode : <verb> -h
Currently supported verbs are :
showobjects, dumpnodeview, manage, version, debug, quit, exit, and help
--//这里verb我开始理解错误,以为是版本,实际上表示动词或者动作的意思.也就是你要看某个命令打入 oclumon showobjects -h.
$ oclumon version
Cluster Health Monitor (OS), Version 11.2.0.4.0 - Production Copyright 2011 Oracle. All rights reserved.
$ oclumon showobjects
Following nodes are attached to the loggerd
dm01dbadm01
dm01dbadm02
$ oclumon manage -h
MANAGE verb usage
=================
manage [[-repos {resize <time>|changesize <memsize>|reploc <new_loc> [[-maxtime <time>]|
[-maxspace <memsize>]] }]|[-get <key1> <key2>..]]
*Where
-repos = Required to specify Cluster Health Monitor repository related options
-get = Fetch manage information for one or more named keys
<key1> <key2>= <key> can be repsize, reppath, master, and replica
resize = Option for resizing Cluster Health Monitor repository
<time> = Size of Cluster Health Monitor repository in number of seconds
must be more than 3600 (1 hour) and less than 259200 (3 days)
changesize = Option for Change Cluster Health Monitor repository space limit
<memsize> = Size of Cluster Health Monitor repository in megabytes
reploc = Option for Change Repository Location
<new_loc> = Path to new directory e.g.: /opt/db
-maxtime = Option to specify Cluster Health Monitor repository size in terms of elapsed seconds of data capture for new location
-maxspace = Option to specify space limit for new Cluster Health Monitor repository location
*Requirements
The local system monitor service must be running to resize the Cluster Health Monitor repository.
The Cluster Logger Service must be running to resize Cluster Health Monitor repository.
*Example :
manage -get MASTER REPLICA
manage -repos resize 86400
manage -repos changesize 6000
manage -repos reploc /opt/oracrfdb
manage -repos reploc /opt/oracrfdb -maxtime 86400
manage -repos reploc /opt/oracrfdb -maxspace 6000
--//这个有点复杂,不敢乱用.语法怪怪的!!resize后面的应该是指时间长短. changesize后面的应该是大小.测试一下get什么意思..
-get = Fetch manage information for one or more named keys
<key1> <key2>= <key> can be repsize, reppath, master, and replica
--//仅仅支持后面4个参数repsize, reppath, master, and replica.看测试例子不区分大小写.
$ oclumon manage -get MASTER REPLICA
Master = dm01dbadm01
Replica = dm01dbadm02
Done
$ oclumon manage -get repsize reppath master replica
CHM Repository Path = /u01/app/11.2.0.4/grid/crf/db/dm01dbadm01
CHM Repository Size = 61511
Master = dm01dbadm01
Replica = dm01dbadm02
Done
--剩下dumpnodeview命令,推测应该是从CHM Repository Path = /u01/app/11.2.0.4/grid/crf/db/dm01dbadm01目录取信息.
$ cd /u01/app/11.2.0.4/grid/crf/db/dm01dbadm01
$ ls -l
total 254604
-rw-r--r-- 1 root root 1075900 2014-10-10 21:02:53 10-OCT-2014-21:02:53.txt
-rw-r--r-- 1 root root 1755175 2014-12-11 02:54:44 11-DEC-2014-02:54:44.txt
-rw-r--r-- 1 root root 1229318 2014-12-11 03:02:22 11-DEC-2014-03:02:22.txt
-rw-r--r-- 1 root root 2345265 2014-10-11 16:59:07 11-OCT-2014-16:59:07.txt
-rw-r--r-- 1 root root 1695640 2014-10-11 17:00:56 11-OCT-2014-17:00:56.txt
-rw-r--r-- 1 root root 1989345 2014-11-19 18:01:01 19-NOV-2014-18:01:01.txt
-rw-r--r-- 1 root root 1407927 2014-11-19 18:08:57 19-NOV-2014-18:08:57.txt
-rw-r----- 1 root root 7053312 2016-12-29 10:39:38 crfalert.bdb
-rw-r----- 1 root root 186449920 2016-12-29 10:39:38 crfclust.bdb
-rw-r----- 1 root root 8192 2014-12-11 03:02:22 crfconn.bdb
-rw-r----- 1 root root 11829248 2016-12-29 10:39:38 crfcpu.bdb
-rw-r----- 1 root root 5398528 2016-12-29 10:39:38 crfhosts.bdb
-rw-r----- 1 root root 4239360 2016-12-29 10:39:38 crfloclts.bdb
-rw-r----- 1 root root 5038080 2016-12-29 10:39:38 crfts.bdb
-rw-r----- 1 root root 24576 2014-12-11 02:54:43 __db.001
-rw-r----- 1 root root 401408 2016-12-29 10:40:23 __db.002
-rw-r----- 1 root root 2629632 2016-12-29 10:40:25 __db.003
-rw-r----- 1 root root 2162688 2016-12-29 10:40:25 __db.004
-rw-r----- 1 root root 1187840 2016-12-29 10:40:23 __db.005
-rw-r----- 1 root root 57344 2016-12-29 10:39:58 __db.006
-rw-r--r-- 1 root root 120000000 2016-12-29 10:08:26 dm01dbadm01.ldb
-rw-r----- 1 root root 16777216 2016-12-29 10:25:03 log.0000033985
-rw-r----- 1 root root 16777216 2016-12-29 10:39:38 log.0000033986
-rw-r----- 1 root root 8192 2014-12-11 02:54:43 repdhosts.bdb
--//视乎是一些类似数据库的信息.
$ oclumon dumpnodeview -h
dumpnodeview verb usage
=======================
The dumpnodeview command reports monitored records in the text format. The
collection of metrics for a node at a given point in time (a timestamp) is
called a node view.
* Usage
dumpnodeview [[-allnodes|-n <node1> ...] [-last <duration>|
-s <timestamp> -e <timestamp>][-v][-warning]]
*Where
-n <node1> ... = Dump node views for given nodes
-allnodes = Dump node views for all nodes
-s <timestamp> = Specify start time for range dump of node views
-e <timestamp> = Specify end time for range dump of node views
Absolute timestamp should be in "YYYY-MM-DD HH24:MI:SS"
format, for example "2007-11-12 23:05:00"
-warning = Print node views with warnings only
-last <duration> = Dump the latest node views for a specified duration
Duration should be in "HH24:MI:SS" format, for example
"00:45:00"
-v = Dump verbose node views
*Requirements and notes
To stop continuous display, use Ctrl-C on Linux or UNIX and Esc on Windows.
-s and -e need to be given together for range dumps of node views.
The local System Monitor Service (osysmond) should be running to get dumps.
The Cluster Logger Service (ologgerd) should be running to get dumps.
When -warning is used in continuous mode, the prompt waits until interrupted.
*Defaults :
Mode : Continuous mode
*Example :
oclumon dumpnodeview -n node1 node2 node3 -last "12:00:00"
$ oclumon dumpnodeview -n dm01dbadm01 dm01dbadm02 -last "12:00:00"
--输出1堆信息.
$ oclumon dumpnodeview -n dm01dbadm01 dm01dbadm02 -last "00:01:00" > aa.txt
.. //看不懂
3.可以支持交互模式.直接输入oclumon.
$ oclumon
query> version
Cluster Health Monitor (OS), Version 11.2.0.4.0 - Production Copyright 2011 Oracle. All rights reserved.
query> help
For help from command line : oclumon <verb> -h
For help in interactive mode : <verb> -h
Currently supported verbs are :
showobjects, dumpnodeview, manage, version, debug, quit, exit, and help
query> showobjects
Following nodes are attached to the loggerd
dm01dbadm01
dm01dbadm02
--//这个模式更上面区别不大.
4.补充oclumon showobjects:
]$ oclumon showobjects -h
showobjects verb usage
======================
showobjects [[-allnodes]|[-n <node> [[-disk]|[-proc]|[-nic]]]][-time <time> [-b <band>]]
*Where
-n = Show objects for given node
<node> = Node name for which objects need to be shown
-time = Time at which objects are required
<time> = Absolute time to be specified within quotes in
"YYYY-MM-DD HH24:MI:SS" format, like "2007-11-12 23:05:00"
-disk = To request list of disks
-nic = To request list of network interface cards
-proc = To request list of processes
-allnodes = Shows all the nodes which can be queried
-b = For specifying maximum look up around <time> in seconds
<band> = Size of band in seconds
*Requirements
Local System Monitor Service should be running to get objects.
Master loggerd should be running to get objects.
*Defaults :
Time : Current
Option : -allnodes
*Example :
showobjects -n stadn59 -disk -time "2008-02-20 02:01:48"
--//例子: -n 仅仅能输入1个节点,不能输入多个.后面的参数disk,nic,proc也是一样
$ oclumon showobjects -n dm01dbadm02 -disk -time '2016-12-29 10:00:00'
List of disks on dm01dbadm02
dm-3
dm-2
dm-1
dm-0
sda
sda3
sda2
sda1
$ oclumon showobjects -n dm01dbadm02 -nic -time '2016-12-29 10:00:00'
List of nics on dm01dbadm02
lo
eth0
eth3
ib0
ib1
bondeth0
$ oclumon showobjects -n dm01dbadm02 -proc -time '2016-12-29 10:00:00'
List of processes on dm01dbadm02
105939 oracledben2
20101 java
16733 osysmond.bin
106595 oracledben2
43515 top
23410 ora_lck0_dbcn2
14171 oracledben2
23223 ora_dia0_dbcn2
23205 ora_vktm_dbcn2
25557 ora_dia0_dben2
25541 ora_vktm_dben2
21219 asm_vktm_+ASM2
15234 oracledben2
40031 oracledben2
21988 tnslsnr
106125 oracledben2
23257 ora_lgwr_dbcn2
16815 ocssd.bin
16720 orarootagent.bi
23234 ora_lms1_dbcn2
23230 ora_lms0_dbcn2
22569 oraagent.bin
22020 tnslsnr
....