New function of oracle19c — automatic rotation of listener log in TXT format


In versions before 19C, the TXT format listener log of Oracle database cannot be automatically managed circularly(Mos 1744876.1), which has caused a great burden to users.

19c, the following two parameters are imported:

#### 7.5.3 LOG_FILE_NUM_listener_name

The LOG_FILE_NUM_listener_name is a diagnostic parameter of the listener.ora file that specifies the number of log file segments.

To specify the number of log file segments. At any point of time there can be only n log file segments where n is LOG_FILE_NUM_listener_name. If the log grows beyond this number, then the older segments are deleted.

No default. If you don't specify a value, or set the value to zero, then the number of segments grows indefinitely.

Any integer value.

Example 7-9

#### 7.5.4 LOG_FILE_SIZE_listener_name

The LOG_FILE_SIZE_listener_name diagnostic parameter of thelistener.ora file specifies the size of each log file segment.

To specify the size of each log file segment. The size is in MB.

300 MB

Any integer value.

Example 7-10 Example

Through the above parameters, the listener log in TXT format can be managed automatically as the listener log in XML format.


[[email protected] ~]$ lsnrctl start
Lsnrctl for Linux: version - production on January 20 - 2021 17:33:16
Copyright (c) 1991, 2019, Oracle.  All rights reserved.
/u01/app/oracle/product/19.3.0/dbhome_ 1 / bin / tnslsnr "start" and "start". Wait, wait, wait
TNSLSNR for Linux: Version - Production
The user interface of the user interface is / u01 / APP / Oracle / diag / tnslsnr / db1903 / listener / Alert / log.xml.
リスニングしています: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db1903)(PORT=1521)))
(description = (address = (protocol = TCP) (host = db1903) (Port = 1521)))


alias                         LISTENER
バージョン                TNSLSNR for Linux: Version - Production
Start date                      20-january-2021 17:33:19
Harvest time                    0 day 0 time 0 minute 0 second
トレース・レベル          off
セキュリティ              ON: Local OS Authentication
SNMP                      OFF
パラメータ・ファイル      /u01/app/oracle/product/19.3.0/dbhome_1/network/admin/listener.ora
ログ・ファイル            /u01/app/oracle/diag/tnslsnr/db1903/listener/alert/log.xml


コ マ ン ド は normal に end し〚し.

At / u01 / APP / Oracle / product / 19.3.0/dbhome_ 1. Set the following two parameters in the / network / admin / listener.ora file.


Restart listening.

[[email protected] ~]$ lsnrctl stop listener
[[email protected] ~]$ lsnrctl start listener

Test it.

$> vi
while ( true ); do
sqlplus -S -L test/[email protected]:1521/pdb << EOF

$> chmod +x
$> ./ > /dev/null
$> ./ > /dev/null
$> ./ > /dev/null
$> ...

◆ TXT format listener log

[[email protected] trace]$ pwd
[[email protected] trace]$ ll
Total 720
-rw-r-----. 1 oracle oinstall    twelve thousand two hundred and fifty-one    January 20 17:59 listener.log
-rw-r-----. 1 oracle oinstall 482866    January 20 17:59 listener_ 1.log

◆ listener log in XML format

[[email protected] alert]$ pwd
[[email protected] alert]$ ll
Total 1416
-rw-r-----. 1 oracle oinstall       nine hundred and sixty-two    January 20 17:59 log.xml
-rw-r-----. 1 oracle oinstall 1048912    January 20 17:59 log_ 1.xml

Note that the size of the above XML listener is smaller than 1MB. The reason is that the log files in the two formats need to record the same connection records, and each connection record in TXT format uses less space than that in XML format.

In addition,LOG_FILE_SIZE_listenerThe default value of is 300MB, which means that even if this parameter is not set, the XML listener log will automatically rotate when it reaches 300MB.

Recommended Today

Implementation example of go operation etcd

etcdIt is an open-source, distributed key value pair data storage system, which provides shared configuration, service registration and discovery. This paper mainly introduces the installation and use of etcd. Etcdetcd introduction etcdIt is an open source and highly available distributed key value storage system developed with go language, which can be used to configure sharing […]