连接数据库时,提示错误描述:
java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
问题描述:情况使用帆软报表连接数据库时,提示数据库连接失败,但是用Navicat工具连接同一个数据库时,却没有问题,不会提示报错。
后面看到有人说,错误重点是:listener does not currently know of SID given in connect descriptor
以及强调:SID != SERVICE_NAME
查询数据库的SID,发现数据库的SID确实变了,不一样,导致连接错误,更换连接的SID,就可以解决。
查询数据库的SID:
select instance_name from V$instance