Collated from the network, for reference.
First, see which process the port number is occupied by Netstat-ano, but-O can only show the PID of the process
Take port number 1521 for example:
C:\Documents and Settings\administrator>netstat-ano | Find "1521"
TCP 0.0.0.0:1521 0.0.0.0:0 listening 212
tcp 10.0.5.215:1049 10.0.5.215:1521 established 276
TCP 10.0.5.215:1050 10.0.5.215:1521 established 372
TCP 10.0.5.215:1051 10.0.5.215:1521 established
TCP 10.0.5.215:1052 10.0.5.215:1521 established 388
TCP 10.0.5.215:1521 10.0.5.215:1049 established 212
TCP 10.0.5.215:1521 10.0.5.215:1050 established 212
TCP 10.0.5.215:1521 10.0.5.215:1051 established 212
TCP 10.0.5.215:1521 10.0.5.215:1052 established 212
Then view the process details for 276, 372, 400, 388.
c:\documents and Settings\administrator>tasklist | findstr "212" Tnslsnr. EXE 212 Console 0 6,704 K C:\Documents and Settings\administrator>tasklist | findstr "276" Jqs.exe 1276 Console 0 1,812 K Oracle.exe
276 console 0 156,192 k oscar.exe 5876 Console 0 105,276 k C:\Documents and Settings\administrator>tasklist | findstr "372" Oracle.exe 372 Console 0 118,856 K Java.exe 4 696 Console 0 91,372 K C:\Documents and Settings\administrator>tasklist | findstr "388" Msdtc.exe 660 Console 0 4,388 K Oracle.exe 388 Console 0 118,180 k alg.exe 3884 Console 0 2,948 k
Also, you can use the above method to see which port numbers a process occupies.
Getting PID for a process
C:\Documents and Settings\administrator>netstat-ano | Find "276"
TCP 0.0.0.0:1047 0.0.0.0:0 listening 276
TCP 10.0.5.215:1049 10.0.5.215:1521 established 276
TCP 127.0.0.1:5152 0.0.0.0:0 listening 1276
You can also use the Task Manager to select View-> Select Columns->pid options to view the PID of the program
View the port number that corresponds to the PID process usage
C:\Documents and Settings\administrator>netstat-ano | Find "276"
TCP 0.0.0.0:1047 0.0.0.0:0 listening 276
TCP 10.0.5.215:1049 10.0.5.215:1521 Established 276
TCP 127.0.0.1:5152 0.0.0.0:0 listening 1276