当前位置:网站首页>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)
边栏推荐
- How to do the performance pressure test of "Health Code"
- 2022 hoisting machinery command registration examination and hoisting machinery command examination registration
- Basic exercise of test questions hexadecimal to decimal
- js解决浮点数相乘精度丢失问题
- Data loading and preprocessing
- Pytoch (III) -- function optimization
- 神经网络的基本骨架-nn.Moudle的使用
- [2020 overview] overview of link prediction based on knowledge map embedding
- pytorch 卷积操作
- FileInputStream
猜你喜欢

LM small programmable controller software (based on CoDeSys) note 20: PLC controls stepping motor through driver

The junior college students were angry for 32 days, four rounds of interviews, five hours of soul torture, and won Ali's offer with tears

Simple implementation of slf4j

分布式全局唯一ID解决方案详解

STM32 光敏电阻传感器&两路AD采集

分布式事务-解决方案

Dual contractual learning: text classification via label aware data augmentation reading notes

神经网络-使用Sequential搭建神经网络

Dataloader的使用

2022 tea master (intermediate) examination question bank and tea master (intermediate) examination questions and analysis
随机推荐
Neural networks - use of maximum pooling
洗个冷水澡吧
Shell之分析服务器日志命令集锦
2022 t elevator repair new version test questions and t elevator repair simulation test question bank
The design points of voice dialogue system and the importance of multi round dialogue
Neural network - nonlinear activation
分布式锁的实现
LeetCode_ 66 (plus one)
C - detailed explanation of operators and summary of use cases
STM32扩展版 按键扫描
Common UNIX Operation and maintenance commands of shell
How to use maixll dock
科研狗可能需要的一些工具
LeetCode_ 58 (length of last word)
LeetCode_ 28 (implement strstr())
Tencent has five years of testing experience. It came to the interview to ask for 30K, and saw the so-called software testing ceiling
LeetCode_53(最大子数组和)
Basic usage, principle and details of session
【硬十宝典】——2.【基础知识】开关电源各种拓扑结构的特点
Dede collection plug-in does not need to write rules