Alert log alertSID.log

I see my alert log on 10g to be one big huge file. HOw do i enable rotation on it? so that it is archived?
shasta123Asked:
Who is Participating?
 
Mark GeerlingsDatabase AdministratorCommented:
You can use a simple file rename command in an O/S script to rename the alert.log file in most O/S's  (Unix, Linux and Windows, at least) since Oracle does not keep the alert.log file locked, and if it doesn't see one when it tries to write the next entry, it will create a new one.  This script can be scheduled to run automatically in the O/S job scheduler at midnight for example, to rename the file each night.

No, the alert.log file does not contain audits of either DML or most DDL statements.  A few DDL statements are logged in the alert.log file, but usually only those that affect "major" parts of the database, like: datafiles, tablespaces, log files, etc.

If you want to audit DML and/or DDL activity, you will either have to turn on Oracle's auditing mechanism (but if you do, be preparared for a *LARGE* volume of data that you will have to manage!) or write triggers to capture this activity to logging table(s) or ASCII log files.
0
 
shasta123Author Commented:
Also does the alert log tracks the DML as well as DDL on all the database objects by giving the timestamp?
0
 
konektorCommented:
i don know any possibility to reuse alertlog not to grow in oracle, but you can do it in operating system. make a script, which will check file size, and when it will be bigger rename it to some "bak". Oracle will create init.ora again ...
0
 
MikeOM_DBACommented:

On Unix renaming the file may not work, you would need to copy (ifyou want to preserve old log) and truncate the log:

cp alertSID.log alert_SID.bak
>alertSID.log
0
 
johnsoneSenior Oracle DBACommented:
The rename works fine in UNIX.  There is no need to truncate the file.  The instance does not keep the file open.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.