Oracle's alert.log

本文详细介绍了Oracle数据库中alert.log文件的作用及其包含的信息类型,包括启动、关闭实例消息、错误记录及SQL操作等,并提供了分析、旋转及写入自定义消息的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >



Oracle's alert.log chronologically records messages and errors arising from the daily database operation. Also, there are pointers to trace files and dump files.
These messages include
alert.log is a text file that can be opened with any text editor. The directory where it is found can be determined by the background_dump_dest initialization parameter:
select value from v$parameter where name = 'background_dump_dest

';
If the background_dump_dest parameter is not specified, Oracle will write the alert.log into the $ORACLE_HOME /RDBMS/trace directory.
Here's a shell/ awk script to analyze alert logs .

Common messages in the alert log

ARCx: Media recovery disabled

This message will be written into the alert.log if the arch process is started with the database being in noarchive log mode .
It's unfortunately possible for ARCH to be sitting around doing nothing apart from just taking up memory when the database is in noarchive log mode.
The archiver can be stopped dynamically: alter system archive log stop .

Ignoring SIGALARM

Such a message is written into the alert log when a process that waited for a semaphore gets the semaphore shortly befor the timeout expires and doesn't have the time to switch the timeout mechanism off.

Thread 1 cannot allocate new log, sequence 1558 Checkpoint not complete

This error message is written into the alert.log if a checkpoint cannot write all dirty db blocks to the online redo log .
Usually, this message is a sign that the size of the redo logs is to small or that there should be more of them.

Rotating the alert logs

Within Oracle, it is perfectly possible to delete, or rename, the alert.log, if desired (for example, if it reaches a certain size). Oracle simply recreates a new alert.log the next time it writes to it.
Linux (and other Unixes?) has an utility called logrotate to automate that task.

Writing own messages into the alert log

The undocumented procedure kdswrt in dbms_system allows to write own messages in the alert log.
begin
  sys.dbms_system

.ksdwrt(2, 'My own message');
end;
/

Reading the alert log through an external table

Here is a procedure which creates an external table that can be used to read the alert.log.
There is also a script to read the alert log which doesn't require a procedure such as the previous link.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值