6 Replies Latest reply: Dec 24, 2012 12:48 AM by pokharel RSS

    Purging listener.log

    pokharel
      Hello,

      We are using oracle 10gr2 in aix system. My listener.log file is growing continuously and I want to rename the log file to listener.old and create a new empty listener.log. I have found a method in the internet that seems to be good.

      % lsnrctl set log_status off
      % mv listener.log listener.old
      % lsnrctl set log_status on

      I have one question on this. Will the last line create a new listener.log file and new logs will be written in that ? If now hot do I create a new listener.log file and make the logs written there.

      Thank you
        • 1. Re: Purging listener.log
          Niket Kumar
          when you rename listener log oracle automatically create new listener.log file and you can zipp old file for future refrences....or you can delete it...
          • 2. Re: Purging listener.log
            pokharel
            I think that is true only for alert log files but not listener log files. Or am I wrong ? Also oracle keeps a handle for the log file, so after renaming oracle will keep on writing to the old log file ?

            Edited by: pokharel on Dec 22, 2012 10:57 PM
            • 3. Re: Purging listener.log
              Osama_Mustafa
              pokharel wrote:
              I think that is true only for alert log files but not listener log files. Or am I wrong ? Also oracle keeps a handle for the log file, so after renaming oracle will keep on writing to the old log file ?

              Edited by: pokharel on Dec 22, 2012 10:57 PM
              Listener is different From alert.log Since its Open All the time and to delete it :

              Just do the following ( you have more than One way)
              $> lsnrctl
              LSNRCTL> set current_listener <listener_name>
              LSNRCTL> show log_file
              LSNRCTL> set log_file <new log file name>
              LSNRCTL> show log_file
              LSNRCTL> exit
              And remove the old one .


              Refer to
              http://dbtricks.com/?p=95
              • 4. Re: Purging listener.log
                Niket Kumar
                you can go with your solution.....I think i am wrong here......

                this post will help you...

                Listener log issue
                • 5. Re: Purging listener.log
                  Shivananda Rao
                  Hello,

                  You can rename the listener log file using the steps you mentioned in your very first post on this thread.
                  1. Set the listener log status to off.
                  2. Rename the current listener.log file.
                  3. Set the listener log status to on. Oracle automatically generates a new listener.log file.
                  Here is an example for you.
                  [oracle@ora1-1 ~]$ cd /u01/app/oracle/diag/tnslsnr/ora1-1/listener/trace
                  [oracle@ora1-1 trace]$ ls -lrth
                  total 588K
                  -rw-r----- 1 oracle oinstall 581K Dec 23 19:32 listener.log
                  [oracle@ora1-1 trace]$ lsnrctl set log_status off
                  
                  LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 23-DEC-2012 19:33:08
                  
                  Copyright (c) 1991, 2011, Oracle.  All rights reserved.
                  
                  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora1-1.mydomain)(PORT=1521)))
                  LISTENER parameter "log_status" set to OFF
                  The command completed successfully
                  [oracle@ora1-1 trace]$ ls -lrth
                  total 588K
                  -rw-r----- 1 oracle oinstall 581K Dec 23 19:32 listener.log
                  [oracle@ora1-1 trace]$ mv listener.log listener_old.log
                  [oracle@ora1-1 trace]$ lsnrctl set log_status on
                  
                  LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 23-DEC-2012 19:33:32
                  
                  Copyright (c) 1991, 2011, Oracle.  All rights reserved.
                  
                  Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora1-1.mydomain)(PORT=1521)))
                  LISTENER parameter "log_status" set to ON
                  The command completed successfully
                  [oracle@ora1-1 trace]$ ls -lrth
                  total 592K
                  -rw-r----- 1 oracle oinstall 581K Dec 23 19:32 listener_old.log
                  -rw-r----- 1 oracle oinstall   70 Dec 23 19:33 listener.log
                  pokharel     
                       
                  Handle:     pokharel
                  Status Level:     Newbie
                  Registered:     Sep 11, 2012
                  Total Posts:     8
                  Total Questions:     4 (3 unresolved)
                  Please consider closing your threads by providing appropriate points if you feel that they have been answered. Please keep the forum clean !!


                  Regards,
                  Shivananda
                  • 6. Re: Purging listener.log
                    pokharel
                    Thank you. Now I have closed the threads. Thank you for pointing it out.