這篇文章主要介紹了數(shù)據(jù)庫(kù)中如何查看故障時(shí)間等待事件、問(wèn)題sql及會(huì)話訪問(wèn)次數(shù),具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
創(chuàng)新互聯(lián)主要從事網(wǎng)站制作、網(wǎng)站設(shè)計(jì)、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)五華,十多年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專(zhuān)業(yè),歡迎來(lái)電咨詢建站服務(wù):13518219792
DBA_HIST_ACTIVE_SESS_HISTORY
DBA_HIST_ACTIVE_SESS_HISTORY displays the history of the contents of the in-memory active session history of recent system activity. This view contains snapshots of V$ACTIVE_SESSION_HISTORY. See "V$ACTIVE_SESSION_HISTORY" for further interpretation details for many of these columns (except SNAP_ID, DBID, and INSTANCE_NUMBER).
查看故障時(shí)間段等待事件、問(wèn)題sql id及會(huì)話訪問(wèn)次數(shù)
--alter session set nls_date_format='yyyy-mm-dd hh34:mi:ss'; select trunc(sample_time, 'mi') tm, sql_id, nvl(event,'CPU'),count(distinct session_id) cnt from dba_hist_active_sess_history where sample_time between to_date('2019-08-22 14:00:00') and to_date('2019-08-22 14:30:00') group by trunc(sample_time, 'mi'), sql_id,nvl(event,'CPU') order by cnt desc;
查看該sql相關(guān)的等待事件及對(duì)應(yīng)的會(huì)話訪問(wèn)次數(shù)
select sql_id, nvl(event, 'CPU'), count(distinct session_id) sz from dba_hist_active_sess_history a, dba_hist_snapshot b where sample_time between to_date('2019-08-22 14:00:00') and to_date('2019-08-22 15:00:00') and sql_id = '4ksvn2rgjnhcm' and a.snap_id = b.snap_id and a.instance_number = b.instance_number group by sql_id, nvl(event, 'CPU') order by sz desc;
感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“數(shù)據(jù)庫(kù)中如何查看故障時(shí)間等待事件、問(wèn)題sql及會(huì)話訪問(wèn)次數(shù)”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!