签到成功

知道了

CNDBA社区CNDBA社区

使用ass109.awk分析systemstate

2022-03-20 16:55 1028 0 原创 oracle
作者: hbhe0316

1.创建测试表http://www.cndba.cn/hbhe0316/article/107886

SQL> create table t_hbhe(id int,name varchar(10));

Table created.

SQL> insert into t_hbhe values (1,'a');

1 row created.

SQL> insert into t_hbhe values (2,'b');

1 row created.

SQL> commit;

Commit complete.

2.模拟会话被hang住http://www.cndba.cn/hbhe0316/article/107886http://www.cndba.cn/hbhe0316/article/107886

SQL> select * from t_hbhe;

        ID NAME
---------- ------------------------------
         1 a
         2 b

SQL> delete from t_hbhe where id = 1;

1 row deleted.

session 2:

SQL> delete from t_hbhe where id = 1;

0 rows deleted.

3.做systemstate

http://www.cndba.cn/hbhe0316/article/107886
http://www.cndba.cn/hbhe0316/article/107886

SQL>  oradebug setmypid
Statement processed.
SQL> oradebug unlimit
Statement processed.
SQL> oradebug dump systemstate 10
Statement processed.
SQL> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_5383.trc
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0

4.使用ass109.awk分析dump文件http://www.cndba.cn/hbhe0316/article/107886

[oracle@db02 ~]$ awk -f /tmp/ass109.awk /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_6555.trc

Starting Systemstate 1
...
Ass.Awk Version 1.0.9 - Processing /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_6555.trc

System State 1
~~~~~~~~~~~~~~~~
36: 0: waiting for 'SQL*Net message from client' 
81: 0: waiting for 'enq: TX - row lock contention' 
     Cmd: Delete
91:                                     

NO BLOCKING PROCESSES FOUND


8852 Lines Processed.

从这里马上就可以知道pid 81 请求Enqueue TX被pid 36阻塞
不过LTOM目前已经不再开发了,他的很多功能集成到ASH里面了:

http://www.cndba.cn/hbhe0316/article/107886
http://www.cndba.cn/hbhe0316/article/107886http://www.cndba.cn/hbhe0316/article/107886
http://www.cndba.cn/hbhe0316/article/107886

IMPORTANT: LTOM is a legacy tool and is no longer being developed. 
Much of the functionality is now available within the Active Session History (ASH). 
For details see: Document 243132.1 Analysis of Active Session History (Ash) Online and Offline

版权声明:本文为博主原创文章,未经博主允许不得转载。

oracle

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1039486次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