Search this blog

Wednesday, January 20, 2010

Oracle DBA - managing listener.log

As the listener.log file grows, we'll want to remove or rename it. This will fail as it's "being used by another process".
The DBA can simply stop the service, rename/remove the file and restart the service. This can be problematic for users attempting to connect while the listener's down.

Here's a good way to do this without stopping the TNS listener process. This'll work on Windows and with some small changes on Linux as well (ren = mv):
C:\cd \oracle\product\10.2.0\db_1\NETWORK\log
C:\oracle\product\10.2.0\db_1\NETWORK\log\lsnrctl set log_status off
C:\oracle\product\10.2.0\db_1\NETWORK\log\ren listener.log listener.old
C:\oracle\product\10.2.0\db_1\NETWORK\log\lsnrctl set log_status on

In Oracle 11g, the listener log files by default are located in /diag/tnslsnr/product_name/listener. The nice feature about listener log file in this version is, whenever the size of log file grow to 10MB, Oracle starts to writes to a new file. So the log file will not be too large to open for troubleshooting. Overtime, you will have a lot of 10MB log file in the directory. An Oracle DBA needs to manage the listener log files regularly so the log files will not take too much space on the server.

This is a great link with DBA Tips: http://www.idevelopment.info/

No comments:

Post a Comment