4 Replies Latest reply: Aug 16, 2010 7:45 AM by 618702 RSS

    Listener log issue

    778369
      hi,

      As the listener.log file grows, the DBA will want to either remove or rename this log file.
        • 1. Re: Listener log issue
          Rajesh Lathwal
          Please follow :

          http://racdba.wordpress.com/2010/03/08/recycling-the-listener-log-file/

          Regards
          Rajesh
          • 2. Re: Listener log issue
            Chinar
            user1175505 wrote:
            hi,

            As the listener.log file grows, the DBA will want to either remove or rename this log file.
            Zip or rar(in linux you can use tar) then move to other directory and continue
            • 3. Re: Listener log issue
              Ulfet Tanriverdiyev
              cp listener.log ..../listener.log_archive;
              cat /dev/null > .../listener.ora -- same as truncate table :)
              • 4. Re: Listener log issue
                618702
                Dear user1175505,

                You can either back the old and big listener.log file up or you may just simply delete! :)

                However, if you change the name of it and create a new listener.log file, you need to show it to the Oracle otherwise the Oracle will not start writing in that new log file.

                Here is an illustration for you;
                $ lsnrctl show log_file;
                
                LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 16-AUG-2010 15:39:28
                
                Copyright (c) 1991, 2007, Oracle.  All rights reserved.
                
                Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
                LISTENER parameter "log_file" set to listener.log
                The command completed successfully
                
                $ lsnrctl show log_file;
                
                LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 16-AUG-2010 15:39:28
                
                Copyright (c) 1991, 2007, Oracle.  All rights reserved.
                
                Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
                LISTENER parameter "log_file" set to listener.log
                The command completed successfully
                $ lsnrctl show log_directory;
                
                LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 16-AUG-2010 15:39:52
                
                Copyright (c) 1991, 2007, Oracle.  All rights reserved.
                
                Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
                LISTENER parameter "log_directory" set to /opt/oracle/product/10.2.0/db_1/network/log/
                The command completed successfully
                
                --> Listener.log file name is listener.log and the directory is /opt/oracle/product/10.2.0/db_1/network/log/
                --> Now lets simply delete the listener.log file.
                
                $ rm /opt/oracle/product/10.2.0/db_1/network/log/listener.log
                
                --> Create a new listener.log file.
                
                $ cat /opt/oracle/product/10.2.0/db_1/network/log/listener.log
                $ --> So it is empty.
                
                $ sqlplus sys/password@opttest as sysdba
                
                SQL*Plus: Release 10.2.0.4.0 - Production on Mon Aug 16 15:41:23 2010
                
                Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
                
                
                Connected to:
                Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
                With the Partitioning, OLAP, Data Mining and Real Application Testing options
                
                SQL> exit
                Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
                With the Partitioning, OLAP, Data Mining and Real Application Testing options
                $ cat /opt/oracle/product/10.2.0/db_1/network/log/listener.log
                $ --> STILL EMPTY!!
                
                --> So now we need to set the logfile;
                
                $ lsnrctl set log_file /opt/oracle/product/10.2.0/db_1/network/log/listener.log
                
                LSNRCTL for HPUX: Version 10.2.0.4.0 - Production on 16-AUG-2010 15:41:52
                
                Copyright (c) 1991, 2007, Oracle.  All rights reserved.
                
                Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
                LISTENER parameter "log_file" set to /opt/oracle/product/10.2.0/db_1/network/log/listener.log
                The command completed successfully
                
                LSNRCTL> set log_status off;
                Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
                LISTENER parameter "log_status" set to OFF
                The command completed successfully
                LSNRCTL> set log_status on;
                Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=optdb)(PORT=1521)))
                LISTENER parameter "log_status" set to ON
                The command completed successfully
                LSNRCTL> exit
                $ ls -lrt
                total 89736
                -rw-r-----   1 oracle     oinstall      1480 Mar  5  2009 opttest.log
                -rw-r-----   1 oracle     oinstall   45932608 May 28 00:34 sqlnet.log
                -rw-r-----   1 oracle     oinstall        38 Aug 16 15:44 listener.log
                $ cat listener.log
                16-AUG-2010 15:44:31 * log_status * 0
                
                $ sqlplus aircom/password@opttest
                
                SQL*Plus: Release 10.2.0.4.0 - Production on Mon Aug 16 15:44:52 2010
                
                Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
                
                
                Connected to:
                Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
                With the Partitioning, OLAP, Data Mining and Real Application Testing options
                
                SQL> exit
                Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
                With the Partitioning, OLAP, Data Mining and Real Application Testing options
                $ ls -lrt
                total 89736
                -rw-r-----   1 oracle     oinstall      1480 Mar  5  2009 opttest.log
                -rw-r-----   1 oracle     oinstall   45932608 May 28 00:34 sqlnet.log
                -rw-r-----   1 oracle     oinstall       255 Aug 16 15:44 listener.log
                $ cat listener.log
                16-AUG-2010 15:44:31 * log_status * 0
                16-AUG-2010 15:44:52 * (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=opttest)(CID=(PROGRAM=sqlplus@optdb)(HOST=optdb)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.6.105.131)(PORT=49787)) * establish * opttest * 0
                $
                Hope That Helps.

                Ogan