Database Monitoring   «Prev  Next»
Lesson 6Renaming alert log
ObjectiveDelete and rename old alert log entries.

Renaming Alert Log

The alert log for a database is always growing. For as long as the database is running, entries are being added. Left unchecked, this growth will result in all the space on the disk being consumed. At that point, Oracle won't be able to write anything more to the alert log, and database activity will halt. The solution is to delete the alert log periodically. Periodically deleting the alert log file carries with it one problem: You may need to refer to entries in the file that you just deleted. To combat that problem, you can rename the alert log file and embed the date as part of the name. For example:
NT: rename coinalrt.log coinalrt_991115.log

UNIX: mv coinalrt.log coinalrt_991115.log

Rename or delete Alert log file

You can rename or delete the alert log file while the database is running. There's no need to shut down the database first. After you've renamed the file, Oracle will create a new alert log the next time it writes out a log entry. With respect to the previous example, the next time Oracle writes a log entry, a new coinalrt.log file will be created. You should establish a retention schedule for alert log files; I usually keep them for one month, and rename them every week. Every time you rename a file, you should delete files containing entries that are older than your retention period. Keeping old alert log files around for a period of time is a good practice. In the next lesson, you will check the session high water mark for license compliance.