ITPub博客

首页 > 数据库 > Oracle > ORA-12505,TNS:listener does not currently know of SID given in connect

ORA-12505,TNS:listener does not currently know of SID given in connect

原创 Oracle 作者:selectshen 时间:2015-07-31 16:02:58 0 删除 编辑
ORA-12505,TNS:listener does not currently know of SID given in connect descriptor
12505, 00000, "TNS:listener does not currently know of SID given in connect descriptor"
// *Cause:  The listener received a request to establish a connection to a
// database or other service. The connect descriptor received by the listener
// specified a SID for an instance (usually a database instance) that either
// has not yet dynamically registered with the listener or has not been
// statically configured for the listener. This may be a temporary condition
// such as after the listener has started, but before the database instance
// has registered with the listener.
// *Action:
//  - Wait a moment and try to connect a second time.
//  - Check which instances are currently known by the listener by executing:
//    lsnrctl services <listener name>
//  - Check that the SID parameter in the connect descriptor specifies
//    an instance known by the listener.
//  - Check for an event in the listener.log file.

客户通过java jdbc thin driver 连接oracle,使用的格式是jdbc:oracle:thin:@192.108.56.117:1521:ct65,报ORA-12505错误,这是以sid方式连接的格式,这里ct65是这台oracle的
service_name,
而这台oracle的sid是ct6501,只需要把ct65换成ct6501就可以了.也或者使用jdbc:oracle:thin:@//192.108.56.117:1521/ct65以service_name的方式连接也可以.
当然还有一种方法是通过tnsname方式连接,格式为jdbc:oracle:thin:@tns_ct65,这里的tns_ct65是tnsnames.ora中配置的对应的tnsname.
个人建议java jdbc thin driver通过service_name的方式连接数据库,sid方式不适合于rac环境,也不利于dataguard环境下之后的切换.
 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28539951/viewspace-1757860/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-01-05

  • 博文量
    169
  • 访问量
    1567873