Nathing
分类: Oracle
2016-05-18 16:01:47
如下是解决思路:
根据出错信息判断出客户端未监听到实例服务名
1、通过重启服务的方式启动数据库,再次连接仍无法连接服务器。
2、既然第一种方法不能解决问题,那就第二种方法。考虑监听listener.ora
监听配置文件listener.ora中可以不必指定监听的服务名(安装Oracle10g后也是没有指定的)。正常情况下一般只要数据库启动,客户端连接数据库也没有什么问题,但是有时重复启动关闭也会出现ORA-12514错误。
既然listener.ora中没有指定监听,我们可以在listener.ora文件中指定监听的实例名,这样该问题应该可以连接。
修改监听程序参数文件的两种方案:
一、初次打开时,内容如下
# listener.ora Network Configuration File: C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\Program_Files\Oracle\DataBase_11G_R2
修改为:
# listener.ora Network Configuration File: C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1)
#(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\Program_Files\Oracle\DataBase_11G_R2\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = orcl))
(ADDRESS = (PROTOCOL = TCP)(HOST =202.206.0.233)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\Program_Files\Oracle\DataBase_11G_R2
SID_NAME,KEY 的值修改为要访问的oracle实例的名称,HOST 修为 oracle 服务器使用的地址
二、
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\Oracle10g)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = E:\Oracle10g)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = onest)(PORT = 1521))
)
)
标红的为我添加的部分,ORCL为监听的实例名。