Port used needs to be killed


 
Thread Tools Search this Thread
Operating Systems Solaris Port used needs to be killed
# 1  
Old 07-04-2007
Port used needs to be killed

Hi,

We are using oracle 10g in a Solaris box. The same box has Informatica also installed. But it runs on port 6001. But whenever the server is restarted the Oracle database picks up the port 6001 and does not allow Informatica to be started. But I am have no clue of which Oracle process is using this port. I had confirmed that Oracle is using that particular port, by shutting down and starting up the database.

Please help.
# 2  
Old 07-04-2007
Code:
lsof -i tcp:6001

and see which oracle process is taking it. If lsof is not installed, another way is i vaguely remembers its something like ptree , some command that starts with p****, check the sun manuals
# 3  
Old 07-04-2007
pfiles is the command you're thinking of under Solaris
Code:
# pfiles PID | grep INET
        sockname: AF_INET xxx.xxx.xxx.xxx  port: xxxx

Try something like this if you don't have lsof (or just install lsof....)
Code:
#!/bin/bash

# use this where lsof (for lsof -i tcp:<port>) isn't available

AWK="/usr/bin/awk"
ECHO="/bin/echo"
PARGS="/usr/bin/pargs"
PFILES="/usr/bin/pfiles"
PS="/usr/bin/ps"
SED="/usr/bin/sed"

${PS} -ef | ${SED} '1d' | while read PS_LINE; do
   PS_PID=$( ${ECHO} "${PS_LINE}" | ${AWK} '{print $2}' )
   PS_PROC=$( ${PARGS} ${PS_PID} | ${SED} -n '1p' | ${SED} 's/^[0-9][0-9]*:[    ]*\(.*\)$/\1/' )
   PORT_USAGE=$( ${PFILES} ${PS_PID} | ${AWK} '/AF_INET/ { printf( "\t%s(%s)\n", $3, $5 ) }' )
   if [ "${PORT_USAGE}" != "" ]; then
      ${ECHO} "${PS_PROC} [PID: ${PS_PID}]"
      ${ECHO} "${PORT_USAGE}"
   fi
done

exit 0

Cheers
ZB
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash script, find the next closed (not in use) port from some port range.

hi, i would like to create a bash script that check which port in my Linux server are closed (not in use) from a specific range, port range (3000-3010). the print output need to be only 1 port, and it will be nice if the output will be saved as a variable or in same file. my code is: ... (2 Replies)
Discussion started by: yossi
2 Replies

2. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

3. Solaris

Cabling and adapters to communicate to service processor serial port from Windows PC with USB port.

Hello, I have an unloaded T5140 machine and want to access the ILOM for the first time and subsequently the network port after that., and then load Solaris 10 the final January 2011 build. The first part is what confuses me -the cabling. I am coming from a Windows machine (w/appropriate... (5 Replies)
Discussion started by: joboy
5 Replies

4. IP Networking

Tcp ip port open but no such process (merged: Release A Port)

i want to kill a tcp connection by killing its pid with netstat -an i got the tcp ip connection on port 5914 but when i type ps -a or ps-e there is not such process running on port 5914 is it possible that because i do not log on with proper user account i can not see that process running? (30 Replies)
Discussion started by: alinamadchian
30 Replies

5. What is on Your Mind?

Has Oracle killed HP-UX

Has Oracle killed HP-UX with their gambit of telling the public they would no longer support Itanium? The company I work for in the Dallas, TX area has had several openings for HP-UX administrators and we're having such a tough time finding qualified people to fill them. I have been searching job... (3 Replies)
Discussion started by: keelba
3 Replies

6. Solaris

How to enable Serial port on ILOM, when Network Port is enabled in parallel

Hi Everyone, In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don't have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected... (3 Replies)
Discussion started by: bobby320
3 Replies

7. Shell Programming and Scripting

Killed by signal 15.

Hi all I have Master script, Main script ,and 4 Child script. Master.sh #!/bin/bash /export/home/user/Main.shMain.sh #!/bin/bash /export/home/user/Child1.sh & /export/home/user/Child2.sh & /export/home/user/Child3.sh & /export/home/user/Child4.sh &I run only Master.sh script... (1 Reply)
Discussion started by: almanto
1 Replies

8. UNIX for Advanced & Expert Users

ls is being killed

Hi There, Hope anyone can give me a hand on AIX oslevel -r 5300-05 Try to "ls *sh" from folder and it return killed, is there any clue on that? 1. perform ls and count ls * | wc -l 0 ksh: 561582 Killed 2. without provide "*" wildcard, the result can be return ls | wc ... (7 Replies)
Discussion started by: darkrainbow
7 Replies

9. UNIX for Dummies Questions & Answers

process not getting killed

I have a process that is in the sleeping state "S" and I have tried to stop it with a run control script that I use to stop/start it - but it does not stop. I have tried kill -9 <PID of process> with no change. I imagine that this process is sleeping with the kernel. It does not respond to... (5 Replies)
Discussion started by: finster
5 Replies
Login or Register to Ask a Question