eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« Oracle11g的新特性:自动内存管理 | Blog首页 | 元大都的枫叶 绚烂斑斓的美丽 »

如何更改监听器日志文件名称
modb.pro

今天一个数据库的监听器日志出了点问题,用set log_file命令重新定位一个日志文件得以解决。

发现以下两个命令很有用:

LSNRCTL> set current_listener <listener name>
LSNRCTL> set log_file <sid name>.log

使用set current_listener可以访问非缺省监听器,使用set log_file更改名称后,原来有问题的日志文件可以清除或实现日志重定位:

[oracle@jumper admin]$ lsnrctl


LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 10-NOV-2006 16:54:16


Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.


Welcome to LSNRCTL, type "help" for information.


LSNRCTL> set current_listener LISTENER1
Current Listener is LISTENER1
LSNRCTL> set log_file
Parameter Value: a.log
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
LISTENER1 parameter "log_file" set to a.log
The command completed successfully
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER1
Version                   TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date                10-NOV-2006 16:54:12
Uptime                    0 days 0 hr. 2 min. 6 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/9.2.0/network/admin/listener.ora
Listener Log File         /opt/oracle/product/9.2.0/network/log/a.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.33.11)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "conner" has 1 instance(s).
  Instance "conner", status UNKNOWN, has 1 handler(s) for this service...
Service "eygle" has 1 instance(s).
  Instance "eygle", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL>

如果需要将这个修改永久化,需要使用save_config命令保存一下:

LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
Saved LISTENER1 configuration parameters.
Listener Parameter File /opt/oracle/product/9.2.0/network/admin/listener.ora
Old Parameter File /opt/oracle/product/9.2.0/network/admin/listener.bak
The command completed successfully

此时listener.ora文件会被增加如下记录:

[oracle@jumper oracle]$ tail -5 /opt/oracle/product/9.2.0/network/admin/listener.ora


#----ADDED BY TNSLSNR 14-NOV-2006 16:39:12---
LOG_FILE_LISTENER1 = a.log
#--------------------------------------------

记录一下。

-The End-


历史上的今天...
    >> 2010-11-10文章:
    >> 2009-11-10文章:
    >> 2008-11-10文章:
    >> 2005-11-10文章:
           Linux上iSCSI配置
           给20年后的自己发封邮件
           How to use Oracle Dump Function

By eygle on 2006-11-10 17:33 | Comments (2) | Case | HowTo | 963 |

2 Comments

重启监听器后,日志文件仍会是默认的listener.log.
listener.ora 没有收到影响。

如果希望永久变更,可以用save_config命令保存一下

下次重起就改变了,我更新了一下文章.


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com