我如何在 ubuntu 18.04 上设置 oracle 即时客户端?

how do i set up oracle instant client on ubuntu 18.04?

所以我试图在 zabbix 上通过 ODBC 监控 oracle 数据库,但我的 zabbix 服务器是 ubuntu 18.04,我真的很困惑,因为 oracle 使用 rpm。

我一步一步地配置 oracle 即时客户端:

https://sudonull.com/post/110401-Monitoring-Oracle-Database-through-ODBC-in-Zabbix

但是当我尝试安装 sqlplus 时,我因为 tnsnames.ora、

而感到困惑

在教程中他说要创建一个与名称为 TESTDB 的数据库的连接,例如,它看起来像这样:

TESTDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oratestdb)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = testdb) ) )

所以我让它看起来和上面一模一样,我也做了配置 /etc/hosts 但是在尝试连接 sqlplus 时出现了这个错误“TNS NO LISTENER”。

我尝试启动 lsnrctl,但显然它没有 lsnrctl.service

我的问题是,

is it "TESTDB" something that i just made up or it should be the name of database on oracle database?

以你自己为例

TESTDB = -- you can give any name of your wish here 
       (DESCRIPTION = 
         (ADDRESS =  -- following 3 fields are details of DB server
            (PROTOCOL = TCP)
            (HOST = oratestdb)
            (PORT = 1521)
         ) 
         (CONNECT_DATA = 
            (SERVER = DEDICATED) 
            (SERVICE_NAME = testdb) -- This is the service name of the DB on given server
         ) 
       )

when you finally try login in "sqlplus example/example@example" is it using user and password from oracle database that you have?

是的,这是 oracle DB 用户的密码

sqlplus scott/tiger@TESTDB