Wednesday, July 22, 2009

Rotate listener log.

Rotate listener log.
If the listener log grow beyond our limit size and you want to rotate listener log without restarting listener service we might do something like this.
Go to listener log path.

Eg. Listener log file name like listener.log

cp listener.log listener.log.old; tail -500 listner.log.old > listener.log

- try to maintain this in single line so that the time gap should not be more
Small note :- whenever we try to move the existing file and add touch a new file mean time listener service will fail to Wright the log to listener.log file hence the service might stop. Whenever we move the file and create a new file. The I node number of the file changes and we might need to restart listener as the service will be writing log to the old inode file and that changes now. We might need to restart the service for service to identify the new listener.log file.