本帖最后由 Lyu_KingT 于 2010-04-23 13:51:57 编辑

解决方案 »

  1.   

    SQLPLUS登录的命令对>?
    TNS中的内容看看
      

  2.   


    SQL> conn  ktlis/12345@ktsrv
    ERROR:
    ORA-12170: TNS: 连接超时# tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.KTSRV =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.51.30)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = KTDELL)
        )
      )SAMPLE =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = KINGTANG-53A850)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = Sample)
        )
      )EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        )
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
        )
      )
      

  3.   

    KTSRV =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.51.30)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = KTDELL)
        )
      )中的服务名KTDELL是否在监听中是否注册成功 
    可以使用命令
    c:\>lsnrctl status
    查看一下监听器中注册的服务。
    服务有静态注册和动态注册两种。
      

  4.   

    LSNRCTL for 32-bit Windows: Version 10.2.0.3.0 - Production on 30-4月 -2010 13:1
    4:02Copyright (c) 1991, 2006, Oracle.  All rights reserved.正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    TNS-12541: TNS: 无监听程序
     TNS-12560: TNS: 协议适配器错误
      TNS-00511: 无监听程序
       32-bit Windows Error: 2: No such file or directory
    正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=KINGTANG-53A850)(PORT=1521)
    ))
    TNS-12541: TNS: 无监听程序
     TNS-12560: TNS: 协议适配器错误
      TNS-00511: 无监听程序
       32-bit Windows Error: 61: Unknown error
      

  5.   


    监听有问题。 重新配置一下。 参考:
    Oracle Listener 动态注册 与 静态注册 
    http://blog.csdn.net/tianlesoftware/archive/2010/04/30/5543166.aspxOracle 数据库监听配置
    http://blog.csdn.net/tianlesoftware/archive/2009/11/25/4861572.aspx------------------------------------------------------------------------------ 
    Blog: http://blog.csdn.net/tianlesoftware 
    网上资源: http://tianlesoftware.download.csdn.net 
    相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx 
    DBA1 群:62697716(满); DBA2 群:62697977
      

  6.   

    估计与windows的资源使用情况有关,你把service重新启动一次吧。以及看一下你的系统的内存使用情况 。另外,32bit的windows干脆用mts算了。
      

  7.   

    你用ping命令测试一下,也有可能是服务器出问题啦。
      

  8.   

    可能有几种原因:
    1.windows自带防火墙的问题,这个问题我遇到过。
    2.监听配置的问题有误。
    解决方法有几种:
    1.关掉防火墙。
    2.重新配置下监听。
    3.看下是不是自己IP出的问题,换个IP试试。
    4.实在不行,重装oracle。
      

  9.   

    toad 能连 表示监听配置没有问题
    接下来就是自带的防火墙以及端口的问题了
    在较老版本的windows里面  连 oracle9 的时候 会出现此种情况 
    可以参考下面的方法 
    在windowsserver2003系统防火墙上开放Oracle服务端口连接1521TNS超时
    关键字: 防火墙 oracle 1521 
    【转载】http://hi.baidu.com/%C2%ED%D3%C0/blog/item/31f4ee03b99704e808fa9325.html   要使Oracle客户端能正常连接到设置有防火墙的Oracle服务器,单开放一个1521或自定义的监听端口是不够的。   服务器装成Windows2003了,并开放了系统自带的防火墙,在连接中发现在防火墙上打开监听端口1521后还是无法连通,报TNS连接超时错误。于是试将防火墙关闭,就可以连通,说明还有什么端口未打开所致。
      当我打开1521端口时,连接操作仍然失败。我又怀疑网络有问题,用telnet server_ip:1521尝试,连接被接受,说明1521端口已经被打开。没有办法,查询Oracle资料后才明白,network listener 只起一个中介作用,当客户连接它时,它根据配置寻找到相应的数据库实例进程,然后spawned一个新的数据库连接,这个连接端口由network listener传递给客户机,此后客户机就不再和打交道了,即使listener停止了工作。这个新的连接端口是不可预知的,因而会被防火墙阻止。Windows Socket2 规范有一个新的特性,就是Shared Socket, 所谓共享套接字是指一个进程共享另一个进程的套接字(详见MSDN相关参考)。如果让network listener与数据库服务进程共享套接字,那么连接端口就不会变化。如何设置 Shared Socket?在注册表:HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0上新建一个字符串值:USE_SHARED_SOCKET=true。如果安装了多个目录,则每个类似的目录都要设置:HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEx (x目录编号)设置后要求重新启动实例Oracle 原文:USE_SHARED_SOCKETYou can set the USE_SHARED_SOCKET parameter to TRUE to enable the use of shared sockets. If this parameter is set to TRUE, the network listener passes the socket descriptor for client connections to the database thread. As a result, the client does not need to establish a new connection to the database thread and database connection time improves. Also, all database connections share the port number used by the network listener, which can be useful if you are setting up third-party proxy servers.On Windows NT 4.0 Service Pack3 or earlier, enabling this option precludes bringing the network listener up or down in a case where a database connection spawned by the network listener is active. Therefore, you may
    need to shut down all of the databases serviced by a network listener before you can bring down and restart a network listener. This results from the way shared sockets have been implemented in WINSOCK2. WINSOCK2 does not
    allow a reliable thread to a network listener on any port on which other connections are also active. This is not an issue on Windows NT 4.0 Service Pack 4 orlater. Oracle recommends that you upgrade to Windows NT 4.0 Service Pack 4 if you intend to set this parameter.This parameter only works in dedicated server mode in a TCP/IP environment. If this parameter is set, you cannot use the 8.1.5 listener to spawn Oracle 7.x databases. To spawn an Oracle 8.0.x database from an 8.1.5 listenerOracle客户端连接服务器,首先去找1521监听端口,服务器的1521监听端口再向server process进程发出请求,并返回一个随机端口,返回给客户端,客户端再来连接这个端口。 这样就给服务器上的防火墙设置带来了麻烦,这个端口是随机的,如何开放? 
    windows 平台上的这个问题成了一大难题,很多论坛都有人问,但很少有人能解决。 unix平台不用担心,系统自动会解决这个问题.windows 平台上的这个问题成了一大难题,很多论坛都有人问,但很少有人能解决。 unix平台不用担心,系统自动会解决这个问题. Matalink上提供了三种解决办法,实际上USE_SHARED_SOCKET 是最有效最方便的。但经过无数次实现,仍然没有成功,最后终于发现是Oracle 8.1.7的bug 需要打补丁,升级到Oracle 8.1.7.1.2 
    需要在MTS模式下(共享模式)需要在MTS模式下(共享模式) Oracle默认是专用模式。 
    经试验发现,如果不在init文件中设参数的话,Oracle仍然会要求一个随机端口和1521端口来共同通讯,只是这个随机端口,并不随客户端会话和登录的变化而变化,在没有重启服务器时,是固定的。经试验发现,如果不在init文件中设参数的话,Oracle仍然会要求一个随机端口和1521端口来共同通讯,只是这个随机端口,并不随客户端会话和登录的变化而变化,在没有重启服务器时,是固定的。(试验发现,在专用模式下,每次连接,oracle服务器会按+1方式,提供一个非1521的端口。)所以,还需要在init.ora文件的最后加上一条参数: 
    mts_dispatchers="(address=(protocol=tcp)(host=myoradb)(port=1521))(dispatchers=1)" 
    这样才真正实现只用一个端口,穿过防火墙。这样才真正实现只用一个端口,穿过防火墙。 参考资料: 
    Oracle uses dynamic ports under windows NT because of a bug in windows, so oracle can't use shared sockets. This bug got fixed with service pack 3 I think. By default, oracle uses the dynamic ports without caring which service pack is installed. There is a registry setting to force oracle to use shared sockets. The parameter is (what a surprise!) USE_SHARED_SOCKET in LOCAL_MACHINE\Software\Oracle\HomeX where X is your desired homedir. This parameter should be set to TRUE. There's a whitepaper from oracle for this too, somewhere on their site. Anyway, this parameter doesnt work for 8.1.7 Some users reported that it worked with 8.1.6.3, but 8.1.7 termiates every conection immediately...Oracle uses dynamic ports under windows NT because of a bug in windows, so oracle can't use shared sockets. This bug got fixed with service pack 3 I think. By default, oracle uses the dynamic ports without caring which service pack is installed. There is a registry setting to force oracle to use shared sockets. The parameter is (what a surprise!) USE_SHARED_SOCKET in LOCAL_MACHINE\Software\Oracle\HomeX where X is your desired homedir. This parameter should be set to TRUE. There's a whitepaper from oracle for this too, somewhere on their site. Anyway, this parameter doesnt work for 8.1.7 Some users reported that it worked with 8.1.6.3, but 8.1.7 termiates every conection immediately... Contributed by Arne Brutschy ([email protected] ) on July 5, 2001. 
    Actually, I want to establish a replication system in my local machine.. for replicating objects(tables) from remote database to a local database... what data security option i must take in to account. I request you to give me the detail description like which protocal must be used and what parameter must be set in init.ora file,sqlnet.ora and listener.ora file and what other steps to be taken... I would be very thankful to you ... if you kindly describe the things...actually i want to maintain the data privacy which happens between remote and local database while replication take place.. any one can trap the net and extract the data ... so i need to stop that. Actually, I want to establish a replication system in my local machine.. for replicating objects(tables) from remote database to a local database... what data security option i must take in to account. I request you to give me the detail description like which protocal must be used and what parameter must be set in init.ora file,sqlnet.ora and listener.ora file and what other steps to be taken... I would be very thankful to you ... if you kindly describe the things...actually i want to maintain the data privacy which happens between remote and local database while replication take place.. any one can trap the net and extract the data ... so i need to stop that. I would be very thankful to you ... this is a request.. please mail me on the address [email protected] . 
    regards p.v.rajuregards p.v.raju Contributed by pvraju ([email protected] ) on October 8, 2001. 
    Modify Windows registry. 
    USE_SHARED_SOCKET = TRUE Modify Windows registry. 
    USE_SHARED_SOCKET = TRUE - Oracle 8.1.6 for NT/2k \\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME <#> (# is your desired homedir) 
    - Oracle 8.1.7.0.0 for NT/2k Doesn't work in Oracle 8.1.7.0.0 for NT/2k 
    - Oracle 8.1.7.1.2 for NT/2k \\HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE