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

目录
相关文章
|
8月前
|
Linux 应用服务中间件 Shell
二、Linux文本处理与文件操作核心命令
熟悉了Linux的基本“行走”后,就该拿起真正的“工具”干活了。用grep这个“放大镜”在文件里搜索内容,用find这个“探测器”在系统中寻找文件,再用tar把东西打包带走。最关键的是要学会使用管道符|,它像一条流水线,能把这些命令串联起来,让简单工具组合出强大的功能,比如 ps -ef | grep 'nginx' 就能快速找出nginx进程。
877 1
二、Linux文本处理与文件操作核心命令
|
8月前
|
Linux
linux命令—stat
`stat` 是 Linux 系统中用于查看文件或文件系统详细状态信息的命令。相比 `ls -l`,它提供更全面的信息,包括文件大小、权限、所有者、时间戳(最后访问、修改、状态变更时间)、inode 号、设备信息等。其常用选项包括 `-f` 查看文件系统状态、`-t` 以简洁格式输出、`-L` 跟踪符号链接,以及 `-c` 或 `--format` 自定义输出格式。通过这些选项,用户可以灵活获取所需信息,适用于系统调试、权限检查、磁盘管理等场景。
496 137
|
8月前
|
安全 Ubuntu Unix
一、初识 Linux 与基本命令
玩转Linux命令行,就像探索一座新城市。首先要熟悉它的“地图”,也就是/根目录下/etc(放配置)、/home(住家)这些核心区域。然后掌握几个“生存口令”:用ls看周围,cd去别处,mkdir建新房,cp/mv搬东西,再用cat或tail看文件内容。最后,别忘了随时按Tab键,它能帮你自动补全命令和路径,是提高效率的第一神器。
1353 58
|
11月前
|
JSON 自然语言处理 Linux
linux命令—tree
tree是一款强大的Linux命令行工具,用于以树状结构递归展示目录和文件,直观呈现层级关系。支持多种功能,如过滤、排序、权限显示及格式化输出等。安装方法因系统而异常用场景包括:基础用法(显示当前或指定目录结构)、核心参数应用(如层级控制-L、隐藏文件显示-a、完整路径输出-f)以及进阶操作(如磁盘空间分析--du、结合grep过滤内容、生成JSON格式列表-J等)。此外,还可生成网站目录结构图并导出为HTML文件。注意事项:使用Tab键补全路径避免错误;超大目录建议限制遍历层数;脚本中推荐禁用统计信息以优化性能。更多详情可查阅手册mantree。
931 143
linux命令—tree
|
7月前
|
存储 安全 Linux
Linux卡在emergency mode怎么办?xfs_repair 命令轻松解决
Linux虚拟机遇紧急模式?别慌!多因磁盘挂载失败。本文教你通过日志定位问题,用`xfs_repair`等工具修复文件系统,三步快速恢复。掌握查日志、修磁盘、验重启,轻松应对紧急模式,保障系统稳定运行。
1214 2
|
8月前
|
Unix Linux 程序员
Linux文本搜索工具grep命令使用指南
以上就是对Linux环境下强大工具 `grep` 的基础到进阶功能介绍。它不仅能够执行简单文字查询任务还能够处理复杂文字处理任务,并且支持强大而灵活地正则表达规范来增加查询精度与效率。无论您是程序员、数据分析师还是系统管理员,在日常工作中熟练运用该命令都将极大提升您处理和分析数据效率。
643 16
|
8月前
|
缓存 监控 Linux
Linux内存问题排查命令详解
Linux服务器卡顿?可能是内存问题。掌握free、vmstat、sar三大命令,快速排查内存使用情况。free查看实时内存,vmstat诊断系统整体性能瓶颈,sar实现长期监控,三者结合,高效定位并解决内存问题。
744 0
Linux内存问题排查命令详解
|
10月前
|
监控 Linux 网络安全
Linux命令大全:从入门到精通
日常使用的linux命令整理
1557 13
|
11月前
|
Linux 网络安全 数据安全/隐私保护
使用Linux系统的mount命令挂载远程服务器的文件夹。
如此一来,你就完成了一次从你的Linux发车站到远程服务器文件夹的有趣旅行。在这个技术之旅中,你既探索了新地方,也学到了如何桥接不同系统之间的距离。
1819 21
|
11月前
|
监控 Linux
Linux系统中使用df命令详解磁盘使用情况。
`df`命令是Linux系统管理员和用户监控和管理磁盘空间使用的重要工具。掌握它的基本使用方法和选项可以帮助在必要时分析和解决空间相关问题。简洁但功能丰富,`df`命令确保了用户可以快速有效地识别和管理文件系统的空间使用情况。
743 13