Rotating Oracle Listener.log file

Oracle database logs doesn’t rotate by it self.
As time goes by, the server may hold logs that are too big to read and takes too much storage space.
This can get your server to a maximum capacity or cause the listener can’t start.

The best solution is to use logrotate:

There are 2 log files needs to be rotate:
Alert log and Listener log

Create new logrotate rules by edit a files under /etc/logrotate.d/

/etc/logrotate.d/oracle-alert

/etc/logrotate.d/oracle-listener

Notice:delaycompress
This command can be useful if you want the archived logs to be compressed, but not right away.
With “delaycompress” active an archived log won’t be compressed until the next time the log is rotated.
Note that “delaycompress” only works if you also have “compress” in your config.

To test it out:
/usr/sbin/logrotate -vdf /etc/logrotate.conf

To force run it:
/usr/sbin/logrotate -vf /etc/logrotate.conf

Reference:
http://articles.slicehost.com/2010/6/30/understanding-logrotate-on-centos-part-1
http://articles.slicehost.com/2010/6/30/understanding-logrotate-on-centos-part-2

8 Replies to “Rotating Oracle Listener.log file”

  1. What i don’t realize is actually how you are not really much more neatly-appreciated than you may be now. You are very intelligent. You recognize therefore significantly in terms of this subject, produced me in my opinion believe it from so many various angles. Its like women and men are not involved until it is one thing to do with Lady gaga! Your own stuffs great. All the time maintain it up!

  2. Somebody essentially help to make seriously articles I might state. This is the first time I frequented your web page and to this point? I surprised with the analysis you made to make this actual post extraordinary. Great task!

  3. I was actually excited enough to drop a commenta response 😉 I do have 2 questions for you if you do not mind. Could it be just me or do a few of these comments come across like they are coming from brain dead folks? And, if you are posting at additional sites, I

  4. Want to make people visit a blog and don’t know how. Also can you give me a good blogging site that people visit a lot. Do they visit your blog within the blog site or externally?? Thanks..

  5. Hi,

    I didn’t understand one thing:
    Why do you use the parameter “rotate 31” if you rotate only the listener.log?

    Regards.
    Anatoli

Leave a Reply

Your email address will not be published. Required fields are marked *