ORA-12505 error and solution when JDBC connects to Oracle database

 

http://www.blogjava.net/itspy/archive/2007/12/20/169072.htmloracle 
problem description:
The following error occurred when using jdbc to connect to the oracle 10.2.0.1.0 database today:

Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153093120)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))

You can connect to the database directly through plsql, or you can connect to the database through sqlplus

After debugging and searching for relevant information, we found that the cause of the problem is as follows:
When jdbc connects to the database, you need to use the sid_name of the database instead of the services_name
of the database. When using plsql to connect to the database, you only need the services_name of the database, so modify the connection string services_name in is sid_name

Attachment:
View the current sid in the database:

SQL> select INSTANCE_NAME from v$instance;

INSTANCE_NAME
----------------
hasl

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326930783&siteId=291194637