本地安装oracle11g后,plsql连接测试成功。可是过了两天不知道什么原因plsql连接不上了,而且也没有提示什么报错信息。
重启oracle的监听和服务后,登录提示12514错误:监听程序当前无法识别连接描述符中请求的服务
百度找到答案,测试连接成功:
原来listener.ora中只有:
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) ) )
添加一段配置后:
# listener.ora Network Configuration File: F:\app\lsk\product\11.1.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = F:\app\lsk\product\11.1.0\db_1)
(SID_NAME = ORCL)
)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = F:\app\lsk\product\11.1.0\db_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
其中GLOBAL_DBNAME是oracle本地安装后的文件夹路径。
保存后重启下监听:
lsnrctl stop // 关闭
lsnrctl start // 启动
然后连接成功。