Thursday, December 11, 2014

Connecting with Oracle: Oracle Ports By Steve Callan

source : http://www.databasejournal.com/features/oracle/article.php/3332361/Connecting-with-Oracle-Oracle-Ports.htm


Connecting with Oracle: Oracle Ports

1521. 1810. 2481. 7778. These are just a few of the port numbers Oracle uses in networking. Everyone knows 1521 is the typical port number used by a listener, but how sacrosanct is that? In other words, do other vendors know not to use 1521 for their applications because Oracle "owns" that port number? We will see the answer to that question later.
It is quite useful to know which ports Oracle commonly uses. It's also quite useful to know where to find references to what the well-known ports are in case you inherit an environment which uses more than the standard listener port of 1521. This article will help clarify some facts about port usage related to Oracle. Several documents from Oracle contain a great deal of information about port usage, and those sources will be identified as well.
One good thing about port usage is that this is a common thread between Windows and UNIX platforms. One major difference has to do with the location of a file which lists port usage, but even then, the path/file name is quite similar - /etc/services on UNIX and C:\WINDOWS\SYSTEM32\DRIVERS\ETC\SERVICES on XP (or C:\WINNT\SYSTEM32\DRIVERS\ETC\SERVICES on NT). Some Oracle installation guides will direct you to edit this file while others make no mention of it. So, is it necessary to add Oracle-related port assignments to this file?
The answer to that question is a qualified "No, but it depends on your situation." In many instances, where Oracle Net Services (or Net8) appears to be working just fine, you can pretty much ignore the services file. If you have port conflicts because of other applications, you may need to edit this file. But, in either case, you should edit the file as a means of documenting Oracle-related port usage. The services file is common to all major platforms (sorry Mac users, but you know I mean Windows and UNIX), and its purpose is to help you (or your administrator) by storing port usage/assignment, so why not use it?
Before answering the port 1521 question, we first have to play a semantics game. What is the difference between "well-known" and "well-known?" It depends on whether you are being technically precise or not. The term "well-known," when used in the context of "what are the ports you shouldn't mess with because some semi-official agency regulates these ports," refers to ports in the 0-1023 range. The semi-official agency that regulates this range is the IANA (Internet Assigned Numbers Authority). The IANA is "Dedicated to preserving the central coordinating functions of the global Internet for the public good." You can visit their website at www.iana.org for more information about their mission and so on.
The less restrictive "well-known" has to do with common vernacular. In other words, the everyone referred to in the opening paragraph just means that most software vendors know that Oracle uses 1521 as a standard default port for one of its applications, but Oracle does not outright own that port. Technically speaking, the port number 1521 lies within the registered port number range. A logical question based on Oracle's common reliance of using 1521 would be this: Does Oracle register 1521 with the IANA? Let's find out.
Here is a portion of the port numbers file at IANA:
WELL KNOWN PORT NUMBERS

The Well Known Ports are assigned by the IANA and on most systems can
only be used by system (or root) processes or by programs executed by
privileged users.

Ports are used in the TCP [RFC793] to name the ends of logical
connections which carry long term conversations.  For the purpose of
providing services to unknown callers, a service contact port is
defined.  This list specifies the port used by the server process as
its contact port.  The contact port is sometimes called the
"well-known port".

To the extent possible, these same port assignments are used with the
UDP [RFC768].

The range for assigned ports managed by the IANA is 0-1023.
Here is the top portion of a typical services file on Windows:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This file contains port numbers for well-known services defined by IANA
#
# Format:
#
#   /  [aliases...]   [#]
#

echo                7/tcp
echo                7/udp
discard             9/tcp    sink null
discard             9/udp    sink null
systat             11/tcp    users                  #Active users
systat             11/tcp    users                  #Active users
daytime            13/tcp
daytime            13/udp
qotd               17/tcp    quote                  #Quote of the day
qotd               17/udp    quote                  #Quote of the day
chargen            19/tcp    ttytst source          #Character generator
chargen            19/udp    ttytst source          #Character generator
ftp-data           20/tcp                           #FTP, data
ftp                21/tcp                           #FTP. control
telnet             23/tcp
If you look in the IANA port numbers file (http://www.iana.org/assignments/port-numbers), you will see the ports shown above. Looking further into the IANA file for 1521, we see that, in fact, Oracle Corporation is not the registered "owner" or vendor of 1521.
ncube-lm        1521/tcp    nCube License Manager
ncube-lm        1521/udp    nCube License Manager
#                           Maxine Yuen 
According its website, "nCUBE is a worldwide leader in providing On-Demand media systems (VOD) and Digital Advertising Systems." Sure doesn't sound like Oracle to me. Upon further inspection of the IANA file, you'll see two things related to Oracle: Oracle is not the registered vendor of many of its commonly used ports and that Oracle registers ports you typically do not see after an Oracle product is installed. At least now you know where to look if your attempt to create a listener on port 1521 is failing - and you happen to be using nCube's application on 1521 as well.
Where can you find typical Oracle-related port assignments? As mentioned, there are several places, and they include documentation you may not use or even be aware of. The installation guide for Application Server 10g (9.0.4) Forms and Reports Services, for example, contains a chapter detailing common Oracle port numbers (or the range of numbers). This is especially useful to know as a DBA when you are trying to access an Enterprise Manager Console of a server (PC or UNIX). Without knowing the port number, your access to the web-based control panel for Oracle (I like that analogy) isn't just limited, but rather, just isn't possible.
Another place to find port assignment is in the oraInventory directory's installation logs. Hunting down port assignments this way is harder, but at least you know Oracle recorded the information in this area. You can also look in your ORACLE_HOME/Apache/Apache directory if the product in question uses a web server. And, in the event you are installing an Oracle product which you are not familiar with, keep an eye on the dialog windows that appear at the end of the installation. Many times, these windows (just before you exit the installer) will show you port numbers used or configured by Oracle.
Hopefully, this article has given you more insight into some of the behind the scenes "program activities" (no, not like the "weapons of mass destruction program activities") related to Oracle's port usage. Port 1521 is "well-known" in some circles, but Oracle is not the only vendor to use it. Will Oracle stay on 1521 as the default listener port? Possibly not. Table 5-2 on page 5-4 of the Oracle9i Net Services Reference Guide states, "In future releases, this port number may change to the officially registered port number of 2483 for TCP/IP and 2484 for TCP/IP with SSL." Is 2483 officially registered? Now that we know where to find that information, we can confirm that statement. The port numbers file at IANA shows Oracle (including a point of contact) to be the registered vendor of these ports.
ttc  2483/tcp   Oracle TTC
ttc  2483/udp   Oracle TTC
ttc-ssl  2484/tcp   Oracle TTC SSL
ttc-ssl  2484/udp   Oracle TTC SSL
#      Chandar Venkataraman 

No comments:

Post a Comment