listenora.ora默认保存位置是/u01/app/oracle/product/11.2.0/db_1/network/admin
现通过TNS_ADMIN环境变量来从重定向监听文件位置;
将监听配置文件listener.ora复制到/u02/data目录下,原位置listenor.ora文件重命名或删除;
设置环境变量:
[oracle@OL541 admin]$ echo $TNS_ADMIN
默认为空
[oracle@OL541 ~]$ export TNS_ADMIN=/u02/data/.
[oracle@OL541 ~]$ echo $TNS_ADMIN
/u02/data/.
启动监听:
[oracle@OL541 ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 06-FEB-2015 16:04:47
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u02/data/./listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/OL541/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=OL541.localdomain)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=OL541.localdomain)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 06-FEB-2015 16:04:47
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u02/data/./listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/OL541/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=OL541.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
Service "plsextproc" has 1 instance(s).
Instance "plsextproc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
从上述输出日志可看出监听文件启动位置变化了。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29519108/viewspace-1428822/,如需转载,请注明出处,否则将追究法律责任。