我正在使用java代码连接远程服务器,但是其中一个unix命令没有按预期执行。Unix命令如下:
/u01/db/oracle/db/tech_st/11.1.0/bin/lsnrctl status VIS输出:
LSNRCTL for Linux: Version 11.1.0.7.0 - Production on 06-NOV-2017 10:48:10
Copyright (c) 1991, 2008, Oracle. All rights reserved.
TNS-01101: Message 1101 not found; No message file for product=network, facility=TNS有人能帮我解决这个问题吗?
谢谢你们所有人。
发布于 2017-11-09 19:47:20
首先尝试从命令行测试它。关键是在不需要环境变量ORACLE_HOME的情况下运行lsnrctl。
在这里,你可以重现它:
jxa@ub16a|2001$ ssh test1 /opt/oracle/product/11.2.0/dbhome_1/bin/lsnrctl status
Message 1053 not found; No message file for product=network,
facility=TNSMessage 1020 not found; No message file for product=network,
facility=TNSMessage 1021 not found; No message file for product=network,
facility=TNSMessage 1022 not found;
[...]正确设置ORACLE_HOME后(在命令前添加):
jxa@ub16a|2007$ ssh test1 ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1 \
/opt/oracle/product/11.2.0/dbhome_1/bin/lsnrctl status
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 09-NOV-2017 12:35:56
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
[...]现在,只要找出在java中添加环境变量的方法,就完成了。或者直接将其添加到.bashrc (Linux最可能的位置)或目标主机上的另一个合适的初始化文件中。
顺便说一下,您的lsnrctl报告的错误是:
xxx:~ $ oerr tns 1101
01101, 00000, "Could not find service name %s"
// *Cause: The ervice name could not be resolved by name-lookup.
// *Action: Verify that the listener name or service name specified to
// LSNRCTL has the correct name and address defined in LISTENER.ORA or in
// TNSNAMES.ORA.
xxx:~ $ 我希望它能帮上忙。
https://stackoverflow.com/questions/47198778
复制相似问题