欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Oracle如何动态显示日志?

程序员文章站 2023-12-12 09:39:22
1.查看日志文件位置; ind_user@prod>select inst_id,name,value from v$diag_info;    inst_id name...

1.查看日志文件位置;

ind_user@prod>select inst_id,name,value from v$diag_info;

   inst_id name                 value

---------- -------------------- --------------------------------------------------

         1 diag enabled         true

         1 adr base             /u01/app/oracle

         1 adr home             /u01/app/oracle/diag/rdbms/prod/prod

         1 diag trace           /u01/app/oracle/diag/rdbms/prod/prod/trace

         1 diag alert           /u01/app/oracle/diag/rdbms/prod/prod/alert

         1 diag incident        /u01/app/oracle/diag/rdbms/prod/prod/incident

         1 diag cdump           /u01/app/oracle/diag/rdbms/prod/prod/cdump

         1 health monitor       /u01/app/oracle/diag/rdbms/prod/prod/hm

         1 default trace file   /u01/app/oracle/diag/rdbms/prod/prod/trace/prod_or

                                a_4873.trc

         1 active problem count 0

         1 active incident coun 0

           t

 --alert目录为一个xml文件;

 --trace目录中为文本文件;

[oracle@jibo trace]$ pwd

/u01/app/oracle/diag/rdbms/prod/prod/trace

[oracle@jibo trace]$ ll -atl|grep alert*

-rw-r-----  1 oracle oinstall 99797 sep 29 14:54 alert_prod.log

[oracle@jibo trace]$ tail -f alert_prod.log 

mon sep 29 14:43:34 2014

starting background process smco

mon sep 29 14:43:34 2014

smco started with pid=28, os id=4709 

mon sep 29 14:54:57 2014

thread 1 advanced to log sequence 12 (lgwr switch)

  current log# 3 seq# 12 mem# 0: /u01/app/oracle/oradata/prod/onlinelog/o1_mf_3_b22567o2_.log

  current log# 3 seq# 12 mem# 1: /u01/app/oracle/fast_recovery_area/prod/onlinelog/o1_mf_3_b2256827_.log

mon sep 29 14:54:58 2014

archived log entry 7 added for thread 1 sequence 11 id 0x102473b1 dest 1:

--操作下查看alert日志,用tail指令;

有什么改动,日志文件就会产生相应的记录

用于查看学习测试最好不过

上一篇:

下一篇: