日期:2014-05-17 浏览次数:20871 次
异常如下: 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 The Connection descriptor used by the client was: 192.168.1.101:1521:devorcl jdbc文件如下: jdbc.driverClassName=oracle.jdbc.driver.OracleDriver jdbc.url=jdbc:oracle:thin:@192.168.1.101:1521:devorcl jdbc.username=sjhos jdbc.password=sjhos listener.ora 如下: SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = g:\oracle\product\10.2.0\db_2) (PROGRAM = extproc) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) (ADDRESS = (PROTOCOL = TCP)(HOST = hp-PC)(PORT = 1521)) ) ) tnsnames.ora文件内容如下: ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hp-PC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) external_project = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hp-PC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = devorcl) ) ) DEVORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = hp-PC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = devorcl) ) )