Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

'exlusively' reserving ports ???

SOLVED
Go to solution
JimA
Occasional Advisor

'exlusively' reserving ports ???

Hi all,

Does anyone know how to 'exclusively' reserve a port for the Oracle listener, as we are sometimes experiencing a conflict when the listener goes to use the port that we previously assigned to for it ?.

See below;

>Attempted to listen on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=****)(PORT=1521)))
>TNS-12542: TNS:address already in use
>TNS-12560: TNS:protocol adapter error
>TNS-00512: Address already in use
>DEC OSF/1 AXP Error: 48: Address already in use

Thanks in advance.

p.s environ: Tru64 alpha server, Oracle 8.1.7
WARNING: System Administration seriously damages your health !
15 REPLIES
Paula J Frazer-Campbell
Honored Contributor

Re: 'exlusively' reserving ports ???

Jim

When this happens check the port and see what has got it.

I would guess that Oracle has not dropped it from last attempt.

Paula
If you can spell SysAdmin then you is one - anon
Massimo Bianchi
Honored Contributor

Re: 'exlusively' reserving ports ???

Hi,
i don't know of any utility that can reserve a port.

You must reserve it when you install you programs, and be sure not to overlap.


152x are the favorites port for the listener, so usually one avoids using it.

What program is using the port now ? You can check with... on hpux with "netstat -a | grep 1521", i don't know on Tru64.


HTH,
Massimo
T G Manikandan
Honored Contributor

Re: 'exlusively' reserving ports ???

How is the entry in the $ORACLE_HOME/network/admin/listener.ora file.

I suspect duplicate entries there.

Please post your listener.ora file
JimA
Occasional Advisor

Re: 'exlusively' reserving ports ???

Hi Paula,

Ah!, a small problem, as it's occuring at 3am, when we shutdown & restart our instances, an ungodly hour for me to get out of bed and come and check !!

Not sure if it's the previous instance of the listener though, as we shutdown Oracle in a safe manner every night with no report of any errors/exceptions & this error is not happening on a regular basis either !?!?

Is there a way to preserve this port exlusively for the listener ?

thanks

j

WARNING: System Administration seriously damages your health !
T G Manikandan
Honored Contributor
Solution

Re: 'exlusively' reserving ports ???

Also sometimes this happens when the TCP/IP sockets which are created are sometimes hung.

These are created under /tmp/.oracle.

Any problems you can remove the .oracle subdirectory and re-start the listener to resolve the problem.

Thanks
Paula J Frazer-Campbell
Honored Contributor

Re: 'exlusively' reserving ports ???

Jim

Cron a job for just after 3am to grep usage of ports and pipe it to a file.

Not sure on tru64
Something like this:-

> /tmp/portinfo

HTH

Paula


If you can spell SysAdmin then you is one - anon
JimA
Occasional Advisor

Re: 'exlusively' reserving ports ???

hi,

massimo - it's the oracle listener using that port at the moment as Oracle is running !

TG - nope, no duplicates in the listener.ora file. we only have two listeners and both have exclusive ports assigned in the file.

???

j
WARNING: System Administration seriously damages your health !
Massimo Bianchi
Honored Contributor

Re: 'exlusively' reserving ports ???

Are you sure that you are not trying to start the listener a second time ?


The first start is succesfull, but every other subsequent try will lead at this error.

YOu can check in the $ORACLE_HOME/listener/log, if it is the case.

HTH,
Massimo
T G Manikandan
Honored Contributor

Re: 'exlusively' reserving ports ???

Also,

you can check which is already using 1521 using lsof utility.

You can confirm that if that was due to a different application then you need to think about reserving ports for Oracle listener.

If that was only from Oracle then you go for the troubleshooting way.

THanks
JimA
Occasional Advisor

Re: 'exlusively' reserving ports ???

hi,

massimo - it's definitely only the first occurence which fails !


TG - unfortunately have not got lsof on Tru64 (boo hiss !) - or we haven't got it here. but
i think you may be onto something with the tcp/ip port hangs, as it's listed as a tcp service in the /etc/services i.e listener99 1521/tcp - what are the usual reasons for tcp port hangs ? - perhaps i can keep an ey out for them.

j
WARNING: System Administration seriously damages your health !
Massimo Bianchi
Honored Contributor

Re: 'exlusively' reserving ports ???

HI,
if it not another application, i think that is a previuos instance of the listener left running.

the dbshut does not close it.


Can you please post a "lsnrctl status" output ?


Massimo
JimA
Occasional Advisor

Re: 'exlusively' reserving ports ???

hi,

paula - yes, i think a cron to find out what's going on at that time, is in order.

massimo - err, the output you requested is as follows;
Message 1053 not found; No message file for product=network, facility=TNSTNS-12541: Message 12541 not found; No message file for product=network, facility=TNS
TNS-12560: Message 12560 not found; No message file for product=network, facility=TNS
TNS-00511: Message 511 not found; No message file for product=network, facility=TNS
DEC OSF/1 AXP Error: 2: No such file or directory
Message 1053 not found; No message file for product=network, facility=TNSTNS-12541: Message 12541 not found; No message file for product=network, facility=TNS
TNS-12560: Message 12560 not found; No message file for product=network, facility=TNS
TNS-00511: Message 511 not found; No message file for product=network, facility=TNS
DEC OSF/1 AXP Error: 61: Connection refused

not exactly what you or i was expecting !!. what is going on ????

j
WARNING: System Administration seriously damages your health !
Massimo Bianchi
Honored Contributor

Re: 'exlusively' reserving ports ???

Hi,
for the listener it looks like some environtment variables are missing...

did you cehck them ?
as the owner of the listener, are there
ORACLE_HOME, ORACLE_SID, proper entries in ORA_NLS and in PATH ?

Massimo
A. Clay Stephenson
Acclaimed Contributor

Re: 'exlusively' reserving ports ???

You cron job is failing because you have not set an environm4ent. Cron/at jobs intentionally run under a very sparse environment. You will need to explicitly set and export variables like TNS_ADMIN before calling the Oracle executables in your script.

PS - It is NOT a good idea to use su - oracle either because Oracle's .profile will expect an interactive environemnt. You could surround all those stty's and tab's and tset's with "if [[ -t 0 ]] then ... fi but a much cleaner way would be to create a script that sets and exports these variables and then both your cron script AND Oracle's .profile include it with the "dot" operator. e.g . /usr/local/bin/oraenv.sh. This included scripts MUST NOT contain an exit or return,

Plan B. Shutdown only the Oracle instance but leave the listener running. I'm all but positive that you are not shutting down the listeners successfully.

And no, there is no way to reserve a port - other than to use it and allow other processes to fail to open a socket when it's already in use - exactly what you are seeing.
If it ain't broke, I can fix that.
JimA
Occasional Advisor

Re: 'exlusively' reserving ports ???

hi,

thanks everyone for your input, got to go try a couple of things now as a result of your suggestions. i will get back to you at some point to let you know the outcome ( or even enlist your help again ! ).

j
WARNING: System Administration seriously damages your health !