Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9268339
  • 博文数量: 1669
  • 博客积分: 16831
  • 博客等级: 上将
  • 技术积分: 12594
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 07:23
个人简介

柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!

文章分类

全部博文(1669)

文章存档

2023年(4)

2022年(1)

2021年(10)

2020年(24)

2019年(4)

2018年(19)

2017年(66)

2016年(60)

2015年(49)

2014年(201)

2013年(221)

2012年(638)

2011年(372)

分类:

2012-01-10 10:34:37

ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect 问题的解决!
分类: 数据库 575人阅读 评论(0) 举报

应用不能连接数据库了。应用日志里发现如下错误:

ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect。

解决办法如下:

$ tnsping arsprd.emea.net

TNS Ping Utility for Solaris: Version 9.2.0.7.0 - Production on 22-JUN-2010 04:07:53

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
/global/oracle/orahome1/product/9.2.0/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.16.224.200)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ARSPRD.EMEA.NET)))
OK (0 msec)

注意:SERVICE_NAME = ARSPRD.EMEA.NET。
$ sqlplus

SQL*Plus: Release 9.2.0.7.0 - Production on Tue Jun 22 04:08:12 2010

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

ERROR:
ORA-12514: TNS:listener could not resolve SERVICE_NAME given in connect
descriptor

$ lsnrctl

LSNRCTL for Solaris: Version 9.2.0.7.0 - Production on 22-JUN-2010 04:08:54

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> status
Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 9.2.0.7.0 - Production
Start Date                22-JUN-2010 04:07:36
Uptime                    0 days 0 hr. 1 min. 20 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /global/oracle/orahome1/product/9.2.0/network/admin/listener.ora
Listener Log File         /global/oracle/orahome1/product/9.2.0/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=Orc01ud-lon01)(PORT=1521)))
Services Summary...
Service "ARSPRD.sevenspace.net" has 1 instance(s).
  Instance "ARSPRD", status READY, has 1 handler(s) for this service...
The command completed successfully

注意:在linster里:Service "ARSPRD.sevenspace.net"

修改listener.ora or tnsnames.ora文件其中一个,让其与另一个文件里的配置一致就可以了.

这里的listener是动态注册的,服务名可以在初始化参数里修改。

$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.7.0 - Production on Tue Jun 22 04:06:56 2010

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.7.0 - Production

SQL> show parameter service

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
mts_service                          string      ARSPRD
service_names                        string      ARSPRD
SQL> alter system set service_names='ARSPRD.EMEA.NET';

System altered.

SQL>

这时再连接就可以了。

阅读(1743) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~