白天和黑夜只交替没交换无法想像对方的世界
分类: oracle
2011-09-28 04:00:03
在rac环境里,经常会有core文件产生,产生的原因:程序崩溃,内核有可能把该程序当前内存映射到core文件里,方便程序员找到程序出现问题的地方。那么如何定位及追踪core呢?以下操作即是:
1.查找到系统程序崩溃时产生的core文件:
[root@rac1 ~]# find /u01 -name core.* -exec ls -lthr {} \;
-rw------- 1 root root 480m sep 27 12:01 /u01/oracle/product/crs/log/rac1/crsd/core.3907
core文件大小为480m,文件还挺大的。所以,平时,如果遇到磁盘空间不足的时候,没准就是core文件在做怪呢!
2.定位出是由于哪个文件产生的core文件:
[root@rac1 ~]# find /u01 -name core.* -exec ls -lthr {} \;|awk '{print $9}'|xargs file
/u01/oracle/product/crs/log/rac1/crsd/core.3907: elf 32-bit lsb core file intel 80386, version 1 (sysv), svr4-style, from 'crsd.bin'
由以下命令,可以看出core.3907的产生,是由于'crsd.bin'文件引起的。
3.使用gdb对core进行追踪:
[root@rac1 ~]# gdb /u01/oracle/product/crs/bin/crsd.bin /u01/oracle/product/crs/log/rac1/crsd/core.3907
gnu gdb fedora (6.8-37.el5)
凯发app官方网站 copyright (c) 2008 free software foundation, inc.
license gplv3 : gnu gpl version 3 or later <>
this is free software: you are free to change and redistribute it.
there is no warranty, to the extent permitted by law. type "show copying"
and "show warranty" for details.
this gdb was configured as "i386-redhat-linux-gnu"...
warning: can't read pathname for load map: input/output error.
warning: .dynamic section for "/lib/libdl.so.2" is not at the expected address
warning: difference appears to be caused by prelink, adjusting expectations
reading symbols from /lib/libm.so.6...done.
loaded symbols for /lib/libm.so.6
reading symbols from /lib/libpthread.so.0...done.
loaded symbols for /lib/libpthread.so.0
reading symbols from /u01/oracle/product/crs/lib/libocr10.so...done.
loaded symbols for /u01/oracle/product/crs/lib/libocr10.so
reading symbols from /u01/oracle/product/crs/lib/libocrb10.so...done.
loaded symbols for /u01/oracle/product/crs/lib/libocrb10.so
reading symbols from /u01/oracle/product/crs/lib/libocrutl10.so...done.
loaded symbols for /u01/oracle/product/crs/lib/libocrutl10.so
reading symbols from /u01/oracle/product/crs/lib/libhasgen10.so...done.
loaded symbols for /u01/oracle/product/crs/lib/libhasgen10.so
reading symbols from /u01/oracle/product/crs/lib/libclntsh.so.10.1...done.
loaded symbols for /u01/oracle/product/crs/lib/libclntsh.so.10.1
reading symbols from /u01/oracle/product/crs/lib/libskgxn2.so...done.
loaded symbols for /u01/oracle/product/crs/lib/libskgxn2.so
reading symbols from /lib/libdl.so.2...done.
loaded symbols for /lib/libdl.so.2
reading symbols from /lib/libnsl.so.1...done.
loaded symbols for /lib/libnsl.so.1
reading symbols from /usr/lib/libstdc .so.5...done.
loaded symbols for /usr/lib/libstdc .so.5
reading symbols from /lib/libc.so.6...done.
loaded symbols for /lib/libc.so.6
reading symbols from /lib/ld-linux.so.2...done.
loaded symbols for /lib/ld-linux.so.2
reading symbols from /u01/oracle/product/crs/lib/libnnz10.so...done.
loaded symbols for /u01/oracle/product/crs/lib/libnnz10.so
reading symbols from /lib/libgcc_s.so.1...done.
loaded symbols for /lib/libgcc_s.so.1
reading symbols from /lib/libnss_files.so.2...done.
loaded symbols for /lib/libnss_files.so.2
core was generated by `/u01/oracle/product/crs/bin/crsd.bin reboot'.
program terminated with signal 6, aborted.
[new process 4787]
[new process 4789]
[new process 4786]
[new process 4785]
[new process 4784]
[new process 4783]
[new process 4782]
[new process 4781]
[new process 4780]
[new process 4779]
[new process 4778]
[new process 4721]
[new process 4701]
[new process 4700]
[new process 4665]
[new process 4664]
[new process 4663]
[new process 4662]
[new process 4661]
[new process 4660]
[new process 4659]
[new process 4658]
[new process 4657]
[new process 4656]
[new process 4655]
[new process 4654]
[new process 4653]
[new process 4652]
[new process 4651]
[new process 4650]
[new process 4649]
[new process 4648]
[new process 4647]
[new process 4641]
[new process 4640]
[new process 4639]
[new process 4638]
[new process 4637]
[new process 4636]
[new process 4635]
[new process 4634]
[new process 4514]
[new process 3907]
#0 0x00389402 in __kernel_vsyscall ()
(gdb) where
#0 0x00389402 in __kernel_vsyscall ()
#1 0x009a1df0 in raise () from /lib/libc.so.6
#2 0x009a3701 in abort () from /lib/libc.so.6
#3 0x0099b26b in __assert_fail () from /lib/libc.so.6
#4 0x08363c8e in destr_detour5 () at clsthreadmain.cpp:70
#5 0x00af45ab in start_thread () from /lib/libpthread.so.0
#6 0x00a4acfe in clone () from /lib/libc.so.6
(gdb)
注意:上面的两行红色部分:
core was generated by `/u01/oracle/product/crs/bin/crsd.bin reboot'.
program terminated with signal 6, aborted.
恰恰说明,由于系统发生reboot重启操作,而产生了core文件。