ITPub博客

首页 > Linux操作系统 > Linux操作系统 > hanganalyze和systemstate dump

hanganalyze和systemstate dump

原创 Linux操作系统 作者:hunterjoy 时间:2011-01-15 16:47:23 0 删除 编辑
2010年1月12下午7点,我已下班回家,吃完饭后,准备和小孩玩,突然接到领导电话,甘肃用户的数据库性能出现问题:每天10:30分左右数据库hang住,持续10分钟左右,10点40一般就没有问题了,一整天就这个时间段出现问题。
      我赶紧坐300路直奔总局,拿上笔记本准备第二天早晨出差。
1月13早晨4点半起床时,发现母亲已经将早餐做好,我吃完饭后,5点20左右,打的,坐飞机,10点20抵达兰州。
1月14日10点30问题再次出现。
1月15日转载此文章,感谢http://space.itpub.net/464838/viewspace-664380
 

当数据库hang住的时候,如果能够使用sqlplus登录数据库,那么debug也许是你的不错的选择。而systemstate dump、 hang analyze也是我们解决问题的有效途径

下面就是systemstate dump的使用方法

when database met problems or malfunction, systemstate dump is necessary for further investigation. Following the below steps is a guide from metalink engineer.

Take 2 (it must be at least 2) system states level 266

+ ON RAC
- open a sqlplus SYSDBA connection to dump systemstates:
(if you can’t connect see 359536.1 for an explanation on the -prelim option)
SQL> connect /as sysdba
SQL> oradebug setmypid
SQL> oradebug unlimit
- when the hang happens, use the above sqlplus from one of the instances to get the dumps

//每隔2分钟执行一次,执行3三次
SQL> oradebug -g all hanganalyze 3
2 minutes
SQL> oradebug -g all hanganalyze 3
2 minutes
SQL> oradebug -g all hanganalyze 3
2 minutes
SQL> oradebug -g all dump systemstate 266
SQL> oradebug -g all dump systemstate 266
SQL> oradebug -g all dump systemstate 266
- now pick up alert.logs and all tracefiles generated or updated on all instances during t
he time the above commands where running, zip & upload

+ SINGLE INSTANCE
- open a sqlplus SYSDBA connection to dump systemstates:
(if you can’t connect see 3 59536.1 for an explanation on the -prelim option)
SQL> connect /as sysdba
SQL> oradebug setmypid
SQL> oradebug unlimit
- when the hang happens, use the above sqlplus from one of the instances to get the dumps
SQL> oradebug hanganalyze 3
2 minutes
SQL> oradebug hanganalyze 3
2 minutes
SQL> oradebug hanganalyze 3
2 minutes
SQL> oradebug dump systemstate 266
SQL> oradebug dump systemstate 266
SQL> oradebug dump systemstate 266
- now pick up alert.logs and all tracefiles generated or updated on all instances du
ring the time the above commands where running, zip & upload

Ref: Systemstate dump when connection to the instance is not possible [ID 359536.1]
 
1月17日oracle原厂工程师离开客户现场时,让我18日做如下操作:
Please take 2 systemstate dump when issue reproduces next time:
SQL> oradebug setmypid
SQL> oradebug unlimit
SQL> oradebug dump systemstate 10

SQL> oradebug setmypid
SQL> oradebug unlimit
SQL> oradebug dump systemstate 10
SQL> oradebug tracefile_name
Then upload the trace file generated.
 
用ass109工具分析生成的trace文件:
awk -f ass109.awk XXXX.trc
 
我在17日18点左右执行以上语句时,当执行到:
oradebug dump systemstate 10时,系统产生的trace文件将/ORACLE目录的磁盘目录空间用完,空间使用率达到100%,因此,18日,我没有在生产环境执行以上语句。
 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/543979/viewspace-683892/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: oradebug hanganalyze
请登录后发表评论 登录
全部评论

注册时间:2007-12-31

  • 博文量
    168
  • 访问量
    389697