The following describes how to rename an Oracle listener log file without renaming it. It is helpful for you to learn about the Oracle listener log file.
Oracle listener log file (usually called listener. log) is a plain text file whose size keeps increasing. On a production Oracle Server, DBA checks the file daily, such as checking whether the listener has an abnormal stop, whether there is a malicious attack connection or not. When the file is very large, it may be slow to open and browse the file content.
At this time, you may want to back up the current log file and recreate a new log file. However, Oracle listeners cannot delete the log file during runtime, therefore, only the listener is stopped.
After the listener is renamed, start the listener again. A new listener log file will be automatically created when the listener is started, but the client connection will be disconnected. This article introduces a method without stopping the listener, rename the listener log file.
On Windows:
C: \> cd \ oracle \ ora92 \ network \ log # Switch to the directory where the listener log file is located
C: \ oracle \ ora92 \ network \ log> lsnrctl set log_status off # temporarily offline the listener log File
C: \ oracle \ ora92 \ network \ log> rename listener. log listener. old # rename the log file and add the date
C: \ oracle \ ora92 \ network \ log> lsnrctl set log_status on # Bring the listener log file online and a new log file will be created automatically.
On Linux/Unix platforms:
- % cd /u01/app/oracle/product/9.2.0/network/log
-
- % lsnrctl set log_status off
-
- % mv listener.log listener.old
-
- % lsnrctl set log_status on
After the name is renamed, you can copy listener. old to the DBA's work computer for in-depth analysis. In case of hacker attacks, you can also retain the file as evidence.
Oracle Log File Management
Oracle Password File Management
Oracle reads and writes system files
Entire Process of creating Oracle Materialized View
ORACLE instance creation process