当前位置:网站首页>Query long transaction
Query long transaction
2022-07-01 04:47:00 【Drunken Xiaobai】
-- Query long transaction
set linesize 200
set pagesize 5000
col transaction_duration format a45
with transaction_details as
( select inst_id
, ses_addr
, sysdate - start_date as diff
from gv$transaction
)
select s.username
, to_char(trunc(t.diff))
|| ' days, '
|| to_char(trunc(mod(t.diff * 24,24)))
|| ' hours, '
|| to_char(trunc(mod(t.diff * 24 * 60,24)))
|| ' minutes, '
|| to_char(trunc(mod(t.diff * 24 * 60 * 60,60)))
|| ' seconds' as transaction_duration
, s.program
, s.terminal
, s.status
, s.sid
, s.serial#
from gv$session s
, transaction_details t
where s.inst_id = t.inst_id
and s.saddr = t.ses_addr
order by t.diff desc
/
Not CDB
SELECT trans_cnt,
round(max_blocks * 1000, 2) as max_blocks,
round(max_duaration, 0) as max_duaration
FROM (select count(*) trans_cnt,
nvl(max(used_ublk), 0) / 1000 max_blocks,
nvl((sysdate - min(to_date(start_time, 'mm/dd/yy hh24:mi:ss'))),
0) * 1440 * 60 max_duaration
FROM v$transaction);
CDB
SELECT con_id,
trans_cnt,
round(max_blocks * 1000, 2) as max_blocks,
round(max_duaration, 0) as max_duaration
FROM (select con_id,
count(*) trans_cnt,
nvl(max(used_ublk), 0) / 1000 max_blocks,
nvl((sysdate - min(to_date(start_time, 'mm/dd/yy hh24:mi:ss'))),
0) * 1440 * 60 max_duaration
FROM v$transaction
group by con_id)
边栏推荐
- 【硬十宝典】——2.【基础知识】开关电源各种拓扑结构的特点
- Sorting out 49 reports of knowledge map industry conference | AI sees the future with wisdom
- Shell analysis server log command collection
- Fitness without equipment
- Leecode records the number of good segmentation of 1525 strings
- LeetCode_ 53 (maximum subarray and)
- How to do the performance pressure test of "Health Code"
- Thoughts on the construction of Meizhou cell room
- Pytest automated testing - compare robotframework framework
- 线程类的几大创建方法
猜你喜欢

Sorting out 49 reports of knowledge map industry conference | AI sees the future with wisdom

Shell之一键自动部署Redis任意版本

This sideline workload is small, 10-15k, free unlimited massage

Technology sharing | broadcast function design in integrated dispatching

Dataloader的使用

Why is Internet thinking not suitable for AI products?

Section 27 remote access virtual private network workflow and experimental demonstration

Pytoch (II) -- activation function, loss function and its gradient

解决:拖动xib控件到代码文件中,报错setValue:forUndefinedKey:this class is not key value coding-compliant for the key

LM small programmable controller software (based on CoDeSys) note 20: PLC controls stepping motor through driver
随机推荐
C - detailed explanation of operators and summary of use cases
Kodori tree board
Pytorch(二) —— 激活函数、损失函数及其梯度
STM32 光敏电阻传感器&两路AD采集
Openresty rewrites the location of 302
缓冲流与转换流
Dede collection plug-in does not need to write rules
Quelques outils dont les chiens scientifiques pourraient avoir besoin
2022 tea master (intermediate) examination question bank and tea master (intermediate) examination questions and analysis
Pytoch (III) -- function optimization
2022 hoisting machinery command registration examination and hoisting machinery command examination registration
Construction of Meizhou nursing laboratory: equipment configuration
Codeforces Round #771 (Div. 2) ABCD|E
Pytoch (I) -- basic grammar
Talk about testdeploy
【FTP】FTP连接时出现“227 Entering Passive Mode”的解决方法
LeetCode_ 28 (implement strstr())
All in all, the low code still needs to solve these four problems
Pytorch neural network construction template
Applications and features of VR online exhibition