从11G开始跟踪文件和日志文件的产生有了很大的改变,而且日志文件和跟踪文件的路径
也有了很大的变化,11G后ORACLE中产生的跟踪文件和日志都被记录在ADR目录中。
如果还打算从bdump ,udump去找对应的文件的话,可能会让你失望。
从11G后,每当一个关键错误发生后,将会有2个文件被创建:TRACE文件和DUMP文件。
进程的跟踪文件被记录在ADR HOME目录中的TRACE文件夹中,命名为
_ora_.trc。
例如在我的测试环境中,ADR BASE 是 /u01/app/oracle, ADR HOME是 diag/rdbms/huateng/huateng
adrci> show base
ADR base is "/u01/app/oracle"
adrci> show homepath
ADR Homes:
diag/rdbms/huateng/huateng
进程的跟踪文件被存放在ADR_BASE/ADR_HOME/trace文件夹中,如下:
[oracle@db2server trace]$ pwd
/u01/app/oracle/diag/rdbms/huateng/huateng/trace
[oracle@db2server trace]$ ls -ltr
total 712
drwxr-xr-x 2 oracle oinstall 4096 Aug 1 23:32 cdmp_20120801233214
drwxr-xr-x 2 oracle oinstall 4096 Aug 6 19:28 cdmp_20120806192847
drwxr-xr-x 2 oracle oinstall 4096 Aug 6 19:28 cdmp_20120806192849
drwxr-xr-x 2 oracle oinstall 4096 Aug 6 19:29 cdmp_20120806192908
drwxr-xr-x 2 oracle oinstall 4096 Aug 6 19:29 cdmp_20120806192910
drwxr-xr-x 2 oracle oinstall 4096 Aug 6 19:29 cdmp_20120806192930
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 cdmp_20120807232506
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 cdmp_20120807232510
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 cdmp_20120807232511
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 cdmp_20120807232513
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 cdmp_20120807232517
drwxr-xr-x 2 oracle oinstall 4096 Aug 14 11:26 cdmp_20120814112622
drwxr-xr-x 2 oracle oinstall 4096 Aug 16 05:13 cdmp_20120816051337
drwxr-xr-x 2 oracle oinstall 4096 Nov 5 23:39 cdmp_20121105233926
drwxr-xr-x 2 oracle oinstall 4096 Nov 5 23:44 cdmp_20121105234456
drwxr-xr-x 2 oracle oinstall 4096 Nov 5 23:49 cdmp_20121105234926
-rw-r----- 1 oracle oinstall 659181 Nov 12 20:57 alert_huateng.log
每当一个错误发生的时候,oracle会创建一个incident,并且分配一个INCIDENT_ID号,同时在ADR HOME的INCIDENT目录中
创建相应的INCIDENT 目录,每个错误号一个INCIDENT目录,目录被命名为incdir_。
如下所示:
[oracle@db2server incident]$ pwd
/u01/app/oracle/diag/rdbms/huateng/huateng/incident
[oracle@db2server incident]$ ls -ltr
total 60
drwxr-xr-x 2 oracle oinstall 4096 Aug 1 23:32 incdir_11041
drwxr-xr-x 2 oracle oinstall 4096 Aug 6 19:28 incdir_19306
drwxr-xr-x 2 oracle oinstall 4096 Aug 6 19:29 incdir_19354
drwxr-xr-x 2 oracle oinstall 4096 Aug 6 19:29 incdir_19355
drwxr-xr-x 2 oracle oinstall 4096 Aug 6 19:29 incdir_19356
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 incdir_25414
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 incdir_25454
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 incdir_25462
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 incdir_25415
drwxr-xr-x 2 oracle oinstall 4096 Aug 7 23:25 incdir_25416
drwxr-xr-x 2 oracle oinstall 4096 Aug 14 11:26 incdir_34962
drwxr-xr-x 2 oracle oinstall 4096 Aug 16 05:13 incdir_42163
drwxr-xr-x 2 oracle oinstall 4096 Nov 5 23:39 incdir_66276
drwxr-xr-x 2 oracle oinstall 4096 Nov 5 23:44 incdir_66277
drwxr-xr-x 2 oracle oinstall 4096 Nov 5 23:49 incdir_66284
在incident 目录下含有相应的DUMP文件,如INCIDENT_ID为11041中含有如下DUMP文件信息:
[oracle@db2server incident]$ cd incdir_11041
[oracle@db2server incdir_11041]$ ls -ltr
total 1708
-rw-r----- 1 oracle oinstall 61948 Aug 1 23:32 huateng_ora_13543_i11041.trm
-rw-r----- 1 oracle oinstall 1675094 Aug 1 23:32 huateng_ora_13543_i11041.trc
[oracle@db2server incdir_11041]$ more huateng_ora_13543_i11041.trc
Dump file /u01/app/oracle/diag/rdbms/huateng/huateng/incident/incdir_11041/huateng_ora_13543_i11041.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/db11gr2
System name: Linux
Node name: db2server
Release: 2.6.18-92.el5
Version: #1 SMP Tue Jun 10 18:49:47 EDT 2008
Machine: i686
Instance name: huateng
Redo thread mounted by this instance: 1
Oracle process number: 30
Unix process pid: 13543, image: oracle@db2server (TNS V1-V3)
*** 2012-08-01 23:32:13.444
*** SESSION ID:(49.13) 2012-08-01 23:32:13.444
*** CLIENT ID:() 2012-08-01 23:32:13.444
*** SERVICE NAME:(SYS$USERS) 2012-08-01 23:32:13.444
*** MODULE NAME:(sqlplus@db2server (TNS V1-V3)) 2012-08-01 23:32:13.444
*** ACTION NAME:() 2012-08-01 23:32:13.444
Dump continued from file: /u01/app/oracle/diag/rdbms/huateng/huateng/trace/huateng_ora_13543.trc
ORA-07445: exception encountered: core dump [kslgetl()+18] [SIGSEGV] [ADDR:0x600075F8] [PC:0xF052F62] [Address not mapped to object] []
========= Dump for incident 11041 (ORA 7445 [kslgetl()+18]) ========
----- Beginning of Customized Incident Dump(s) -----
Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x600075F8] [PC:0xF052F62, kslgetl()+18] [flags: 0x0, count: 1]
Registers:
%eax: 0x600075f0 %ebx: 0x00000000 %ecx: 0x0f052f50
%edx: 0x00000000 %edi: 0x600075f0 %esi: 0x00000001
%esp: 0xbfa8a5f4 %ebp: 0xbfa8a604 %eip: 0x0f052f62
%efl: 0x00010282
kslgetl()+6 (0xf052f56) mov %edi,0xfffffffc(%ebp)
kslgetl()+9 (0xf052f59) mov %esi,0xfffffff4(%ebp)
kslgetl()+12 (0xf052f5c) mov %ebx,0xfffffff8(%ebp)
kslgetl()+15 (0xf052f5f) mov 0x8(%ebp),%edi
> kslgetl()+18 (0xf052f62) movzw 0x8(%edi),%ecx
kslgetl()+22 (0xf052f66) lea (%ecx,%ecx,2),%eax
kslgetl()+25 (0xf052f69) mov 0xf545a10(,%eax,8),%edx
kslgetl()+32 (0xf052f70) test %edx,%edx
kslgetl()+34 (0xf052f72) jnz 0xf05324b
*** 2012-08-01 23:32:13.504
ALERT文件中会告知此次创建信息:
Wed Aug 01 23:32:12 2012
Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x600075F8] [PC:0xF052F62, kslgetl()+18] [flags: 0x0, count: 1]
Errors in file /u01/app/oracle/diag/rdbms/huateng/huateng/trace/huateng_ora_13543.trc (incident=11041):
ORA-07445: exception encountered: core dump [kslgetl()+18] [SIGSEGV] [ADDR:0x600075F8] [PC:0xF052F62] [Address not mapped to object] []
Incident details in: /u01/app/oracle/diag/rdbms/huateng/huateng/incident/incdir_11041/huateng_ora_13543_i11041.trc
Wed Aug 01 23:32:14 2012
Trace dumping is performing id=[cdmp_20120801233214]
Wed Aug 01 23:32:17 2012
Sweep [inc][11041]: completed
Sweep [inc2][11041]: completed
上面日志文件中显示的huateng_ora_13543.trc 是跟踪文件,huateng_ora_13543_i11041.trc是DUMP文件。
我们也可以通过ADRCI工具来找到跟踪文件,如下:
adrci> show incident
ADR Home = /u01/app/oracle/diag/rdbms/huateng/huateng:
*************************************************************************
INCIDENT_ID PROBLEM_KEY CREATE_TIME
-------------------- ----------------------------------------------------------- ----------------------------------------
11041 ORA 7445 [kslgetl()+18] 2012-08-01 23:32:13.324000 +08:00
19306 ORA 1578 2012-08-06 19:28:42.011000 +08:00
19354 ORA 1578 2012-08-06 19:29:01.932000 +08:00
19355 ORA 1578 2012-08-06 19:29:09.383000 +08:00
19356 ORA 1578 2012-08-06 19:29:28.922000 +08:00
25414 ORA 600 [2252] 2012-08-07 23:25:03.801000 +08:00
25454 ORA 600 [2252] 2012-08-07 23:25:09.263000 +08:00
25462 ORA 600 [2252] 2012-08-07 23:25:10.793000 +08:00
25415 ORA 600 [2252] 2012-08-07 23:25:11.049000 +08:00
25416 ORA 600 [2252] 2012-08-07 23:25:17.087000 +08:00
34962 ORA 600 [2608] 2012-08-14 11:26:16.424000 +08:00
42163 ORA 600 [3688] 2012-08-16 05:13:34.745000 +08:00
66276 ORA 4031 2012-11-05 23:39:23.913000 +08:00
66277 ORA 4031 2012-11-05 23:44:37.593000 +08:00
66284 ORA 4031 2012-11-05 23:49:24.553000 +08:00
15 rows fetched
adrci> show trace -i 11041
Output the results to file: /tmp/utsout_9769_308617_2.ado
/u01/app/oracle/diag/rdbms/huateng/huateng/incident/incdir_11041/huateng_ora_13543_i11041.trc
----------------------------------------------------------
LEVEL PAYLOAD
----- ------------------------------------------------------------------------------------------------------------------------------------------------
Dump file /u01/app/oracle/diag/rdbms/huateng/huateng/incident/incdir_11041/huateng_ora_13543_i11041.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/db11gr2
System name: Linux
Node name: db2server
Release: 2.6.18-92.el5
Version: #1 SMP Tue Jun 10 18:49:47 EDT 2008
Machine: i686
Instance name: huateng
Redo thread mounted by this instance: 1
Oracle process number: 30
Unix process pid: 13543, image: oracle@db2server (TNS V1-V3)
*** 2012-08-01 23:32:13.444
*** SESSION ID:(49.13) 2012-08-01 23:32:13.444
*** CLIENT ID:() 2012-08-01 23:32:13.444
*** SERVICE NAME:(SYS$USERS) 2012-08-01 23:32:13.444
*** MODULE NAME:(sqlplus@db2server (TNS V1-V3)) 2012-08-01 23:32:13.444
*** ACTION NAME:() 2012-08-01 23:32:13.444
Dump continued from file: /u01/app/oracle/diag/rdbms/huateng/huateng/trace/huateng_ora_13543.trc
1> ***** Error Stack *****
ORA-07445: exception encountered: core dump [kslgetl()+18] [SIGSEGV] [ADDR:0x600075F8] [PC:0xF052F62] [Address not mapped to object] []
1< ***** Error Stack *****
1> ***** Dump for incident 11041 (ORA 7445 [kslgetl()+18]) *****
2> ***** Beginning of Customized Incident Dump(s) *****
Exception [type: SIGSEGV, Address not mapped to object] [ADDR:0x600075F8] [PC:0xF052F62, kslgetl()+18] [flags: 0x0, count: 1]
Registers:
%eax: 0x600075f0 %ebx: 0x00000000 %ecx: 0x0f052f50
%edx: 0x00000000 %edi: 0x600075f0 %esi: 0x00000001
%esp: 0xbfa8a5f4 %ebp: 0xbfa8a604 %eip: 0x0f052f62
%efl: 0x00010282
show trace -i 11041命令显示了incient id 为11041的DUMP文件内容,
同时DUMP文件中记录了TRACE文件位置:
Dump continued from file: /u01/app/oracle/diag/rdbms/huateng/huateng/trace/huateng_ora_13543.trc