11g修改listner ADR

修改listner ADR 有2种方法:
一、禁用ADR,在lsnrctl 命令下修改log_directory的值,这也是网上大多数的修改方式。
su - grid
cd $ORACLE_HOME/netwrok/admin
vi listener.ora
DIAG_ADR_ENABLED_LISTENER=OFF --->禁用ADR
修改好后,需要reload。
[oracle:/oracle/app/product/grid/network/admin:RACTEST1] lsnrctl

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 25-JUL-2019 13:08:48

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

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> show
The following operations are available after show
An asterisk (*) denotes a modifier or extended command:

rawmode displaymode
rules trc_file
trc_directory trc_level
log_file log_directory
log_status current_listener
inbound_connect_timeout startup_waittime
snmp_visible save_config_on_stop
dynamic_registration enable_global_dynamic_endpoint
oracle_home pid

LSNRCTL> show log_directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.205.152)(PORT=1521)))
LISTENER parameter "log_directory" set to /oracle/app/oracle/diag/tnslsnr/ractest1/listener/alert/
The command completed successfully
LSNRCTL> set log_directory /home/oracle/app/oracle/diag/tnslsnr/ractest1/listener/alert/
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.205.152)(PORT=1521)))
LISTENER parameter "log_directory" set to /home/oracle/app/oracle/diag/tnslsnr/ractest1/listener/alert/
The command completed successfully
LSNRCTL> save_config
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.205.152)(PORT=1521)))
Saved LISTENER configuration parameters.
Listener Parameter File /oracle/app/product/grid/network/admin/listener.ora
Old Parameter File /oracle/app/product/grid/network/admin/listener.bak
The command completed successfully
LSNRCTL> exit
[oracle:/oracle/app/product/grid/network/admin:RACTEST1] lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 25-JUL-2019 13:09:31

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.205.152)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 25-JUL-2019 11:57:04
Uptime 0 days 1 hr. 12 min. 26 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/product/grid/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/ractest1/listener/alert/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.26.205.152)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.26.205.153)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "RACTEST" has 1 instance(s).
Instance "RACTEST1", status READY, has 1 handler(s) for this service...
The command completed successfully
可以看到已经修改成功。

二、开启ADR时,修改目录。
vi listener.ora
ADR_BASE_LISTENER = /oracle/app/oracle ---->加入这个参数
修改后,需要重启监听程序。
[oracle:/oracle/app/product/grid/network/admin:RACTEST1] cat listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
DIAG_ADR_ENABLED_LISTENER=on
ADR_BASE_LISTENER = /oracle/app/oracle
#----ADDED BY TNSLSNR 24-JUL-2019 10:27:25---
#LOG_DIRECTORY_LISTENER = /home/oracle/app/oracle/diag/tnslsnr/ractest1/listener/alert/
#--------------------------------------------

[oracle:/oracle/app/product/grid/network/admin:RACTEST1] srvctl start listener -n ractest1
[oracle:/oracle/app/product/grid/network/admin:RACTEST1] lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 25-JUL-2019 13:21:22

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.26.205.152)(PORT=1521)))
STATUS of the LISTENER

Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 25-JUL-2019 13:21:18
Uptime 0 days 0 hr. 0 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /oracle/app/product/grid/network/admin/listener.ora
Listener Log File /oracle/app/oracle/diag/tnslsnr/ractest1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.26.205.152)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.26.205.153)(PORT=1521)))
The listener supports no services
The command completed successfully

猜你喜欢

转载自blog.51cto.com/214320/2423428