[20161229]linux下使用oclumon命令(rac)

lfree發表於2016-12-29

[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
....

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

相關文章