Chinaunix首页 | 论坛 | 博客
  • 博客访问: 452321
  • 博文数量: 403
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: -70
  • 用 户 组: 普通用户
  • 注册时间: 2016-09-05 12:45
文章分类

全部博文(403)

文章存档

2014年(3)

2013年(1)

2012年(3)

2011年(21)

2010年(13)

2009年(64)

2008年(9)

2007年(36)

2006年(253)

分类: Oracle

2009-09-03 15:48:01

[oracle@localhost ~]$ tnsping 211.1XX.XX.XX

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 10-DEC-2008 09:45:50

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

Used parameter files:
/home/oracle/product/10.2/network/admin/sqlnet.ora

TNS-03505: Failed to resolve name

      显然sqlnet.ora文件中的连接控制参数有些问题,检查下:

[oracle@localhost ~]$ more /home/oracle/product/10.2/network/admin/sqlnet.ora
# sqlnet.ora Network Configuration File: /home/oracle/product/10.2/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.

NAMES.DIRECTORY_PATH= (TNSNAMES)

#SQLNET.AUTHENTICATION_SERVICES= (NTS)

#NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

        参数NAMES.DIRECTORY_PATH只有一个TNSNAMES,看看官方文档的介绍:
tnsnames:local naming naming method
Set to resolve a net service name through the tnsnames.ora file on the client.


ldap:directory naming naming method
Set to resolve a database service name, net service name, or net service alias through a directory server.


onames:Oracle Names method
Set to resolve database objects through a Oracle Names server.


hostname:host naming method
Set to resolve a host name alias through an existing names resolution service or a centrally-maintained set of /etc/hosts files.


cds:Cell Directory Services (CDS) external naming method
Set to resolve an Oracle database name in a Distributed Computing Environment (DCE) environment.


nis:Network Information Service (NIS) external naming method
Set to resolve service information through an existing NIS.
       
        应该有六个参数的,于是增加一个hostname参数。再次进行连接即告成功。
[oracle@localhost ~]$ tnsping 2XX.1XX.2XX.XX

TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 10-DEC-2008 09:56:52

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

Used parameter files:
/home/oracle/product/10.2/network/admin/sqlnet.ora

Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=211.139.222.155))(ADDRESS=(PROTOCOL=TCP)(HOST=211.139.222.155)(PORT=1521)))
OK (70 msec)

        BTW:

      其实这个参数的default值Default
      NAMES.DIRECTORY_PATH=(tnsnames, onames, hostname)

        应经可以满足基本的要求了。-:)
阅读(2064) | 评论(0) | 转发(0) |
0

上一篇:tnsping命令

下一篇:nagios配置解释

给主人留下些什么吧!~~