当前位置:网站首页>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)
边栏推荐
- Basic usage, principle and details of session
- Matters behind the construction of paint testing laboratory
- STM32扩展板 数码管显示
- Leecode question brushing record 1332 delete palindrome subsequence
- [2020 overview] overview of link prediction based on knowledge map embedding
- [ue4] event distribution mechanism of reflective event distributor and active call event mechanism
- js解决浮点数相乘精度丢失问题
- How to use common datasets in pytorch
- Leecode records the number of good segmentation of 1525 strings
- JS to solve the problem of floating point multiplication precision loss
猜你喜欢

LM小型可编程控制器软件(基于CoDeSys)笔记二十:plc通过驱动器控制步进电机

STM32 extended key scan

LM small programmable controller software (based on CoDeSys) note 19: errors do not match the profile of the target

STM32扩展版 按键扫描

Pytorch(一) —— 基本语法

VR线上展览所具备应用及特色

Technology sharing | broadcast function design in integrated dispatching

神经网络的基本骨架-nn.Moudle的使用

How to do the performance pressure test of "Health Code"

Pytoch (III) -- function optimization
随机推荐
解决:Thread 1:[<*>setValue:forUndefinedKey]:this class is not key value coding-compliant for the key *
pytorch中常用数据集的使用方法
Difficulties in the development of knowledge map & the importance of building industry knowledge map
数据加载及预处理
Talk about testdeploy
RuntimeError: “max_pool2d“ not implemented for ‘Long‘
Dual contractual learning: text classification via label aware data augmentation reading notes
Solve the problem that the external chain file of Qiankun sub application cannot be obtained
Collect the annual summary of laws, regulations, policies and plans related to trusted computing of large market points (national, ministerial, provincial and municipal)
FileInputStream
Quelques outils dont les chiens scientifiques pourraient avoir besoin
解决:拖动xib控件到代码文件中,报错setValue:forUndefinedKey:this class is not key value coding-compliant for the key
How to do the performance pressure test of "Health Code"
JVM栈和堆简介
STM32 photoresistor sensor & two channel AD acquisition
线程安全问题
Codeforces Round #771 (Div. 2) ABCD|E
C read / write application configuration file app exe. Config and display it on the interface
Introduction to JVM stack and heap
【硬十宝典】——2.【基础知识】开关电源各种拓扑结构的特点