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

简介: [20161229]linux下使用oclumon命令(rac).txt --11G RAC下grid 存在一个命令oclumon可以了解监测群集健康.简单了解一下. 1.

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

目录
相关文章
|
29天前
|
Linux 网络安全 数据安全/隐私保护
Linux 超级强大的十六进制 dump 工具:XXD 命令,我教你应该如何使用!
在 Linux 系统中,xxd 命令是一个强大的十六进制 dump 工具,可以将文件或数据以十六进制和 ASCII 字符形式显示,帮助用户深入了解和分析数据。本文详细介绍了 xxd 命令的基本用法、高级功能及实际应用案例,包括查看文件内容、指定输出格式、写入文件、数据比较、数据提取、数据转换和数据加密解密等。通过掌握这些技巧,用户可以更高效地处理各种数据问题。
75 8
|
29天前
|
监控 Linux
如何检查 Linux 内存使用量是否耗尽?这 5 个命令堪称绝了!
本文介绍了在Linux系统中检查内存使用情况的5个常用命令:`free`、`top`、`vmstat`、`pidstat` 和 `/proc/meminfo` 文件,帮助用户准确监控内存状态,确保系统稳定运行。
217 6
|
1月前
|
Linux
在 Linux 系统中,“cd”命令用于切换当前工作目录
在 Linux 系统中,“cd”命令用于切换当前工作目录。本文详细介绍了“cd”命令的基本用法和常见技巧,包括使用“.”、“..”、“~”、绝对路径和相对路径,以及快速切换到上一次工作目录等。此外,还探讨了高级技巧,如使用通配符、结合其他命令、在脚本中使用,以及实际应用案例,帮助读者提高工作效率。
77 3
|
1月前
|
监控 安全 Linux
在 Linux 系统中,网络管理是重要任务。本文介绍了常用的网络命令及其适用场景
在 Linux 系统中,网络管理是重要任务。本文介绍了常用的网络命令及其适用场景,包括 ping(测试连通性)、traceroute(跟踪路由路径)、netstat(显示网络连接信息)、nmap(网络扫描)、ifconfig 和 ip(网络接口配置)。掌握这些命令有助于高效诊断和解决网络问题,保障网络稳定运行。
71 2
|
12天前
|
Linux Shell
Linux 10 个“who”命令示例
Linux 10 个“who”命令示例
40 14
Linux 10 个“who”命令示例
|
1天前
|
Ubuntu Linux
Linux 各发行版安装 ping 命令指南
如何在不同 Linux 发行版(Ubuntu/Debian、CentOS/RHEL/Fedora、Arch Linux、openSUSE、Alpine Linux)上安装 `ping` 命令,详细列出各发行版的安装步骤和验证方法,帮助系统管理员和网络工程师快速排查网络问题。
34 20
|
1天前
|
网络协议 Linux 应用服务中间件
kali的常用命令汇总Linux
kali的常用命令汇总linux
20 7
|
21天前
|
Linux 数据库
Linux中第一次使用locate命令报错?????
在Linux CentOS7系统中,使用`locate`命令时出现“command not found”错误,原因是缺少`mlocate`包。解决方法是通过`yum install mlocate -y`或`apt-get install mlocate`安装该包,并执行`updatedb`更新数据库以解决后续的“can not stat”错误。
31 9
|
19天前
|
监控 网络协议 Linux
Linux netstat 命令详解
Linux netstat 命令详解
|
25天前
|
运维 监控 网络协议
运维工程师日常工作中最常用的20个Linux命令,涵盖文件操作、目录管理、权限设置、系统监控等方面
本文介绍了运维工程师日常工作中最常用的20个Linux命令,涵盖文件操作、目录管理、权限设置、系统监控等方面,旨在帮助读者提高工作效率。从基本的文件查看与编辑,到高级的网络配置与安全管理,这些命令是运维工作中的必备工具。
89 3