ash是非常有效的监控工具之一,1秒抓一次select max(sample_time)over(),min(sample_time)over() from dba_hist_active_sess_history; --8天 select max(sample_time)over(),min(sample_time)over() from v$active_session_history; --当天首先先了解几个视
ash是非常有效的监控工具之一,1秒抓一次 select max(sample_time)over(),min(sample_time)over() from dba_hist_active_sess_history; --8天 select max(sample_time)over(),min(sample_time)over() from v$active_session_history; --当天 首先先了解几个视图: V$ACTIVE_SESSION_HISTORY: 是ASH的核心,用以记录活动SESSION的历史等待信息,每秒采样一次,这部分内容记录在内存中,期望值是记录一个小时的内容。 WRH#_ACTIVE_SESSION_HISTORY : 是V$ACTIVE_SESSION_HISTORY在AWR的存储地。 V$ACTIVE_SESSION_HISTORY: 中的信息会被定期(每小时一次)的刷新到负载库中,并缺省保留一个星期用于分析。 DBA_HIST_ACTIVE_SESS_HISTORY: 视图是WRH#_ACTIVE_SESSION_HISTORY视图和其他几个视图的联合展现,通常通过这个视图进行历史数据的访问。 ------------------------------------ --V$ACTIVE_SESSION_HISTORY的监控:-- ------------------------------------ ------------session:1----------------- SQL> @big SID ---------- 131 Elapsed: 00:00:00.00 drop table big * ERROR at line 1: ORA-00942: table or view does not exist Elapsed: 00:00:00.03 Elapsed: 00:00:00.31 Elapsed: 00:00:00.34 Elapsed: 00:00:00.29 Elapsed: 00:00:00.73 Elapsed: 00:00:01.75 Elapsed: 00:00:10.59 Elapsed: 00:00:24.62 Elapsed: 00:00:00.01 BIG_M ---------- 522 Elapsed: 00:00:00.36 COUNT(*) ---------- 4650368 Elapsed: 00:00:26.70 ------------session:2----------------- SQL> @getash_sid Enter value for sid: 131 SESSION_ID NAME P_NAME P_VALUE SQL_ID WAIT_TIME CURRENT_OBJ# CURRENT_FILE# CURRENT_BLOCK# ---------- ---------------------------------------------------------------- --------------- --------------- ------------- ---------- ------------ ------------- --------- 131 db file sequential read file# 1 d2wbn28rdk8z4 0 547 1 3604 block# 53206 blocks 1 131 db file sequential read file# 1 d2wbn28rdk8z4 0 -1 0 0 block# 3009 blocks 1 131 db file scattered read file# 4 03b71c07nsc1a 0 134 1 1064 block# 4845 blocks 8 131 log buffer space 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch completion 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 6046 0 0 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 4995 block# 4995 blocks 5 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 7170 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 7170 0 0 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 8578 block# 8578 blocks 126 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 12802 block# 12802 blocks 126 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 12930 0 0 131 db file sequential read file# 1 aq32z6wjx1s4h 0 65921 201 3585 block# 2854 blocks 1 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 14084 block# 14084 blocks 124 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 18436 block# 18436 blocks 128 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 19972 block# 19972 blocks 128 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 21252 block# 21252 blocks 124 131 db file parallel read files 1 aq32z6wjx1s4h 0 76851 4 23424 blocks 29 requests 29 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 24320 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 24320 0 0 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 25856 block# 25856 blocks 128 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 27652 block# 27652 blocks 124 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 29312 block# 29312 blocks 32 131 Disk file operations I/O FileOperation 2 aq32z6wjx1s4h 0 76851 4 29952 fileno 0 filetype 2 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 30724 block# 30724 blocks 124 131 db file scattered read file# 4 aq32z6wjx1s4h 0 76851 4 34530 block# 34530 blocks 14 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 35716 0 0 131 log file switch (checkpoint incomplete) 0 aq32z6wjx1s4h 0 76851 4 35716 0 0 131 Disk file operations I/O FileOperation 5 aq32z6wjx1s4h 0 76851 4 37632 fileno 0 filetype 2 131 db file sequential read file# 4 fqcxb1n33642x 0 9 1 86832 block# 4999 blocks 1 131 db file scattered read file# 4 fqcxb1n33642x 0 9 1 86832 block# 10344 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 9 1 86832 block# 17409 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 9 1 86832 block# 22083 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 9 1 86832 block# 28549 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 9 1 86832 block# 34733 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 9 1 86832 block# 39217 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 9 1 86832 block# 45114 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 9 1 86832 block# 48836 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 9 1 86832 block# 52391 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 5196 block# 5196 blocks 6 131 db file sequential read file# 4 fqcxb1n33642x 0 76851 4 8261 block# 8261 blocks 1 131 db file sequential read file# 4 fqcxb1n33642x 0 76851 4 11318 block# 11318 blocks 1 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 14489 block# 14489 blocks 56 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 17935 block# 17935 blocks 50 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 21195 block# 21195 blocks 20 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 25170 block# 25170 blocks 2 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 28453 block# 28453 blocks 34 131 db file sequential read file# 4 fqcxb1n33642x 0 76851 4 33067 block# 33067 blocks 1 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 36991 block# 36991 blocks 13 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 41616 block# 41616 blocks 21 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 44055 block# 44055 blocks 8 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 2723 block# 2723 blocks 44 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 50056 block# 50056 blocks 9 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 53658 block# 53658 blocks 102 131 db file scattered read file# 4 fqcxb1n33642x 0 76851 4 56580 block# 56580 blocks 128 131 db file sequential read file# 4 fqcxb1n33642x 0 76851 4 60256 block# 60256 blocks 1 64 rows selected. Elapsed: 00:00:00.40 SQL> @getsql_sqlid Enter 1 for curr sql, 2 for hist sql,default 1: Enter value for sqlid: fqcxb1n33642x SQL_FULLTEXT --------------------------------------------------------------------------------------------- select count(*) from big Elapsed: 00:00:00.00 Elapsed: 00:00:00.00 SQL> @getobj_id Enter value for dblink: Enter value for obj_id: 76851 OWNER OBJECT_NAME OBJECT_TYPE CREATED STATUS -------------------- ------------------------------ ------------------- ------------------- ------- SCOTT BIG TABLE 2014-11-20 15:56:23 VALID 1 row selected. Elapsed: 00:00:00.01 SQL> @getobj_fb Enter value for file_id: 4 Enter value for block_id: 60256 OWNER SEGMENT_NAME SEGMENT_TY --------------- -------------------- ---------- SCOTT BIG TABLE 1 row selected. Elapsed: 00:00:00.37 --------------------------@脚本-------------------- --@big @sid set feedback off drop table big; create table big as select * from dba_objects; insert into big select * from big; / / / / / commit; select SUM(bytes) / 1024 / 1024 big_M from dba_segments where segment_name = 'BIG'; select count(*) from big; set feedback on --@getash_sid col p_name for a15 col p_value for a15 select SESSION_ID, NAME, P1TEXT||chr(10)||P2TEXT||chr(10)||P3TEXT p_name, p1||chr(10)||p2||chr(10)||p3 p_value, sql_id, WAIT_TIME, CURRENT_OBJ#, CURRENT_FILE#, CURRENT_BLOCK# from v$active_session_history ash, v$event_name enm where ash.event# = enm.event# and SESSION_ID = &sid order by sample_time; ---------------------------------------- --DBA_HIST_ACTIVE_SESS_HISTORY的监控:-- ---------------------------------------- --查当前时间 select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual; --根据时间找到snap_id(8天内,1小时前),因为基表非常大,利用snap_id的索引才能快速查询 select distinct snap_id from dba_hist_snapshot b where to_date('2014-11-20 14:08:12','yyyy-mm-dd hh24:mi:ss') between b.begin_interval_time and b.end_interval_time; --top instance select /*+parallel(a,8)*/instance_number,count(*) from dba_hist_active_sess_history a where a.snap_id=67421 group by instance_number; --top event select /*+parallel(a,8)*/event,count(*) from dba_hist_active_sess_history a where a.snap_id=67421 and instance_number=2 and sample_time>=to_timestamp('2014-11-20 14:07:12','yyyy-mm-dd hh24:mi:ss') and sample_time<=to_timestamp('2014-11-20 14:08:12','yyyy-mm-dd hh24:mi:ss') group by event order by count(*) desc; --top user select /*+parallel(a,8)*/user_id,(select username from dba_users b where b.user_id=a.user_id) username,count(*) from dba_hist_active_sess_history a where a.snap_id=67421 and instance_number=2 and sample_time>=to_timestamp('2014-11-20 14:07:12','yyyy-mm-dd hh24:mi:ss') and sample_time<=to_timestamp('2014-11-20 14:08:12','yyyy-mm-dd hh24:mi:ss') group by user_id order by count(*) desc; --top sql select /*+parallel(a,8)*/sql_id,count(*) from dba_hist_active_sess_history a where a.snap_id=67421 and instance_number=2 and sample_time>=to_timestamp('2014-11-20 14:07:12','yyyy-mm-dd hh24:mi:ss') and sample_time<=to_timestamp('2014-11-20 14:08:12','yyyy-mm-dd hh24:mi:ss') group by sql_id order by count(*) desc; -- select SQL_TEXT from dba_hist_sqltext where sql_id='49p4hfj6azw19'; --top program select /*+parallel(a,8)*/program,count(*) from dba_hist_active_sess_history a where a.snap_id=67421 and instance_number=2 and sample_time>=to_timestamp('2014-11-20 14:07:12','yyyy-mm-dd hh24:mi:ss') and sample_time<=to_timestamp('2014-11-20 14:08:12','yyyy-mm-dd hh24:mi:ss') group by program order by count(*) desc;

