1

I have a strange problem, the Oracle listener works just fine and has no problems, but when I connect to my company network the listener doesn't work, could any one advise me about that problem?

I am using xe oracle 11.

note: Host set here to "xxxxxx.xxxx.xxxxx.xxx", because I don't know if i'm officially allowed to list my computer name outside my network or not.

My tnsnames.ora

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxx.xxxx.xxxxx.xxx)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

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

ORACLR_CONNECTION_DATA = 
  (DESCRIPTION = 
    (ADDRESS_LIST = 
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) 
    ) 
    (CONNECT_DATA = 
      (SID = CLRExtProc) 
      (PRESENTATION = RO) 
    ) 
  )

My listener.ora

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxx.xxxx.xxxxx.xxx)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

Thanks

4

2 回答 2

0

我已经替换RAJESH-PC.xxxxx.xx.com with RAJESH-PC (hostname) or localhost 了 listener.ora 和 tnsnames.ora(path oraclexe\app\oracle\product\11.2.0\server\network\admin) 并重新启动了我的系统。连接到VPN后它工作正常。

listener.ora
===========
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = RAJESH-PC)(PORT = 1521))
    )
  )

或者

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )
  
  
  
  

tnsnames.ora

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = RAJESH-PC)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

或者

XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))

于 2021-01-10T10:09:31.970 回答
0

解决方案 2

请在主机文件路径(C:\Windows\System32\drivers\etc\hosts)中添加以下主机详细信息

127.0.0.1 localhost
localhost RAJESH-PC RAJESH-PC.xxxxx.xx.com
127.0.0.1 RAJESH-PC RAJESH-PC.xxxxx.xx.com
于 2021-01-13T04:59:22.963 回答