ITPub博客

首页 > 数据库 > Oracle > 11G listener修改log_file报TNS-01251

11G listener修改log_file报TNS-01251

原创 Oracle 作者:烟花丶易冷 时间:2017-06-27 21:10:05 0 删除 编辑
[grid@node1 log]$ lsnrctl


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 27-6月 -2017 20:33:24


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


Welcome to LSNRCTL, type "help" for information.


LSNRCTL> set log_file
Parameter Value: listener.log
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
TNS-01251: Cannot set trace/log directory under ADR


Oracle 11g中引入了ADR特性。
如果listener.ora文件中参数DIAG_ADR_ENABLED_listenername设置为on,则会忽略参数log_directory的设置。 trace文件和log文件被创建在ADR_BASE_listener_name指定的路径下。可以通过参数ADR_BASE_listener_name参数指定的位置作为trace和log文件的存放的base目录。
也可以通过在listener.ora中设置,取消ADR特性:
DIAG_ADR_ENABLED_LISTENER=OFF 
LOG_DIRECTORY_listener_name = [path]


修改完成后需执行lsnrctl reload使文件生效
[grid@node1 log]$ lsnrctl reload


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 27-6月 -2017 20:54:38


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
The command completed successfully
[grid@node1 log]$ lsnrctl status


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 27-6月 -2017 20:54:57


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                27-6月 -2017 20:45:21
Uptime                    0 days 0 hr. 9 min. 35 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /g01/11ggrid/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /g01/11ggrid/app/11.2.0/grid/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
The listener supports no services
The command completed successfully
如果不在listener.ora文件中设置LOG_DIRECTORY_listener_name参数,可按以下方法修改
[grid@node1 log]$ lsnrctl


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 27-6月 -2017 20:57:08


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


Welcome to LSNRCTL, type "help" for information.


LSNRCTL> set log_file
Parameter Value: listener1.log
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
LISTENER parameter "log_file" set to listener1.log
The command completed successfully
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                27-6月 -2017 20:45:21
Uptime                    0 days 0 hr. 12 min. 6 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /g01/11ggrid/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /g01/11ggrid/app/11.2.0/grid/network/log/listener1.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.2)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.3)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "PROD" has 1 instance(s).
  Instance "PROD1", status READY, has 1 handler(s) for this service...
Service "PRODXDB" has 1 instance(s).
  Instance "PROD1", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
Saved LISTENER configuration parameters.
Listener Parameter File   /g01/11ggrid/app/11.2.0/grid/network/admin/listener.ora
Old Parameter File   /g01/11ggrid/app/11.2.0/grid/network/admin/listener.bak
The command completed successfully

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29618264/viewspace-2141316/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: clusterwarePRCT-1011
请登录后发表评论 登录
全部评论

注册时间:2014-04-20

  • 博文量
    135
  • 访问量
    269994