列出oracle dbtime得sql语句
发表于:2024-11-14 作者:千家信息网编辑
千家信息网最后更新 2024年11月14日,可以根据dbtime 查看数据库得繁忙程度,获取某个快照得awr报告,进行分析-------------------------------------------------------------
千家信息网最后更新 2024年11月14日列出oracle dbtime得sql语句可以根据dbtime 查看数据库得繁忙程度,获取某个快照得awr报告,进行分析
----------------------------------------------------------------------------------------
--
-- File name: dbtime.sql
-- Purpose: Find busiest time periods in AWR.
-
-- Author: Kerry Osborne
--
-- Usage: This scripts prompts for three values, all of which can be left blank.
--
-- instance_number: set to limit to a single instance in RAC environment
--
-- begin_snap_id: set it you want to limit to a specific range, defaults to 0
--
-- end_snap_id: set it you want to limit to a specific range, defaults to 99999999
--
--
---------------------------------------------------------------------------------------
set lines 155
col dbtime for 999,999.99
col begin_timestamp for a40
select * from (
select begin_snap, end_snap, timestamp begin_timestamp, inst, a/1000000/60 DBtime from
(
select
e.snap_id end_snap,
lag(e.snap_id) over (order by e.snap_id) begin_snap,
lag(s.end_interval_time) over (order by e.snap_id) timestamp,
s.instance_number inst,
e.value,
nvl(value-lag(value) over (order by e.snap_id),0) a
from dba_hist_sys_time_model e, DBA_HIST_SNAPSHOT s
where s.snap_id = e.snap_id
and e.instance_number = s.instance_number
and to_char(e.instance_number) like nvl('&instance_number',to_char(e.instance_number))
and stat_name = 'DB time'
)
where begin_snap between nvl('&begin_snap_id',0) and nvl('&end_snap_id',99999999)
and begin_snap=end_snap-1
order by dbtime desc
)
where rownum < 31
/
BEGIN_SNAP END_SNAP BEGIN_TIMESTAMP INST DBTIME
---------- ---------- ---------------------------------------- ---------- -----------
99 100 02-MAY-18 04.00.11.163 PM 1 2,791.85
80 81 01-MAY-18 09.00.01.121 PM 1 2,749.62
66 67 01-MAY-18 07.00.08.007 AM 1 2,733.33
67 68 01-MAY-18 08.00.21.814 AM 1 2,732.78
57 58 30-APR-18 10.00.06.732 PM 1 2,728.00
56 57 30-APR-18 09.00.35.565 PM 1 2,727.69
65 66 01-MAY-18 06.00.00.538 AM 1 2,726.59
72 73 01-MAY-18 01.00.30.321 PM 1 2,723.55
100 101 02-MAY-18 05.00.27.047 PM 1 1,764.40
55 56 30-APR-18 08.00.13.544 PM 1 1,706.66
59 60 01-MAY-18 12.00.17.902 AM 1 1,704.93
BEGIN_SNAP END_SNAP BEGIN_TIMESTAMP INST DBTIME
---------- ---------- ---------------------------------------- ---------- -----------
64 65 01-MAY-18 05.00.19.310 AM 1 1,703.53
83 84 02-MAY-18 12.00.44.286 AM 1 1,702.55
85 86 02-MAY-18 02.00.11.423 AM 1 1,701.95
69 70 01-MAY-18 10.00.21.811 AM 1 1,675.91
77 78 01-MAY-18 06.00.37.335 PM 1 1,675.91
71 72 01-MAY-18 12.00.16.844 PM 1 1,675.83
52 53 30-APR-18 05.00.02.455 PM 2 1,109.93
101 102 02-MAY-18 06.00.39.504 PM 2 1,088.41
86 87 02-MAY-18 03.00.24.853 AM 2 1,049.19
53 54 30-APR-18 06.00.12.352 PM 2 1,036.89
44 45 30-APR-18 09.00.00.954 AM 2 1,026.10
BEGIN_SNAP END_SNAP BEGIN_TIMESTAMP INST DBTIME
---------- ---------- ---------------------------------------- ---------- -----------
51 52 30-APR-18 04.00.25.353 PM 2 1,017.33
50 51 30-APR-18 03.00.11.207 PM 2 1,003.77
45 46 30-APR-18 10.00.12.054 AM 2 1,003.51
47 48 30-APR-18 12.00.02.027 PM 2 1,002.93
46 47 30-APR-18 11.00.29.502 AM 2 1,002.87
48 49 30-APR-18 01.00.12.856 PM 2 1,002.62
49 50 30-APR-18 02.00.10.611 PM 2 1,002.43
43 44 30-APR-18 08.00.29.126 AM 2 880.34
----------------------------------------------------------------------------------------
--
-- File name: dbtime.sql
-- Purpose: Find busiest time periods in AWR.
-
-- Author: Kerry Osborne
--
-- Usage: This scripts prompts for three values, all of which can be left blank.
--
-- instance_number: set to limit to a single instance in RAC environment
--
-- begin_snap_id: set it you want to limit to a specific range, defaults to 0
--
-- end_snap_id: set it you want to limit to a specific range, defaults to 99999999
--
--
---------------------------------------------------------------------------------------
set lines 155
col dbtime for 999,999.99
col begin_timestamp for a40
select * from (
select begin_snap, end_snap, timestamp begin_timestamp, inst, a/1000000/60 DBtime from
(
select
e.snap_id end_snap,
lag(e.snap_id) over (order by e.snap_id) begin_snap,
lag(s.end_interval_time) over (order by e.snap_id) timestamp,
s.instance_number inst,
e.value,
nvl(value-lag(value) over (order by e.snap_id),0) a
from dba_hist_sys_time_model e, DBA_HIST_SNAPSHOT s
where s.snap_id = e.snap_id
and e.instance_number = s.instance_number
and to_char(e.instance_number) like nvl('&instance_number',to_char(e.instance_number))
and stat_name = 'DB time'
)
where begin_snap between nvl('&begin_snap_id',0) and nvl('&end_snap_id',99999999)
and begin_snap=end_snap-1
order by dbtime desc
)
where rownum < 31
/
BEGIN_SNAP END_SNAP BEGIN_TIMESTAMP INST DBTIME
---------- ---------- ---------------------------------------- ---------- -----------
99 100 02-MAY-18 04.00.11.163 PM 1 2,791.85
80 81 01-MAY-18 09.00.01.121 PM 1 2,749.62
66 67 01-MAY-18 07.00.08.007 AM 1 2,733.33
67 68 01-MAY-18 08.00.21.814 AM 1 2,732.78
57 58 30-APR-18 10.00.06.732 PM 1 2,728.00
56 57 30-APR-18 09.00.35.565 PM 1 2,727.69
65 66 01-MAY-18 06.00.00.538 AM 1 2,726.59
72 73 01-MAY-18 01.00.30.321 PM 1 2,723.55
100 101 02-MAY-18 05.00.27.047 PM 1 1,764.40
55 56 30-APR-18 08.00.13.544 PM 1 1,706.66
59 60 01-MAY-18 12.00.17.902 AM 1 1,704.93
BEGIN_SNAP END_SNAP BEGIN_TIMESTAMP INST DBTIME
---------- ---------- ---------------------------------------- ---------- -----------
64 65 01-MAY-18 05.00.19.310 AM 1 1,703.53
83 84 02-MAY-18 12.00.44.286 AM 1 1,702.55
85 86 02-MAY-18 02.00.11.423 AM 1 1,701.95
69 70 01-MAY-18 10.00.21.811 AM 1 1,675.91
77 78 01-MAY-18 06.00.37.335 PM 1 1,675.91
71 72 01-MAY-18 12.00.16.844 PM 1 1,675.83
52 53 30-APR-18 05.00.02.455 PM 2 1,109.93
101 102 02-MAY-18 06.00.39.504 PM 2 1,088.41
86 87 02-MAY-18 03.00.24.853 AM 2 1,049.19
53 54 30-APR-18 06.00.12.352 PM 2 1,036.89
44 45 30-APR-18 09.00.00.954 AM 2 1,026.10
BEGIN_SNAP END_SNAP BEGIN_TIMESTAMP INST DBTIME
---------- ---------- ---------------------------------------- ---------- -----------
51 52 30-APR-18 04.00.25.353 PM 2 1,017.33
50 51 30-APR-18 03.00.11.207 PM 2 1,003.77
45 46 30-APR-18 10.00.12.054 AM 2 1,003.51
47 48 30-APR-18 12.00.02.027 PM 2 1,002.93
46 47 30-APR-18 11.00.29.502 AM 2 1,002.87
48 49 30-APR-18 01.00.12.856 PM 2 1,002.62
49 50 30-APR-18 02.00.10.611 PM 2 1,002.43
43 44 30-APR-18 08.00.29.126 AM 2 880.34
繁忙
快照
报告
数据
数据库
程度
分析
语句
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
软件开发部助理的职责
阿里云服务器拼团
网络安全手抄报初三生漂亮
苹果手机本地备份泄露数据库
湖北鸣客网络技术服务
徐州视觉测量系统软件开发
云服务器的特点有
图书管理系统数据库运行维护
图数据库titan安装
软件开发改键位麻烦吗
服务器 安装操作系统
我国网络安全的立法问题研究
将数据库中的数据转换为json
瑞丽gpu云服务器公司
普遍的软件开发模式
ppt模板下载网络安全
splunk软件开发面试
安徽服务器机柜定制价格
山东网络安全部门
自己做的服务器如何用手机浏览
下载安全控件找不到服务器
ios软件开发用什么
中兴软件开发二面面经英语
实用网络技术设计
济南软件开发信息平台
云计算是什么型数据库
北京创新网络技术有限公司
用户 网站 数据库设计
splunk软件开发面试
软件开发前端需求文档