重庆思庄Oracle、Redhat认证学习论坛

标题: oracle 永久关闭listener日志 [打印本页]

作者: jiawang    时间: 2023-5-4 15:22
标题: oracle 永久关闭listener日志
本帖最后由 jiawang 于 2023-5-4 15:31 编辑

在Oracle的各种日志中,监听日志算是比较大的,尤其是在windows平台,还存在监听日志过大导致监听异常的bug。

所以除了写脚本定期删日志文件之外,就是永久性的把监听写日志的功能关闭。


停止监听服务进程记录日志
[oracle@strong ~]$ lsnrctl set log_status off

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 04-MAY-2023 15:17:13

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

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

TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
LISTENER parameter "log_status" set to OFF
The command completed successfully

保存配置信息
[oracle@strong ~]$ lsnrctl save_config
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 04-MAY-2023 15:17:43
Copyright (c) 1991, 2019, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=strong)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Saved LISTENER configuration parameters.
Listener Parameter File   /u01/app/oracle/product/19.3.0/db_1/network/admin/listener.ora
Old Parameter File   /u01/app/oracle/product/19.3.0/db_1/network/admin/listener.bak
The command completed successfully
[oracle@strong ~]$

修改后listener.ora文件中就会多一条配置:LOGGING_LISTENER = OFF
[oracle@strong admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/19.3.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = strong)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )


SID_LIST_LISTENER =
   (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME = orcl)
          (ORACLE_HOME = /u01/app/oracle/product/19.3.0/db_1)
          (SID_NAME = orcl)   
        )   
)  


#----ADDED BY TNSLSNR 04-MAY-2023 15:18:04---
LOGGING_LISTENER = OFF
#--------------------------------------------

[oracle@strong admin]$



作者: jiawang    时间: 2023-5-4 15:40
也可以直接在istener.ora文件下添加logging_listener=off 参数,然后重启监听器实现。
su – oracle  
cd $ORACLE_HOME/network/admin  
vi listener.ora  
加入一行:  
logging_listener=off   




欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2