Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Changing multiple listener log names
Tom,
I read that current_listener stuff and it must have went right over
my head.
I did try it but must have had something askew. Or need to clean my
glasses.
Yes we have a number of machines with multiple listeners
Looking at your script I came up with the following which worked great!
#!/bin/ksh
#Written by Lawrence Wolfson 05/02/06
#
# Thanks to Tom Mercadante
# Set listener log name without shutting down listener.
TIME_STAMP_LISTENER_LOG ()
{
if [ -f /oracle/source/ENV.${1} ]
then
. /oracle/source/ENV.${1} # Below generates listener_$2.10oct10fri and .log is appended to that. LOG="listener_$2.`date '+%m%b%e%a' | tr ' ' '0'`" print " set current_listener listener_$2 set log_file $LOG exit"|lsnrctl else echo "\n\n/oracle/source/ENV.${1} is not a file!\n\n"fi
# SID LOGID
TIME_STAMP_LISTENER_LOG ABAD 8171 TIME_STAMP_LISTENER_LOG ATID61 9205 TIME_STAMP_LISTENER_LOG DSND 8161 TIME_STAMP_LISTENER_LOG JIVD 9204 TIME_STAMP_LISTENER_LOG RA2D RA2D TIME_STAMP_LISTENER_LOG TRGD TRGD
Every time I want to shut off the listener log something comes up I have a use for.
Although, for some servers I have been thinking about shutting it off when the database is down and the app keeps trying to connect. Too much effort for app team to synchronize.
Thanks, Thanks, THANKS, Larry
-----Original Message-----
From: Mercadante, Thomas F (LABOR)
[mailto:Thomas.Mercadante_at_labor.state.ny.us]
Sent: Tuesday, May 02, 2006 2:09 PM
To: Wolfson Larry - lwolfs; oracle-l_at_freelists.org
Subject: RE: Changing multiple listener log names
Larry,
Are you running multiple listener processes on the same machine? Use the "set current_listener" command to change the name of the listener log. Something like:
LOG="listener.`date '+%m%b%e%a' | tr ' ' '0'`"
Echo "set current_listener listener_ra2p" > lisncmd.lsn Echo "set log_file $LOG" >> lisncmd.lsn Echo "exit" >> lisncmd.lsnLsnrctl < lisncmd.lsn
The above worked on an NT machine for me. Haven't tried it on Unix. One thing you probably know - you can set the name of the log file - but if you stop and start the listener, I think it gets reset to the default name. So you probably want to do the above a different way:
1). Change the name of the log file to something temporary. 2). Rename the existing log file with to a dated name like you are doing 3). Change the name of the log file back to its default.
Personally, I turn listener logging off so that I don't have to deal with this issue. I turn database logon auditing on to track connections.
Good Luck!
Tom
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Wolfson Larry -
lwolfs
Sent: Tuesday, May 02, 2006 2:47 PM
To: oracle-l_at_freelists.org
Subject: Changing multiple listener log names
We usually like to change the name of the listener log daily. This is an easy way to see fluctuations in an application or server and easier to scan when it isn't 5G.
With something like
# Below generates listener.10oct10fri and .log is appended to that.
LOG="listener.`date '+%m%b%e%a' | tr ' ' '0'`"
lsnrctl set log_file "$LOG"
Lots of times we've been told everyday is the same and still see 2.5
times as many connections every Friday.
Same day sales team has to have orders in.
Below you can see a database that is busier on Saturdays and for some reason Thursday Mar 30th.
We've a number of servers with multiple log names but haven't been able to figure out how to get their names changed.
Like these 2 here:
11907403 May 2 13:24 listener_ra2p.log
13546692 May 2 13:24 listener_trgp.log
Would like something like ==> listener_trgp05.may02tue.log How easy is
it?
Thanks
Larry
130915068 Mar 30 23:59 listener.03mar30thu.log 67752705 Mar 31 23:59 listener.03mar31fri.log 67920937 Apr 1 23:59 listener.04apr01sat.log 2925123 Apr 2 23:59 listener.04apr02sun.log 2355382 Apr 3 23:59 listener.04apr03mon.log 1727084 Apr 4 23:59 listener.04apr04tue.log 1698174 Apr 5 23:59 listener.04apr05wed.log 1406888 Apr 6 23:59 listener.04apr06thu.log 3292066 Apr 7 23:59 listener.04apr07fri.log 26687833 Apr 8 23:59 listener.04apr08sat.log 1865193 Apr 9 23:59 listener.04apr09sun.log 2948930 Apr 10 23:59 listener.04apr10mon.log 1614107 Apr 11 23:59 listener.04apr11tue.log 1367328 Apr 12 23:59 listener.04apr12wed.log 1043434 Apr 13 23:59 listener.04apr13thu.log 1085030 Apr 15 00:00 listener.04apr14fri.log 27346263 Apr 16 00:00 listener.04apr15sat.log 573629 Apr 16 23:59 listener.04apr16sun.log 202423 Apr 17 23:59 listener.04apr17mon.log 206806 Apr 18 23:59 listener.04apr18tue.log 250578 Apr 19 23:59 listener.04apr19wed.log 249310 Apr 20 23:58 listener.04apr20thu.log 217346 Apr 21 23:57 listener.04apr21fri.log 41947152 Apr 22 23:59 listener.04apr22sat.log 202267 Apr 23 23:59 listener.04apr23sun.log 765846 Apr 24 23:59 listener.04apr24mon.log 1032184 Apr 25 23:59 listener.04apr25tue.log 1102964 Apr 26 23:59 listener.04apr26wed.log 1064385 Apr 27 23:59 listener.04apr27thu.log 1133838 Apr 28 23:59 listener.04apr28fri.log 26614410 Apr 29 23:59 listener.04apr29sat.log 1074149 May 1 00:00 listener.04apr30sun.log 1063498 May 1 23:59 listener.05may01mon.log 443306 May 2 13:27 listener.05may02tue.log *************************************************************************
If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please resend this communication to the sender and delete the original message or any copy of it from your computer system.
Thank you.
-- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Tue May 02 2006 - 15:55:54 CDT
![]() |
![]() |