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

How to clean up the listening log in the database

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "how to clean up the monitoring log in the database". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn the article "how to clean up the monitoring log in the database".

Clean up the method of listening log processing:

1: first stop the listening service process (tnslsnr) to record logs.

Lsnrctl set log_status off

2: make a copy of the monitoring log file (listener.log) and name it in listener.log.yyyymmdd format

Cp listener.log listener.log.20150622

3. Empty the listening log file (listener.log). There are many ways to empty files.

Cat / dev/null > listener.log

4: enable the listening service process (tnslsnr) to log

Lsnrctl set log_status on

For such a system where listener.log is growing very fast, you can turn off the listening log lsnrctl set log_status off and not allow listening to write logs to files. You can also write a job to clean up regularly.

Rq= `date + "d" `cp $ORACLE_HOME/network/log/listener.log $ORACLE_BACKUP/network/log/listener_$rq.logsu-oracle-c "lsnrctl set log_status off" cp / dev/null $ORACLE_HOME/network/log/listener.logsu-oracle-c "lsnrctl set log_status on"

Monitor log file changes:

11g began to introduce ADR, and the snooping log changed from $ORACLE_HOME/network/log/listener.log to $ORACLE_BASE/diag/tnslsnr/hostname/listener/alert/log.xml.

Normally, log.xml will only reflect very recent data, and it won't get purged. However, as the log file grows, it

Will be archived into a log_1.xml, log_2.xml and so on, and those files will get purged instead.

The "archived" log_1.xml, etc. Will not show up until the log.xml file gets to 10MBytes.

The number of xml files in the $ORACLE_BASE/diag/tnslsnr/hostname/listener/alert directory is increasing in the form of 10m each. Before, it was simply cleaned up regularly.

$ORACLE_HOME/network/log/listenr.log changes to need to clean up the alert directory

C:\ Documents and Settings\ Administrator > lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.1.0-Production on 23-June-2015 13:58:32

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

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=dbbostest) (PORT=1521)

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0-Production

Launch date 21-May-2015 16:04:08

Uptime 32 days, 21 hours, 54 minutes, 32 seconds.

Trace level off

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file D:\ app\ product\ 11.2.0\ dbhome_1\ network\ admin\ listener.ora

Listener log file d:\ app\ diag\ tnslsnr\ dbbostest\ listener\ alert\ log.xml-here the format is the listening log in xml format

Listening Endpoint Summary.

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=dbbostest) (PORT=1521))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (PIPENAME=\\.\ pipe\ EXTPROC1521ipc))

Service summary..

The service "CLRExtProc" contains 1 instance.

Instance "CLRExtProc", status UNKNOWN, contains 3 handlers for this service.

The service "bostest" contains 1 instance.

Instance "bostest", status READY, contains 1 handler for this service.

The service "bostestXDB" contains 1 instance.

Instance "bostest", status READY, contains 1 handler for this service.

Command executed successfully

To change back to the old way, add the following line DIAG_ADR_ENABLED_listener = OFF to the listener.ora file. Note that the red part is the listener name, and the actual listener name needs to be replaced.

C:\ Documents and Settings\ Administrator > lsnrctl reload

LSNRCTL for 64-bit Windows: Version 11.2.0.1.0-Production on 23-June-2015 14:12:24

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

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=dbbostest) (PORT=1521)

Command executed successfully

C:\ Documents and Settings\ Administrator > lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.1.0-Production on 23-June-2015 14:12:28

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

Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=dbbostest) (PORT=1521)

STATUS of LISTENER

-

Alias LISTENER

Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0-Production

Launch date 21-May-2015 16:04:08

Uptime 32 days, 22 hours, 8 minutes, 28 seconds.

Trace level off

Security ON: Local OS Authentication

SNMP OFF

Listener parameter file D:\ app\ product\ 11.2.0\ dbhome_1\ network\ admin\ listener.ora

Listener log file D:\ app\ product\ 11.2.0\ dbhome_1\ network\ log\ listener.log

Listening Endpoint Summary.

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=dbbostest) (PORT=1521))

(DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (PIPENAME=\\.\ pipe\ EXTPROC1521ipc))

Service summary..

The service "CLRExtProc" contains 1 instance.

Instance "CLRExtProc", status UNKNOWN, contains 1 handler for this service.

The service "bostest" contains 1 instance.

Instance "bostest", status READY, contains 1 handler for this service.

The service "bostestXDB" contains 1 instance.

Instance "bostest", status READY, contains 1 handler for this service.

Command executed successfully

How To Change the Listener Log Filename Without Stopping the Listener (document ID 135063.1)

Some other parameters for monitoring:

DIAG_ADR_ENABLED_LISTENER=OFF

DIAG_ADR_ENABLED_LISTENER_SCAN1=OFF

INBOUND_CONNECT_TIMEOUT_LISTENER = 110,

INBOUND_CONNECT_TIMEOUT_LISTENER_SCAN1 = 110,

/ home/lxm/app/lxm/diag/rdbms/orcl/orcl/alert

Delete the following log_xxx.xml files, never delete log.xml

Delete command: rm-rf log_*.xml

The above is all the contents of the article "how to clean up the monitoring log in the database". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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