如何利用GitLab进行项目文档管理一、背景介绍在软件开发过程中,项目文档是非常重要的资料,不仅能够帮助开发团队了解项目的需求和设计,还能提供给测试团队和客户参考。为了方便项目文档的版本控制和团队协作,我们可以利用GitLab来进行项目文档管理。GitLab是一个基于Git的版本控制系统,除了支持代码管理,还可以管理项目文档。二、GitLab环境搭建首先,我

抖音作为一个全球知名的短视频社交平台,靠着其独特的个性化推荐算法赢得了广大用户的青睐。本文将深入研究抖音视频推荐的价值和原理,帮助读者更好地了解和充分利用这一功能。一、什么是抖音推荐视频抖音推荐视频是根据用户的兴趣和行为习惯,利用智能推荐算法为用户筛选和推送个性化视频内容。抖音平台通过分析用户的观看历史、点赞和评论行为、分享记录等数据,从庞大的视频库中精选出最符合用户口味的视频进行推荐。这种个性化推荐系统不仅提高了用户体验,也帮助用户发现更多符合其喜好的视频内容,从而增强用户黏性和留存率。在这个

在当今的互联网时代,Web应用程序的高效稳定运行是非常重要的。然而,应用程序可能会出现故障或崩溃,影响用户体验。为了确保应用程序的正常运行,我们需要对其进行监控。本文将探讨如何使用Golang实现Web应用程序监控。一、Golang的Web应用程序监控工具Golang拥有非常适合Web应用程序监控的工具。其中最流行的就是Prometheus。Promethe

