在linux 6 之后,建议使用dstat监控操作系统的各项指标。
https://download.csdn.net/download/zengxiangbo/89601165
详见文章关联附件。
Oracle脚本工具,查看数据库性能情况,查看当前数据库会话情况
国外大神写的脚本
可以到Tanel Poder Consulting 网站下载
An easy to use Oracle session-level performance measurement tool which does NOT require any database changes nor creation of any database objects!
@snapper.sql 5 做一次快照,间隔时间是5s,snapper.sql 详见文章关联附件。
-- NB! Read the online examples, these are more detailed and list script output too!
-- http://tech.e2sn.com/oracle-scripts-and-tools/session-snapper
-- (Output one 1-second snapshot of session 515 using dbms_output and exit
-- Wait, gv$sesstat and gv$sess_time_model statistics are reported by default
-- Starting from V3 the ASH style session activity report is shown as well)
-- @snapper stats,gather=w 1 1 515
-- (Output one 1-second snapshot of session 515 using dbms_output and exit
-- only Wait event statistics are reported, no ASH)
-- @snapper ash,gather=st 1 1 515
-- (Output one 1-second snapshot of session 515 using dbms_output and exit
-- only gv$sesstat and gv$sess_Time_model statistics are gathered + ASH)
-- @snapper trace,ash,gather=stw,pagesize=0 10 90 117,210,313
-- (Write 90 10-second snapshots into tracefile for session IDs 117,210,313
-- all statistics are reported, do not print any headers)
-- @snapper trace,ash 900 999999999 all
-- (Take a snapshot of ALL sessions every 15 minutes and write the output to trace,
-- @snapper out,trace 300 12 "select inst_id,sid from gv$session where username='APPS'"
-- (Take 12 5-minute snapshots of all sessions belonging to APPS user, write
-- output to both dbms_output and tracefile)
@snapper "stats,gather=s,sinclude=redo size" 3 1 all
@snapper "stats,gather=t,tinclude=DB Time" 3 1 all
这是oracle官方提供的一个脚本,需要根据数据库版本下载对应的oratop版本。
{username[/password][@connect_identifier] | / }
o Easy Connect (host[:port]/[service_name])
-d : real-time (RT) wait events, section 3 (default is Cumulative)
-k : FILE#:BLOCK#, section 4 lt is (EVENT/LATCH)
-m : MODULE/ACTION, section 4 (default is USERNAME/PROGRAM)
-s : SQL mode, section 4 (default is process mode)
-c : database service mode (default is connect string)
-f : detailed format, 132 columns (default: standard, 80 columns)
-b : batch mode (default is text-based user interface)
-n : maximum number of iterations (requires number)
-i : interval delay, requires value in seconds (default: 5s)
-v : oratop release version number
在11.2.0.4之后的版本中,oracle已经自带这个脚本。
用于收集ash统计信息
比如:收集2小时前开始的ash,总共收集1小时,按照每2分钟分类展示。
具体等待事件分类,一般在ash_total.sql后使用。
第三个参数:等待事件,比如 on cpu,根据@ash_total.sql的结果中最多的分类
启动数据库
https://download.csdn.net/download/zengxiangbo/89601185