今天收到开发的一个问题,说是程序连不上oracle数据库。
马上连上数据库,查看监听端口
发现监听的是本机的回环地址,别的机器上的程序肯定是不能连接的,于是修改了监听文件
vim $ORACLE_HOME/db_1/network/admin/listener.ora,将HOST地址改为本地的内网IP,并
重启监听并重新查看
虽然监听恢复正常了,但是提示监听器不支持任何服务。用客户端连接会报错如下
这个错误一般是因为客户端连接服务名错误或者服务器没有配置服务名,重新编辑监听文件listener.ora,添加服务字段:
SID_LIST_LISTENER=
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(SID_NAME = orcl)
)
)
重启监听服务,问题解决。