- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
3#
发表于 2013-1-17 15:30:04
10g有ASH的情况还是很简单的,举个例子
session A:
SQL> select * from mac;
T1
----------
1
10
100
1200
0
0
0
0
8 rows selected.
SQL> update mac set t1=t1+1;
8 rows updated.
session B;
SQL> delete mac;
SQL> select event,sid from v$session where wait_class!='Idle';
EVENT SID
---------------------------------------------------------------- ----------
SQL*Net message to client 136
enq: TX - row lock contention 143
在今后的7天时间内都能查验相关 enq: TX - row lock contention 信息
- SQL> select session_id,sql_id,count(*) from dba_hist_active_sess_history where event='enq: TX - row lock contention' group by session_id,sql_id;
- no rows selected
- SQL> select session_id,sql_id,count(*) from v$active_session_history where event='enq: TX - row lock contention' group by session_id,sql_id;
- SESSION_ID SQL_ID COUNT(*)
- ---------- ------------- ----------
- 143 gv17udzstaqa4 73
-
-
- SQL> select sql_text from v$SQL WHERE SQL_ID='gv17udzstaqa4';
- SQL_TEXT
- --------------------------------------------------------------------------------
- delete mac
- SQL> select sql_text from dba_hist_sqltext WHERE SQL_ID='gv17udzstaqa4';
- no rows selected
- SQL> exec dbms_workload_repository.create_snapshot;
- PL/SQL procedure successfully completed.
- SQL> select session_id,sql_id,count(*) from dba_hist_active_sess_history where event='enq: TX - row lock contention' group by session_id,sql_id;
- SESSION_ID SQL_ID COUNT(*)
- ---------- ------------- ----------
- 143 gv17udzstaqa4 7
- SQL> select sql_text from dba_hist_sqltext WHERE SQL_ID='gv17udzstaqa4';
- SQL_TEXT
- --------------------------------------------------------------------------------
- delete mac
-
复制代码 |
|