ORATOP工具使用说明

原文地址:https://www.cnblogs.com/david-zhang-index/p/5209976.html

ORATOP

 

前言:
隨著PC Server的規格及速度愈來愈快,大多數的公司摒棄大型主機,進而選擇PC Server的趨勢愈來愈盛,雖然在可靠度上仍然是大型主機占優勢,但是大型主機的維護費用高昂,這也是讓一般公司望之卻步的主要因素。
在目前PC Server的可靠度尚待提升的當下,其實,Virtual Machine的選擇可以彌補PC Server可靠度的不足,目前三大虛擬平台逐漸成形,分別是Vmware、Hyper-V以及Oracle VM。
如果各位使用PC Server,將Oracle Database安裝在PC Server上,大概就只有Linux可以選擇了。Linux上面要即時監控系統狀況,"top" 指令是系統管理員常用的,但是我們使用 "top" 找到了 Top Process之後,往往還需要將Process ID轉換成Database SID,才能找出關鍵性的Session,進而解決效能問題,不過,Oracle最近有一項工具叫做 "oratop",可以及時監控Linux上的Database Process狀況,讓系統管理員省去不少時間,找出 Top Session。

目的:
oratop是類似 top 的工具,可以針對Oracle Database Performance做全面性的檢視,如果搭配 top 使用,會得到更完整的系統效能資訊。

適用版本:
Oracle Database - Enterprise Edition - Version 11.2.0.3 to 11.2.0.4 [Release 11.2]
Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Linux x86-64
Linux x86

使用方式:
1. 使用oracle 使用者將下載的oratop.RDBMS_11.2_LINUX_X64  ftp 到資料庫主機上,如果是RAC環境,選定其中一個node上傳即可。
2. cd 到 oratop 程式所在目錄
3. 更名oratop程式

  1. $ mv oratop* oratop

4. 更改oratop權限

  1. $ chmod 755 oratop

5. 在.bash_profile 環境變數檔中,設定環境變數(如果尚未設定的話)

  1. $ export TERM=xterm  #or vt100

    $ export ORACLE_HOME=<11.2 database home>

    $ export LD_LIBRARY_PATH=$ORACLE_HOME/lib

    $ export PATH=$ORACLE_HOME/bin:$PATH

    $ export ORACLE_SID=<local 11.2 database SID to be monitored>  #only needed if connecting to a local database

6. 執行oratop (每10秒更新一次)

  1. $ ./oratop -i 10 / as sysdba

7. 針對遠端資料庫執行oratop (每10秒更新一次)

  1. $ ./oratop -i 10 system/manager@tns_alias

     

8. 結束oratop
    按下 "q",或是 CTRL-C

參考畫面:


指令介紹:
1. 語法

  1. $ oratop [Options] [Logon]

2. Options
    a) Help,Displays usage or output information.
        預設: N/A

  1. $ oratop -h[elp]  # runtime mode 按下h

    b) Top 5 Wait Events
        預設: 累計
        選項: 即時呈現

  1. $ oratop -d  # runtime mode 按下d

    c) 等待物件
        預設: Event/Latch
        選項: File#:Block#

  1. $ oratop -k  # runtime mode 按下k

    d) session行為
        預設: 是Username/Program
        選項: 是Module/Action

  1. $ oratop -m  # runtime mode 按下m

    e) SQL mode
        預設: Process mode
        選項: SQL display

  1. $ oratop -s  # runtime mode 按下s

    f) Database Service centric mode
        預設: Connection mode
        選項: N/A

  1. $ oratop -c  # runtime mode:N/A

    g) Long format, (132 columns)
        預設:  short (80 columns)
        選項:  long format for header & process section.

  1. $ oratop -f  # runtime mode: 按下f

    h) Database Process mode
        預設:  Process mode
        選項: process display

  1. $ oratop -p  # runtime mode: 按下p

    i) Batch mode operation
        預設: Text-based user interface
        選項: N/A

  1. $ oratop -b  # runtime mode: N/A

    j) Maximum Number of iterations.   (requires a number)
        預設: infinite
        選項: the maximum number of iterations, or frames

  1. $ oratop -n  # runtime mode: N/A

   k)  Displays tablespace information
        預設: N/A
        選項: tablespace information

  1. # runtime mode: 按下t

    l) Displays  ASM diskgroup information.  (no op for non-ASM)
        預設: N/A
        選項: ASM diskgroup information

  1. # runtime mode: 按下a

    l) Displays SQL execution plan table. Requires input of the active SQL sql_id value
        預設: 5 seconds
        選項: the delay between update refresh

  1. $ oratop -c  # runtime mode: 按下

    m) Interval delay time. ( requires value in seconds)
         預設: Connection mode
         選項: N/A

  1. $ oratop -v  # runtime mode: N/A


參考文件:
oratop - Utility for Near Real-time Monitoring of Databases, RAC and Single Instance (Doc ID 1500864.1)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值