博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
oracle Active Session History (ASH)
阅读量:6443 次
发布时间:2019-06-23

本文共 4090 字,大约阅读时间需要 13 分钟。

hot3.png

-----
5.1.1.3 Active Session History (ASH)
The V$ACTIVE_SESSION_HISTORY view provides sampled session activity in the instance. Active sessions are sampled every second and are stored in a circular buffer in SGA. Any session that is connected to the database and is waiting for an event that does not belong to the Idle wait class is considered as an active session. This includes any session that was on the CPU at the time of sampling.
Each session sample is a set of rows and the V$ACTIVE_SESSION_HISTORY view returns one row for each active session per sample, returning the latest session sample rows first.Because the active session samples are stored in a circular buffer in SGA, the greater the system activity, the smaller the number of seconds of session activity that can be stored in the circular buffer. This means that the duration for which a session sample appears in the V$ view, or the number of seconds of session activity that is displayed in the V$ view, is completely dependent on the database activity.
As part of the Automatic Workload Repository (AWR) snapshots, the content of V$ACTIVE_SESSION_HISTORY is also flushed to disk. Because the content of this V$ view can get quite large during heavy system activity, only a portion of the session samples is written to disk.
By capturing only active sessions, a manageable set of data is represented with the size being directly related to the work being performed rather than the number of sessions allowed on the system. Using the Active Session History enables you to examine and perform detailed analysis on both current data in the V$ACTIVE_SESSION_HISTORY view and historical data in the DBA_HIST_ACTIVE_SESS_HISTORY view, often avoiding the need to replay the workload to gather additional performance tracing information.
10g and above Active Session History (Ash) And Analysis Of Ash Online And Offline [ID 243132.1]
-----
The flushing and purging policies of ASH, including the way ASH respects SWRF baselines, are
completely tied with SWRF policies. Still, flushing the entire content of ASH on to disk could be too
populous to be feasible, and therefore, only one out of every ten active session samples will be flushed to
disk. 
The ASH infrastructure will provide a single V$ view (V$ACTIVE_SESSION_HISTORY), to view the in-memory
contents of ASH. The ASH infrastructure will also provide a way to dump the in-memory contents of its circular
buffer onto an external file in a human readable format. The ASH dump file can be transported to another system,
imported onto a user table, and analyzed using the ADDM in that system.
ASH Memory Size
==============
Size of ASH Circular Buffer = Max [Min [ #CPUs * 2 MB, 5% of Shared Pool Size, 30MB ], 1MB ]
Let start with ONLINE analysis
======================== 
Lets check the info in V$ACTIVE_SESSION_HISTORY. 
Lets do the OFFLINE analysis of ASH
============================== 
Command would be like below: where level means minute. lets dump for 10 minutes history
1. SQL> alter session set events 'immediate trace name ashdump level 10';
or
2. SQL> alter system set events 'immediate trace name ashdump level 10';
or
3. SQL> oradebug setmypid
    SQL> oradebug dump ashdump 10;
So you will get the trace file in udump.
Oracle has provide an utility under $ORACLE_HOME/rdbms/demo  (Location may change), by which you can
upload the ASH trace dump to a database table and do the analysis.
Please see the following Note
Note 555303.1 ashdump* scripts and post-load processing of MMNL traces
for the scripts.
Script Details
============
1. "ashdump_loader"     -> Main script to run with one argument. Argument is the the name of tracefile. (available in 10g only)
2. "ashdump_table.sql"  -> It would be called by the main script to create the table
   called SYSTEM.ACTIVE_SESSION_HISTORY_DUMP.
3. "ashdump_sqlldr.ctl" -> It is the third script called by main script to load the trace into
   table called SYSTEM.ACTIVE_SESSION_HISTORY_DUMP.
You must use the same oracle version to compare the OFFLINE trace with the other view.

转载于:https://my.oschina.net/zhiyonghe/blog/913923

你可能感兴趣的文章
python3导入paramiko模块
查看>>
软件项目送上门来了,还要学会说"不",接了项目拿了定金噩梦才刚刚开始
查看>>
循环、迭代、遍历和递归
查看>>
忘记mysql的root密码
查看>>
使用JavaScript 和 CSS 实现图像缩放和剪裁(转)
查看>>
我的友情链接
查看>>
Code Kata 5
查看>>
RHCE_LAB(4)GRUB提升安全性保护root密码安全
查看>>
Zabbix实现微信平台报警----基于zabbix3.0.4
查看>>
android 安全讲座第二层 使用AndBug调试Android Java Bytecode
查看>>
css3 Gradients 线性渐变
查看>>
ucfirst() 函数
查看>>
bootstrap-导航条层次的导航
查看>>
git rm使用
查看>>
xss***代码
查看>>
Python学习网站
查看>>
mybatis基础(一)
查看>>
Python的Django框架中的Context使用
查看>>
我的友情链接
查看>>
linux常用命令
查看>>