ORA12514 解决方法

1.问题描述:在客户端使用shutdown immediate关闭远程数据库后,无法startup,提示错误为:ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务。操作如下:

Microsoft Windows XP [版本 5.1.2600]

(C) 版权所有 1985-2001 Microsoft Corp.



C:\Documents and Settings\IBM>sqlplus



SQL*Plus: Release .1.0 - Production on 星期三 9月 12 10:20:56 2007



Copyright (c) 1982, 2005, Oracle. All rights reserved.



请输入用户名: sys/password@s210 as sysdba



连接到:

Oracle Database Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options



SQL> shutdown immediate

数据库已经关闭。

已经卸载数据库。

ORACLE 例程已经关闭。

SQL> startup

ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务

SQL> conn sys/password@s210 as sysdba

ERROR:

ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务

2.检查服务器端:

Microsoft Windows [版本 5.2.3790]

(C) 版权所有 1985-2003 Microsoft Corp.



C:\Documents and Settings\Administrator>sqlplus



SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 9月 12 10:40:02 2007



Copyright (c) 1982, 2005, Oracle. All rights reserved.

2.1使用操作系统验证方式可以登录

请输入用户名: / as sysdba



连接到:

Oracle Database Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

2.2使用连接符无法登录

SQL> conn sys/password@orcl as sysdba

ERROR:

ORA-12514: TNS: 监听程序当前无法识别连接描述符中请求的服务





警告: 您不再连接到 ORACLE。

2.3检查监听,发现未设置对服务名的监听(Oracle默认安装后不自动设置监听)。

2.3.1修改前为:

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(PROGRAM = extproc)

(SID_NAME = PLSExtProc)

(ORACLE_HOME = d:\oracle\product\10.2.0\db_1)

)

)



LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

)

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = hdsb-dell)(PORT = 1521))

)

)

2.3.2修改后为:

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = orcl)

(ORACLE_HOME = d:\oracle\product\10.2.0\db_1)

(SID_NAME = ORCL)

)

(SID_DESC =

(PROGRAM = extproc)

(SID_NAME = PLSExtProc)

(ORACLE_HOME = d:\oracle\product\10.2.0\db_1)

)

)



LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))

)

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = hdsb-dell)(PORT = 1521))

)

)

2.4重启监听:

SQL> host

Microsoft Windows [版本 5.2.3790]

(C) 版权所有 1985-2003 Microsoft Corp.



C:\Documents and Settings\Administrator>lsnrctl stop



LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 12-9月 -2007 10:4

1:56



Copyright (c) 1991, 2005, Oracle. All rights reserved.



正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

命令执行成功



C:\Documents and Settings\Administrator>lsnrctl start



LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 12-9月 -2007 10:4

2:00



Copyright (c) 1991, 2005, Oracle. All rights reserved.



启动tnslsnr: 请稍候...



TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production

系统参数文件为d:\oracle\product\10.2.0\db_1\network\admin\listener.ora

写入d:\oracle\product\10.2.0\db_1\network\log\listener.log的日志信息

监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))

监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hdsb-dell)(PORT=1521)))



正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

LISTENER 的 STATUS

------------------------

别名                      LISTENER

版本                      TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ

ction

启动日期                  12-9月 -2007 10:42:02

正常运行时间              0 天 0 小时 0 分 1 秒

跟踪级别                  off

安全性                    ON: Local OS Authentication

SNMP                      OFF

监听程序参数文件          d:\oracle\product\10.2.0\db_1\network\admin\listener.o

ra

监听程序日志文件          d:\oracle\product\10.2.0\db_1\network\log\listener.log



监听端点概要...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=hdsb-dell)(PORT=1521)))

服务摘要..

服务 "PLSExtProc" 包含 1 个例程。

例程 "PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...

服务 "orcl" 包含 1 个例程。

例程 "ORCL", 状态 UNKNOWN, 包含此服务的 1 个处理程序...

命令执行成功



C:\Documents and Settings\Administrator>exit

2.5再次测试:

SQL> conn sys/password@orcl as sysdba

已连接。

SQL>

3.再测试客户端的启动关闭:

C:\Documents and Settings\IBM>sqlplus "sys/password@s210 as sysdba"



SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 9月 12 10:45:27 2007



Copyright (c) 1982, 2005, Oracle. All rights reserved.





连接到:

Oracle Database Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options



SQL> shutdown immediate

数据库已经关闭。

已经卸载数据库。

ORACLE 例程已经关闭。

SQL> startup

ORACLE 例程已经启动。



Total System Global Area 1073741824 bytes

Fixed Size                  1253124 bytes

Variable Size             104857852 bytes

Database Buffers          960495616 bytes

Redo Buffers                7135232 bytes

数据库装载完毕。

数据库已经打开。

原文地址:https://www.cnblogs.com/danghuijian/p/4400405.html