Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The monitoring log is too large. How to deal with it?

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The Oracle listener log file (usually called listener.log) is a plain text file whose size is growing all the time. On a production Oracle server, DBA will check the file every day, such as checking whether the listener has stopped abnormally, whether there is a malicious * * connection, etc. When the file is very large, it may be slow to open and browse the contents of the file. At this point, you may think of backing up the current log file and then recreating a new log file, but Oracle listeners are not allowed to delete and rename their log files at run time, so you have to stop the listener. After renaming, start the listener, and automatically create a new listener log file at startup, but the client connection will be disconnected. This article describes a method to rename the listener log file without stopping the listener.

Listener command (WINDOWS operates under the command line, LINUX and AIX are the same command)

Lsnrctl set log_status off

Lsnrctl set log_status on

Examples: AIX, ORACLE10G

1. Before processing (listener_p550a.log is very large)

P550a:/home/oracle/database/network/log#ls-lt

Total 2356504

-rw-r--r-- 1 oracle dba 1195793131 11: 09: 59 listener_p550a.log

-rw-r--r-- 1 oracle dba 10698028 March 10: 25 sqlnet.log

2 、 lsnrctl set log_status off

P550a:/#su-oracle

$lsnrctl set log_status off

LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.3.0-Production on 11-MAR-2011 10:02:38

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

Connecting to (ADDRESS= (PROTOCOL=tcp) (HOST=) (PORT=1521))

LISTENER parameter "log_status" set to OFF

The command completed successfully

3. Move files to the backup path to free up space

P550a:/home/oracle/database/network/log#mv listener_p550a.log / bak

4 、 lsnrctl set log_status on

$lsnrctl set log_status on

LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.3.0-Production on 11-MAR-2011 10:06:12

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

Connecting to (ADDRESS= (PROTOCOL=tcp) (HOST=) (PORT=1521))

LISTENER parameter "log_status" set to ON

The command completed successfully

5. Let's take a look. Listener_p550a.log has been created automatically.

P550a:/home/oracle/database/network/log#ls-lt

Total 20928

-rw-r--r-- 1 oracle dba 102 March 11 10 06 listener_p550a.log

-rw-r--r-- 1 oracle dba 10698028 March 10: 25 sqlnet.log

P550a:/home/oracle/database/network/log#

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report