日期:2014-05-16  浏览次数:20583 次

扯点关于tnsping的一点事


扯点关于tnsping的一点事


先介绍下我的测试环境,这个测试环境装了oracle 9i 10g 11g
每个版本都有自己的用户,如下:

[root@selene /]# ls -l
drwxr-xr-x   14 root     root         4096 Mar  2  2011 opt
drwxr-xr-x    6 ora11r2  dba          4096 Oct 21  2011 ora11r2
drwxr-xr-x    2 root     root         4096 Aug 15  2011 ora11test
drwxr-xr-x    5 oracle10 dba          4096 Oct 24  2011 oracle
drwxr-xr-x    8 oracle10 dba          4096 Apr 16  2013 oracle10
drwxr-xr-x    6 oracle11 dba          4096 Oct 20  2011 oracle11
drwxr-xr-x    3 root     root         4096 Apr 30  2008 oracle8
drwxr-xr-x    7 oracle9  dba          4096 Dec 28  2010 oracle9


----------为了做oracle10g dg 测试环境,准备利用现有的环境搭一个
----------于是先配置tnsnames.ora  lixora 为新添加的服务别名。

[oracle10@selene admin]#ora10$more tnsnames.ora
# tnsnames.ora Network Configuration File: /gridcontrol/app/oracle/db10g/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.


EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

LIXORA =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.80.18.241)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = lixora)
    )
  )


---------配置完,那就先测试一把:
[oracle10@selene admin]#ora10$tnsping lixora

TNS Ping Utility for Linux: Version 10.2.0.3.0 - Production on 10-MAR-2014 09:28:39

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

Used parameter files:
/oracle10/app/oracle/product/10.2.0/network/admin/sqlnet.ora

Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=lixora))(ADDRESS=(PROTOCOL=TCP)(HOST=60.191.124.236)(PORT=1521)))

----------------------------------------------注意好像有点不对哦!,看下host host=60.191.124.236 ,这个是神马?



--------------ping 下 lixora 看看会有什么情况?
[oracle10@selene admin]#ora10$ping lixora     
PING lixora (60.191.124.236) 56(84) bytes of data.
64 bytes from mailitciberia.com (60.191.124.236): icmp_seq=0 ttl=250 time=2.10 ms
64 bytes from mailitciberia.com (60.191.124.236): icmp_seq=1 ttl=250 time=1.79 ms

--- lixora ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 1.798/1.953/2.108/0.155 ms, pipe 2




---这个mailitciberia.com (60.191.124.236) 是什么玩意?难道/etc/hosts 里有啥配置,瞧一眼

[oracle10@selene admin]#ora10$more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost
10.80.18.164    selene
10.80.18.169    selene-vip
192.168.1.1