How to see protocol statics and curent TCP/IP network connections in Windows.

9:41 AM 0 Comments

Displays protocol statistics and current TCP/IP network connections.

NETSTAT [-a] [-b] [-e] [-n] [-o] [-p proto] [-r] [-s] [-v] [interval]

-a Displays all connections and listening ports. -b Displays the executable involved in creating each connection or listening port. In some cases well-known executables host multiple independent components, and in these cases the sequence of components involved in creating the connection or listening port is displayed. In this case the executable name is in [] at the bottom, on top is the component it called, and so forth until TCP/IP was reached. Note that this option can be time-consuming and will fail unless you have sufficient permissions.
-e Displays Ethernet statistics. This may be combined with the -s option.
-n Displays addresses and port numbers in numerical form.
-o Displays the owning process ID associated with each connection.
-p proto Shows connections for the protocol specified by proto; proto may be any of: TCP, UDP, TCPv6, or UDPv6. If used with the -s option to display per-protocol statistics, proto may be any of: IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.
-r Displays the routing table.
-s Displays per-protocol statistics. By default, statistics are shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6; the -p option may be used to specify a subset of the default.
-v When used in conjunction with -b, will display sequence of components involved in creating the connection or listening port for all executables.
interval Redisplays selected statistics, pausing interval seconds between each display. Press CTRL+C to stop redisplaying statistics. If omitted, netstat will print the current configuration information once.

Example:

c:\>netstat -an


Proto Local Address Foreign Address State
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING TCP 0.0.0.0:1030 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1074 0.0.0.0:0 LISTENING TCP 0.0.0.0:1313 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1521 0.0.0.0:0 LISTENING TCP 0.0.0.0:2101 0.0.0.0:0 LISTENING
TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING TCP 0.0.0.0:7201 0.0.0.0:0 LISTENING
TCP 0.0.0.0:8009 0.0.0.0:0 LISTENING TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING
TCP 0.0.0.0:8081 0.0.0.0:0 LISTENING TCP 0.0.0.0:8109 0.0.0.0:0 LISTENING
...

How to stop Oracle XDB (Port 8080 and Tomcat)

3:26 PM 0 Comments

TXDB stands for XML Database. It's a bundle of Oracle features to support XML in the database and includes HTTP and FTP interfaces (port 8080 and 2100 respectively). If you are not using XDB, and you're not on the 9.2.0.4 patchset, you should disable XDB. There were some serious security vulnerabilities that were fixed in the 9.2.0.4 patchset.

# How to turn off or change XDB configuration:

To disable XDB, you can use Oracle Database Configuration Assistant.

  1. Execute Oracle Database Configuration Assistant. Start -> Programs -> Oracle - OraHome92 -> Configuration and Migration Tools -> Database Configuration Assistant.
  2. At step 1 of 4, select "Configure database options in a database". Click Next.
  3. At step 2 of 4, select the database the you want to configure options in Available Database(s) list. Click Next.
  4. At step 3 of 4, click "Standard database features..." button.
  5. In the Standard databae features dialog, click "Customize..." button.
  6. Change XDB setting in the Oracle XML DB dialog. (Enable/Disable or Ports being used).
  7. Click button OK to close the Oracle XML DB dialog.
  8. Click button OKto close the Standard database features dialog.
  9. Click button Next
  10. At setp 4 of 4, Click button Finish.

# Quick tip to check ports listening:

After you doing above step, you can check whether or not 8080 port is being used by using following command.

c:\>netstat -an

# About Oracle XML DB

It provides HTTP, FTP and WebDAV protocol servers as part of the database. These servers will be available for client access as soon as the database starts up (I think thru Listner service). XML DB protocol servers are implemented using the Oracle shared server infrastructure. Default port for FTP is 2100 and the default for HTTP and WebDAV is 8080.