返回顶部

欢迎来到菜鸟大明儿哥的博客

我们一起交流学习,不断提升自我

Oracle轻量级实时监控工具---oratop

 

一、Oratop工具简述

 

Oratop源自MOS的一篇文章和工具链接(oratop - utility for near real-time monitoring of databases, RAC and Single Instance [ID 1500864.1])。从名称上看,Oratop最大特点是支持实时轻量级监控。在Oracle 12c的EM Express之前,OEM还是一个重体积的组件。相比之下,oratop完全适合那些想使用数据库实时监控功能,但是又不愿意启动OEM的用户需要。适用于Oracle单机、RAC和ADG。

 

Oratop主要有三大特点:

1. 监控当前的数据库活动

2. 监控数据库性能

3. 识别当前阻塞会话和瓶颈会话

 

二、软件安装(注意要区分32位版和64位版)

1.操作系统信息

cat /etc/issue 或 uname -a

[root@erptest2 ~]# uname -a
Linux erptest2 2.6.32-696.20.1.el6.x86_64 #1 SMP Fri Jan 12 15:07:59 EST 2018 x86_64 x86_64 x86_64 GNU/Linux

 

2.创建软件路径(无需安装)

mkdir /oratop

chown -R oracle:oinstall /oratop

默认安装oracle 客户端后,程序存放在$ORACLE_HOME/suptools/oratop下

 

[oracle@erptest2 ~]$ vim .bash_profile
export ORACLE_SID=testdb
#export PATH=$ORACLE_HOME/bin:$PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/suptools/oratop:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

 

 

三、软件的使用

1.参数介绍

oratop –h

 

oratop: Release 14.2.1

Usage:

    oratop [ [Options] [Logon] ]

 

    Logon:

      {username[/password][@connect_identifier] | / }

      [AS SYSDBA]

 

      connect_identifier:

           o Net Service Name, (TNS) or

           o Easy Connect (host[:port]/[service_name])

    Options:

        -d : real-time (RT) wait events. (section 3, default: Cumulative)   实时统计

        -k : FILE#:BLOCK# column. (section 4, process mode, defaut: EVENT/LATCH)

        -m : MODULE/ACTION column. (section 4, process mode, default: USERNAME/PROGRAM)

        -s : SQL mode. (section 4, default: process mode) SQL模式

        -c : database service mode. (default: connect string) 

        -f : detailed format, 132 columns. (default: standard, 80 columns)  详细格式

        -b : batch mode. (default is text-based user interface)  批量运行模式

实时数据如果需要输入到一个结果集合文件,供下一步处理使用,可以使用b模式参数。当设置b参数之后,oratop会持续运行,或者在事先设计好的次数后结束。

        -n : maximum number of iterations. (requires number)  最大迭代操作次数

        -i : interval delay, requires value in seconds. (default: 5s)   刷新间隔时间(秒)

        -v : oratop release oraversion number

        -h : this help

 

例:oratop -i 5 -b -d / as sysdba

 

2.四种显示模式

1:全局数据库信息Section 1 DATABASE: Global database information

2:数据库实例信息Section 2 INSTANCE: Database instance Activity

3:类似 AWR 中的前五等待事件Section 3 EVENT: AWR like “Top 5 Timed Events“

4:进程或 SQL 信息

Section 4 PROCESS | SQL: Processes or SQL mode information

 

3.软件实际使用

[oracle@erptest2 oratop]$ ./oratop

 

oratop: Release 14.2.1 Production on Wed Mar 31 15:24:59 2021

Copyright (c) 2011, Oracle.  All rights reserved.

 

Connecting ...

 

oratop: Release 14.2.1 Production on Wed Mar 31 15:24:59 2021

Copyright (c) 2011, Oracle.  All rights reserved.

 

Enter username: / as sysdba

 

按f键显示长格式

 

 

 

 

 

posted @ 2021-03-31 16:16  菜鸟大明儿哥  阅读(911)  评论(0编辑  收藏  举报