Friday, 5 August 2011

What to do if by mistake listener.log got removed while the listener is keep running

Until 11g there is no option to rotate the alert/listener.log ( text format). ADRCI has purge option to housekeep the old listener/alert.xml file. infact *.log ( text format) is there for downward compatibility.

DBAs housekeep the listener.log using various methods like
   1. cat /dev/null >listener.log ( after taking backup)
   2. split the listener.log file and remove the old contents using text editor like vi....
   3. temporarily off the log off and take backup of the file and cat /dev/null the listener.log

Sometime by mistake we remove the listener.log and oracle stop writting into the listener.log even if we create a file with the same name.It is because the listener process has the file descriptor open and it will keep open it even if we remove the file.Because of that you can notice the filesystem where the listener log resides doesnot release the space even afetr the removal of file.

There is a workaround to fix this without stop and start the listener. Just stop and start the log_status.

   lsrnctl > set current_listener  LISTENER_ABC1
  LSNRCTL> set current_listener LISTENER_ABC1
Current Listener is LISTENER_ABC1
LSNRCTL> set current_listener LISTENER_ABC1
Current Listener is LISTENER_ABC1
LSNRCTL> set log_status off
Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=ABC1))
LISTENER_ABC1 parameter "log_status" set to OFF
The command completed successfully
LSNRCTL> set log_status on
Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=ABC1))
LISTENER_ABC1 parameter "log_status" set to ON
The command completed successfully

now you can see the listener.log will be updated by listener process.





 

3 comments:

  1. Simply desire to say your article is as amazing.

    The clearness in your post is just spectacular and i could
    assume you are an expert on this subject. Fine with your permission let
    me to grab your feed to keep up to date with forthcoming post.
    Thanks a million and please keep up the enjoyable work.



    Safe Garcinia

    ReplyDelete
  2. It's amazing in favor of me to have a web page, which is useful in favor of my know-how. thanks admin


    buy Dermallo

    ReplyDelete
  3. Nice blog here! Also your website loads up fast!
    What host are you using? Can I get your affiliate link to your host?
    I wish my website loaded up as fast as yours lol


    Goji Berry Reviews

    ReplyDelete

ZFS

Public Cloud tools comparison