We help IT Professionals succeed at work.

Alert log alertSID.log

shasta123
shasta123 asked
on
Medium Priority
778 Views
Last Modified: 2008-01-16
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?
Comment
Watch Question

Author

Commented:
Also does the alert log tracks the DML as well as DDL on all the database objects by giving the timestamp?
Commented:
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 ...

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

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
johnsoneSenior Oracle DBA
CERTIFIED EXPERT

Commented:
The rename works fine in UNIX.  There is no need to truncate the file.  The instance does not keep the file open.
Database Administrator
CERTIFIED EXPERT
Commented:
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.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.