在一次数据库检查过程中,发现数据库近一天内没有任何日志输出,甚至没有正常切换归档日志的信息;但数据库运行正常,业务运行正常:
手动执行alter system switch logfile;正常,但alert_sid.log中没有日志信息:
如下:
[root@test bdump]# date
Sat May 7 09:21:16 CST 2016
[root@test bdump]# tail -f alert_test.log
Completed: ALTER DATABASE OPEN
Fri May 06 08:57:25 CST 2016
Thread 1 advanced to log sequence 9546 (LGWR switch)
Current log# 1 seq# 9546 mem# 0: /test/oradata/test/onlinelog/o1_mf_1_9oyvfc0w_.log
Fri May 06 08:59:30 CST 2016
Thread 1 advanced to log sequence 9547 (LGWR switch)
Current log# 2 seq# 9547 mem# 0: /test/oradata/test/onlinelog/o1_mf_2_9oyvfjp3_.log
当前时间为5月7日9:21:16,但alert_test.log日志信息最终截止于5月6日8:59:30。
检查确认该文件最后修改时间为5月6日9:01:
[root@test bdump]# ll
total 4504
-rw-r----- 1 root root 1825837 May 6 09:01 alert_test.log
于是修改如下:
[root@test bdump]# chown oracle:oinstall alert_test.log
再次查看alert_test.log,归档日志切换正常,日志记录信息正常:
[root@test bdump]# tail -f alert_test.log
Completed: ALTER DATABASE OPEN
Fri May 06 08:57:25 CST 2016
Thread 1 advanced to log sequence 9546 (LGWR switch)
Current log# 1 seq# 9546 mem# 0: /test/oradata/test/onlinelog/o1_mf_1_9oyvfc0w_.log
Fri May 06 08:59:30 CST 2016
Thread 1 advanced to log sequence 9547 (LGWR switch)
Current log# 2 seq# 9547 mem# 0: /test/oradata/test/onlinelog/o1_mf_2_9oyvfjp3_.log
Fri May 06 09:00:36 CST 2016
Thread 1 advanced to log sequence 9548 (LGWR switch)
Current log# 3 seq# 9548 mem# 0: /test/oradata/test/onlinelog/o1_mf_3_9oyvfpgh_.log
Sat May 07 09:21:26 CST 2016
Thread 1 advanced to log sequence 9603 (LGWR switch)
Current log# 3 seq# 9603 mem# 0: /test/oradata/test/onlinelog/o1_mf_3_9oyvfpgh_.log