分类: Oracle
2010-05-14 11:16:49
Oracle 11g alert文件的变化(后台报警日志)
一.首先介绍2个新名词
Automatic Diagnostic Repository (ADR)—
一个存放数据库诊断日志、跟踪文件的目录,称作ADR base,对应初始化参数DIAGNOSTIC_DEST,如果设置了ORACLE_BASE环境变量,
DIAGNOSTIC_DEST等于ORACLE_BASE,如果没有设置ORACLE_BASE,则等与ORACLE_HOME/log。
PHP code:
SQL>show parameter ------------------------------------DIAGNOSTIC
NAMETYPE VALUE
----------- diagnostic_dest------------------------------
/home/oracle string
......
ADRCI Command-Line Utility 命令行工具
使用该工具查看日志,跟踪信息,查看健康报告。
二.一个比较大的变化:aelrt xml file
在oracle 11g中,alert文件的信息是以xml的文件格式存在的,另外提供了普通文本格式的alert文件。
这两份log文件的位置分别是V$DIAG_INFO中的Diag Alert 和Diag Trace 对应的目录。
PHP code:
1*SELECT * FROM V$DIAG_INFO ----------
INST_ID NAME VALUE
------------------------- 1------------------------------------------------------------
Diag /home/oracleEnabled TRUE
1 ADR Base
1 /home/oracle/diag/rdbms/orcl/orclADR Home
1 /home/oracle/diag/rdbms/orcl/orcl/traceDiag Trace
1 /home/oracle/diag/rdbms/orcl/orcl/alertDiag Alert
1 /home/oracle/diag/rdbms/orcl/orcl/incidentDiag Incident
1 /home/oracle/diag/rdbms/orcl/orcl/cdumpDiag Cdump
1 /home/oracle/diag/rdbms/orcl/orcl/hmHealth Monitor
1 DefaultTrace File /home/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_12624.trc
1 Active Problem Count 0
1 Active Incident Count &nb
这个是xml格式的alert log:
PHP code:
[oracle@ractest~]$ cd /home/oracle/diag/rdbms/orcl/orcl/alert [oracle@ractest
alert ]$ls -l
total148 -rw-r-----
1 oracle :21dba 139355 Jul 3 08 log .xml
[oracle@ractestalert ]$tail log .xml<txt>QMNC
started =20,with pid OS id =8646txt>
msg>
<msgtime ='2007-07-03T08:21:31.911+08:00'org_id='oracle' comp_id='rdbms'
msg_id='opiexe:2925:2802784106' type='NOTIFICATION' group='admin_ddl'
level='16' host_id='ractest' host_addr='10.200.15.180'
module='sqlplus@ractest (TNS pid='8640'>V1-V3)'
< txt>Completed:ALTER DATABASE txt>OPEN
msg>
[oracle@ractestalert ]$
这是文本格式的alert:
PHP code:
[oracle@ractesttrace ]$cd /home/oracle/diag/rdbms/orcl/orcl/trace
[oracle@ractesttrace ]$ls -l al *
-rw-r-----1 oracle :21dba 27988 Jul 3 08 alert_orcl .
SQL>create table astest select * from dba_objects <50;where rownum
Tablecreated .
SQL>insert into *test select from dba_objects <where rownum 10 ;
9rows .created
SQL>commit
/ 2
Commitcomplete .
SQL>delete from <test where rownum 30 ;
29rows .deleted
SQL>commit;
Commitcomplete .
SQL>drop table ;test
Tabledropped .