Home  >  Article  >  Database  >  About regular cleaning of Oracle monitoring logs

About regular cleaning of Oracle monitoring logs

小云云
小云云Original
2017-12-11 15:08:041929browse

This article mainly introduces the relevant information on regular cleaning of Oracle monitoring logs. Friends in need can refer to it and hope it can help everyone.

Environment:

Oracle 11.2.0

Win Server 2008 R2 Enterprise

Cause: The size of the Oracle monitoring log file exceeds 4G, and the Oracle monitoring connection is interrupted. Continued

Solution: Re-create a new log file and execute it regularly through scheduled tasks. For convenience, I execute it once a day here.

The content of the batch file is as follows:

@echo off

rem Because the database monitoring log is too large, it affects the use of Oracle and needs to be cleaned regularly

rem Stop Monitor and write logs

lsnrctl set log_status off

rem Modify the name of the monitoring log file and execute it once a day

ren E:\app\Administrator\diag\tnslsnr\% own Computer name%\listener\trace\listener.log listener.log.%date:~0,4%%date:~5,2%%date:~8,2%

rem Restart the listening log

lsnrctl set log_status on

rem Reload monitoring, for insurance, it can be used normally without loading

lsnrctl reload

Related recommendations:

Batch file for stopping and starting mysql and oracle database

Mybatis call Oracle stored procedure method explanation,

Example of how Python uses cx_Oracle to call Oracle stored procedures

The above is the detailed content of About regular cleaning of Oracle monitoring logs. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn