当前位置:数据库 > Oracle >>

Oracle 11g中告警日志的位置

Oracle 11g中告警日志的位置
 
Oracle 11g 中告警日志的位置  
1.通过查询v$diag_info视图获得ADR相关的信息
ADR(Automatic Diagnostic Repository)--> A a file-based hierarchical data store for managing diagnostic information, including network tracing and logging.

 

代码:
sys@ora11g>select * from v$diag_info;
INST_ID NAME VALUE
------- ---------------------- ----------------------------------------------
1 Diag Enabled TRUE
1 ADR Base /oracle/u01/app/oracle
1 ADR Home /oracle/u01/app/oracle/diag/rdbms/ora11g/ora11g
1 Diag Trace /oracle/u01/app/oracle/diag/rdbms/ora11g/ora11g/trace
1 Diag Alert /oracle/u01/app/oracle/diag/rdbms/ora11g/ora11g/alert
1 Diag Incident /oracle/u01/app/oracle/diag/rdbms/ora11g/ora11g/incident
1 Diag Cdump /oracle/u01/app/oracle/diag/rdbms/ora11g/ora11g/cdump
1 Health Monitor /oracle/u01/app/oracle/diag/rdbms/ora11g/ora11g/hm
1 Default Trace File /oracle/u01/app/oracle/diag/rdbms/ora11g/ora11g/trace/ora11g_ora_3968.trc
1 Active Problem Count 0
1 Active Incident Count 0
11 rows selected.

 

2.其中Diag Trace对应的目录为文本格式的警告日志,及我们经常习惯使用的日志
代码:
ora11g@RHEL53 /oracle/u01/app/oracle/diag/rdbms/ora11g/ora11g/trace$ls -l alert_ora11g.log
-rw-r----- 1 oracle oinstall 72513 Feb 27 14:29 alert_ora11g.log

 

3.其中Diag Alert对应的目录为XML格式的警告日志
代码:
ora11g@RHEL53 /oracle/u01/app/oracle/diag/rdbms/ora11g/ora11g/alert$ls -l log.xml
-rw-r----- 1 oracle oinstall 327254 Feb 27 14:29 log.xml

 

4.我习惯将查看警告日志定义为同名alert在操作系统上直接查看
代码:
ora11g@RHEL53 /home/oracle$alias alert
alias alert='tail -200f $ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace/alert_$ORACLE_SID.log'

 

5.使用同名进行查看
代码:
ora11g@RHEL53 /home/oracle$alert

 


CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,