随着互联网的发展,web应用程序的性能监控以及安全分析越来越受到重视。nginx作为一款高性能的Web服务器和反向代理工具,其在性能监控和安全分析方面也受到广泛的关注和应用。本文将介绍一些Nginx性能监控和安全分析的辅助工具。Nginx性能监控工具NginxAmplifyNginxAmplify是Nginx公司推出的一款性能监控工具。该工具可以

Nginx监控实时状态配置,实时查看网站运行引言:Nginx是一款非常流行的反向代理服务器,其高性能和高并发能力使得它成为了许多网站的首选。为了保证网站的稳定运行,我们需要时刻监控Nginx的运行状态。本篇文章将介绍如何配置Nginx实时状态监控,并通过示例代码来让读者更好地理解。一、安装Nginx状态监控模块要实现Nginx的实时状态监控,需要在Nginx

随着微服务架构的广泛应用,调用链监控已经成为了保障微服务健康运行的重要手段。而基于go-zero框架实现微服务调用链监控,则是更加高效可靠的实现方式。一、调用链监控的基本概念微服务架构中,一个请求可能经过多个微服务组件的调用,这些调用形成了一条调用链。而一旦某一个环节出现问题,整个服务甚至整个系统都有可能受到影响。因此,调用链监控这个技术,就是通过记录整条调

Nginx访问日志配置指南,监控网站访问行为Nginx是一个高性能的Web服务器,广泛用于搭建静态或动态网站。在搭建网站的过程中,我们经常需要对网站的访问行为进行监控和分析。Nginx提供了强大的访问日志配置功能,能够帮助我们实现对网站的访问行为的监控和分析。本文将介绍如何配置Nginx的访问日志,以及如何使用日志分析工具进行网站访问行为的监控。如何配置Ng

哈医大临床药学就业前景如何尽管全国就业形势不容乐观,但药科类毕业生仍然有着良好的就业前景。总体来看,药科类毕业生的供给量少于需求量,各医药公司和制药厂是吸纳这类毕业生的主要渠道,制药行业对人才的需求也在稳步增长。据介绍,近几年药物制剂、天然药物化学等专业的研究生供需比甚至达到1∶10。临床药学专业就业方向:临床医学专业学生毕业后可在医疗卫生单位、医学科研等部门从事医疗及预防、医学科研等方面的工作。就业岗位:医药代表、医药销售代表、销售代表、销售经理、区域销售经理、招商经理、产品经理、产品专员、护


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),
