Oracle客戶穿越防火牆難題

來源:互聯網
上載者:User
oracle|防火牆
近來由於工作需要,在Windows XP平台上安裝了Oracle9i資料庫作為測試之用,一切正常。但當客戶機串連伺服器時卻總是逾時,我首先想到了防火牆,當我開啟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 OFTWARE\ORACLE\HOME0上建立一個字串值:USE_SHARED_SOCKET=true。如果安裝了多個目錄,則每個類似的目錄都要設定:HKEY_LOCAL_MACHINE OFTWARE\ORACLE\HOMEx (x目錄編號)

設定後要求重新啟動執行個體(只重啟listener發現沒有效果)

引用資料:
http://www.computer-book-authors.org/aud_450.htm

典型問題:
http://www.lazydba.com/oracle/0__37815.html

when a client connects to a listener it uses port 1521 at the client machine. the listener then returns to the client thru a different port. The 1521 port is closed and the db connection uses the new port for communicating with the client. i want the listener to return to the client using port 1521, how?

metalink says use the use_shared_socket parameter, but its still not working. i set the parameter to true in the sys env and in the registry.
....

Oracle 原文:

USE_SHARED_SOCKET

You 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 listener

==============





聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.