ORACLE10g的ORA-12505问题解决方法
发布时间:2009-03-25 来源:飞华健康网医生组 90人关注
安装ORACLE10g后,创建用户,导入数据库脚本之后,用sqlplus连接正常后,在weblogic启动的时候抛出异常:Io 异常: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))),在web程序中登陆程序的时候报系统错误,日志提示为:javax.naming.NameNotFoundException: While trying to lookup 'jdbc.fsdsDS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/fsdsDS',然后用eclipse中配置的数据库连接,提示错误为:Error while trying to login to database:Listener refused the connection with the flowing error:ORA12505,TNS:listener does not currently know of SID given in connect descriptor。
解决方式为:修改%oracle_home%\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora文件,加上下面红色的字体部分:
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = C:\tools\oracle\product\10.1.0\db_1) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = orcl) (ORACLE_HOME = C:\tools\oracle\product\10.1.0\db_1) (SID_NAME = orcl) )
)
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) ) )
重新启动数据库服务,看能否正常连接,如果还不行,在Enterprise manager console软件中配置数据库的连接信息(如果之前没有配置过),然后用system以sysdba身份登录,在例程->配置->一般信息中将例程状态改为“启动”,然后点下面的应用。这时会出来一个对话框提示正在启动,等他提示完成以后就好了。
了解该症状的其他症状起因: