【发布时间】:2017-03-07 11:02:39
【问题描述】:
我安装和配置 Oracle 即时客户端和 unixODBC。使用root登录时,可以通过sqlplus或isql连接db。
root@zabbix:~# sqlplus ***/***@***
SQL*Plus: Release 12.1.0.2.0 Production on Tue Mar 7 13:56:42 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Tue Mar 07 2017 13:19:45 +03:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>
root@zabbix:~# isql ***
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
但在 Zabbix 管理面板中我收到错误 Cannot connect to ODBC DSN:[SQL_ERROR]:[08004][12154][[unixODBC][Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified]|。
我认为这是 zabbix 用户不存在环境的问题,因为sudo -u zabbix env 输出不包含ORACLE_HOME, TNS_ADMIN, NLS_LANG 等。
我可以在哪里设置或者有什么问题?
【问题讨论】: