Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    67

    Unanswered: truncate listener log on windows

    Hi all,

    The listener "listens" to 2 oracle instances.
    The log of one instance is too big, so I want to truncate it.
    I saw there are several ways to do it on linux, but these are running on windows.

    I see I have to tell listener the instance for every command, otherwise it doesn't work
    e.g.
    LSNRCTL> status
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    TNS-12541: TNS:no listener
    TNS-12560: TNSrotocol adapter error
    TNS-00511: No listener
    32-bit Windows Error: 61: Unknown error
    LSNRCTL>

    If I write the name of the instance:

    LSNRCTL> status pldwhd01
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*****.ne t
    )(PORT=49354)))
    STATUS of the LISTENER
    ------------------------
    Alias PLDWHD01
    Version TNSLSNR for 32-bit Windows: Version 10.2.0.3.
    ction
    Start Date 23-JAN-2009 10:00:19
    Uptime 54 days 4 hr. 17 min. 45 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File F:\Oracle\Ora102\network\admin\listener.ora
    Listener Log File F:\Oracle\Ora102\network\log\pldwhd01.log

    Now, how can I stop logging, delete the file and the start logging again ?

    LSNRCTL> show trc_level
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    TNS-12541: TNS:no listener
    TNS-12560: TNSrotocol adapter error
    TNS-00511: No listener
    32-bit Windows Error: 61: Unknown error
    LSNRCTL>

    It seems that I have to tell the instance name, is that right ?
    If so, How can I do that?

    Thanks in advence

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Talking Do what?

    +
    What do you want to do?
    Truncate the listener logs or supply the instance name to the listener control program?

    To truncate the listener logs, write a batch script and schedule to run once a week or month:
    Code:
    rem -- -----------------------------------------
    rem -- delete_logs.cmd: Truncate listener logs
    rem --
    cd F:\Oracle\Ora102\network\log\
    copy /Y pldwhd01.log pldwhd01.log-bak
    echo > pldwhd01.log
    copy /Y pldwhd02.log pldwhd02.log-bak
    echo > pldwhd02.log
    Or....just search the web for a better script.


    To supply the instance name:
    Code:
    C:\> set ORACLE_SID=pldwhd01
    C:\> lsnrctl status
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Sep 2005
    Posts
    67
    Hi thanks for you answers.

    What I need to do is to truncate the log, today, without taking the listener down.

    ORACLE_SID is set, but if I don't specify the SID on lsnrctl, it doesn't work.

    Look:

    F:\Oracle\Ora102\OPatch>set oracle_sid
    oracle_sid=PLDWHD01

    F:\Oracle\Ora102\OPatch>lsnrctl status

    LSNRCTL for 32-bit Windows: Version 10.2.0.3.0 - Production on 18-MAR-2009
    :01

    Copyright (c) 1991, 2006, Oracle. All rights reserved.

    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    TNS-12541: TNS:no listener
    TNS-12560: TNSrotocol adapter error
    TNS-00511: No listener
    32-bit Windows Error: 61: Unknown error

    F:\Oracle\Ora102\OPatch>

    Best regards,
    Diego.

    Quote Originally Posted by LKBrwn_DBA
    +
    What do you want to do?
    Truncate the listener logs or supply the instance name to the listener control program?

    To truncate the listener logs, write a batch script and schedule to run once a week or month:
    Code:
    rem -- -----------------------------------------
    rem -- delete_logs.cmd: Truncate listener logs
    rem --
    cd F:\Oracle\Ora102\network\log\
    copy /Y pldwhd01.log pldwhd01.log-bak
    echo > pldwhd01.log
    copy /Y pldwhd02.log pldwhd02.log-bak
    echo > pldwhd02.log
    Or....just search the web for a better script.


    To supply the instance name:
    Code:
    C:\> set ORACLE_SID=pldwhd01
    C:\> lsnrctl status

  4. #4
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool Forget the listener...

    To truncate the listener logs you do not need to stop/start the listener, just do this:
    Code:
    cd F:\Oracle\Ora102\network\log\
    REM Backup the logs
    COPY /Y pldwhd01.log X:\backup\pldwhd01.log-bak
    COPY /Y pldwhd02.log X:\backup\pldwhd02.log-bak
    REM Initialize the logs
    ECHO > pldwhd01.log
    ECHO > pldwhd02.log
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •