[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

script to delete listner log automated process

Posted on 2011-10-18
8
Medium Priority
?
502 Views
Last Modified: 2012-05-12
we should be doing this on any Network/Listener/SQLnet.log files on all the DB servers.at this point .we need a automated process to perform this process. So can you please  work on writing a script to perform this
0
Comment
Question by:B_Pati
8 Comments
 
LVL 1

Author Comment

by:B_Pati
ID: 36990458
please provide me the script which i can run in all databases
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 36990473
- do you mean the phyisical file in the machine? you can create a dos .BAT file with command as follows:
@echo off
del c:\folder\sqlnettrace.trc
del c:\folder\sqlnet.log

- then save it somewhere and schedule to run that .BAT file daily/at your desired period using Windows Task Scheduler.
 
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 36990493
- for trace file, the filename is generated automatically therefore you can issue a delete all command such as del c:\folder\*.trc
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:Chakravarthi Ayyala
ID: 36990698
I'm sorry.  But, I did not get your OS.
In Linux/AIX starting with Oracle 11g, Oracle automatically rotates the listener log file.  Hence, we need not write any script for doing the same.
I presume the same behviour with Windows too.
0
 
LVL 1

Author Comment

by:B_Pati
ID: 36992656
it is linux envirinment...

please can you help me with  the script how to truncate the listiner
0
 
LVL 35

Accepted Solution

by:
johnsone earned 1500 total points
ID: 36992966
The listener.log is a little tricky.  That file is kept open, so simply renaming it or deleting it doesn't work.  You need to stop the listener from writing to the file.

lsnrctl set log_status off
mv listener.log listener.log_old
lsnrctl set log_status on

You can change the mv command to really anything you want.  In theory, you may miss a couple of lines in your log files, but users should not see an impact to doing it this way.
0
 
LVL 1

Author Comment

by:B_Pati
ID: 36993141
please provide me the script to run  ksh to run on Linux schedule
0
 
LVL 1

Author Closing Comment

by:B_Pati
ID: 37072270
Solved
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses
Course of the Month18 days, 4 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question