服务器重启之后,连接数据库报“ORA-12514:TNS:监听程序当前无法识别连接描述符中请求的服务”,在网上查询修改数据库服务按照目录下的"listener.ora"文件,内容如下
# listener.ora Network Configuration File: D:\installpkg\WINDOWS.X64_193000_db_home\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D:\installpkg\WINDOWS.X64_193000_db_home)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\installpkg\WINDOWS.X64_193000_db_home\bin\oraclr19.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = D:\installpkg\WINDOWS.X64_193000_db_home)
(SID_NAME = ORCL))
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = WIN-HLKI1UOGCB3)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
保存重启服务后还是不行,重新修改指定监听后解决问题,修改内容如下,将红色字体处修改成连接数据时使用的实例名即可,我之前使用的示例名是“shyy”
# listener.ora Network Configuration File: D:\installpkg\WINDOWS.X64_193000_db_home\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = shyy)
(ORACLE_HOME = D:\installpkg\WINDOWS.X64_193000_db_home)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:D:\installpkg\WINDOWS.X64_193000_db_home\bin\oraclr19.dll")
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = WIN-HLKI1UOGCB3)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)