<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-19688662</id><updated>2011-04-21T16:41:53.354-07:00</updated><title type='text'>The Ivan Virag Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://viragi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19688662/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://viragi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ivan Virag</name><uri>http://www.blogger.com/profile/15333657250222195256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19688662.post-113440312440388604</id><published>2005-12-12T07:56:00.000-08:00</published><updated>2005-12-13T04:59:02.226-08:00</updated><title type='text'></title><content type='html'>&lt;span style="font-family:courier new;font-size:85%;"&gt;Listeners on NT and port 1521.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;Listeners on NT commonly listen on port 1521. It is a common misconception that if you allow access in to and out of the firewall by enabling access through port 1521, that SQL*Net clients will be able to connect. To understand why the connect will fail, it is necessary to understand how a SQL*Net connection on NT works.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;When a client initiates a connect, a TCP connection is established with port 1521. A TNS CONNECT packet is then sent to the listener. On UNIX systems the listener process will fork a new Oracle process to deal with the new incoming connection. With UNIX, forked processes will inherit the resources owned by the parent process, in other words file handles and TCP sockets. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;Earlier releases of SQL*Net for Windows NT used the WINSOCK V1.1 API. With this version of WINSOCK there is no capabaility of passing a TCP socket between two processes, and no way to inherit a TCP socket. To work around this restriction a new thread of execution is created by the main Oracle process and a local connection is made between the listener and this new thread. The newly created Oracle thread randomly selects a new TCP port, for example port 1087, to use for the connection request and informs the listener of the new port to be used. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;The listener now needs to inform the client that they need to REDIRECT the connection attempt to this newly selected networking endpoint. The listener now sends a TNS REDIRECT packet to the client with details of the new port to reconnect to. The client drops the existing TCP connection and then issues a TCP Connect sequence to the new TCP port, and this is then followed by a TNS Connect packet. If all is well and the Oracle server is able to process the incoming connection request, then the server thread will respond with a TNS ACCEPT packet and data will begin to flow.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;So, if you enable connects through port 1521 on your firewall, you can now see that after the REDIRECT packet has been sent to the client, the connect will fail as port 1087 is not enabled in the firewall. As the REDIRECT port that gets generated is entirely at random, you cannot enable access through multipleports in the firewall as you have no idea which ports will get allocated.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;To workaround this problem there are several options:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;1. Configure the firewall to limit IP addresses rather than port numbers. This is not a very secure option.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;2. Use Connection Manager so the TNS CONNECT following the REDIRECT happens the server side of the firewall. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;3. If you are on Oracle 8, you can use a WINSOCK V2 API feature called Shared Sockets . This allows a socket to be shared (or passed) between multiple processes. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;To use this functionality in a single Oracle Home enviroment, set USE_SHARED_SOCKET = TRUE in the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE section of the registry. If you are using Multiple Oracle Homes, change to the desired Oracle 8 Home and view the oracle.key file in ORACLE_HOME\BIN to find which registry key to add USE_SHARED_SOCKET to. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;Please Note that as WINSOCK V2 allows a socket to be shared between multiple processes, you cannot restart the listener without taking the database down first.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;This article was taken from Tom Kyte's asktom pages (&lt;a href="http://asktom.oracle.com"&gt;http://asktom.oracle.com&lt;/a&gt;).&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19688662-113440312440388604?l=viragi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://viragi.blogspot.com/feeds/113440312440388604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19688662&amp;postID=113440312440388604' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19688662/posts/default/113440312440388604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19688662/posts/default/113440312440388604'/><link rel='alternate' type='text/html' href='http://viragi.blogspot.com/2005/12/listeners-on-nt-and-port-1521.html' title=''/><author><name>Ivan Virag</name><uri>http://www.blogger.com/profile/15333657250222195256</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
