java.sql.SQLException:Listener refused the connection with the following error:ORA-12505,TNS:listen

启动tomcat后,前台输入账号密码,提示: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

去后台尝试连接数据库,提示:ORA-12541:TNS :无监听程序

这是因为oracle数据库监听没启

开启oracle的监听,尝试连接数据库,提示:ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务

这是因为oracle服务没启

linux下启动oracle监听和服务

su - oracle       //切换到oracle用户模式下

sqlplus /nolog  //登录sqlplus

SQL> connect /as sysdba  //连接oracle

lsnrctl start  //启动监听

扫描二维码关注公众号,回复: 4915300 查看本文章

startup //启动数据库

猜你喜欢

转载自blog.csdn.net/Demis_demis/article/details/85212039