Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103604531
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: Oracle

2008-04-02 14:33:41

来源:赛迪网技术社区    作者:我的港湾

如果你的数据库监听器日志出现了问题,你可以用set log_file命令重新定位一个日志文件。

下面我们来介绍两个命令:

LSNRCTL> set current_listener  
LSNRCTL> set log_file .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
#----------------------------------
阅读(379) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~