Link to home
Start Free TrialLog in
Avatar of Arrismog
Arrismog

asked on

Linux - Oracle : how to change port 1522 to 1521 listener-db-em

Hello experts!

I currently have Oracle 11gR2 running on a SuSE 10 SP3.

Checking the listener.ora and tnsnames, as well as with the lsnrctl status command, it seems that the listening port is 1522. I would like to change it to the default (1521), so I don't need to add the port parameter in my php programs via the oci_connect function.

I've been searching on oracle's docs, and found this:
http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/network.htm#BHCDDAII

I followed all steps under the "Changing the Listener Port Number for Database Connection Requests" section, but now, the em console wouldn't even connect to the database instance nor the listener. The problem seems that em still waits to the 1522 port. From what I understand, listener and instance are now communicating between each other because the lsnrctl status now shows a ready connection at 1521, but em's still trying on 1522

Is there any additional config that is needed to be done at the em console's side? :( I'm kind of new with Oracle Admin.



Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Change the listener.ora file on the database server.  That is what sets the port.

It should be in $ORACLE_HOME/network/admin
ASKER CERTIFIED SOLUTION
Avatar of mrjoltcola
mrjoltcola
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In addition to comment 1 above, as a matter of best practice, i would recommend save a copy of the previous listener.ora with a cp -p, so that you will preserve the timestamps, if that is needed.
I guess I should also add:  Why set it to the default port?

Typically in production, you don't chose any default values.  You open yourself up to hacking/cracking this way.  If I know you are running Oracle, 1521 is the first port I'll go after.

If I'm looking to see if your running Oracle, same thing.  I'll try 1521 and all default users/passwords.

I pick a port not even close to anything 'default' for my production systems.
Avatar of Arrismog

ASKER

@mrjoltcola:
When issuing the emca -config dbcontrol db, it asks for info like the ORACLE_HOME, SID, hostname, etc, but never asks the listener port and uses the 1522, even in the "confirm" section of this command, it displays 1522, never asking the new one:

-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /opt/oracle/product/11.2.0/dbhome_1

Local hostname ................ server1.mydomain
Listener ORACLE_HOME ................ /opt/oracle/product/11.2.0/dbhome_1
Listener port number ................ 1522
Database SID ................ sid
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]:

Open in new window


@slightwv: Yes, that's an important observation, at this point I'm using this environment for testing purposes, but this procedure will be useful when changing it to another port once I put it on production.

I believe the emca command was for reconfiguring after you change the port in the listener.ora file.
You must still have 1522 in listener.ora
Yes. What steve said.
If you are comfortable editing listener.ora, please make a copy of it and change the port and restart the listener.
We used this method so many times in the past and never faced any issue with that, if you think this is ok with you.
>>please make a copy of it

didn't you already suggest that?

>>and change the port

Already posted?

>>restart the listener.

Sort of implied...
Hi everyone!

Instead of running emca -config dbcontrol db , I executed:

emca -deconfig dbcontrol db
emca -config dbcontrol db -repos recreate

as noted in the docs provided by mrjoltcola.

The config dbcontrol took a while, but it, as the docs said, reconfigured the Database Control. Once it finished doing what it had to, I entered the em console again and it now communicates with the newly changed port listener :)!

So, what I've done (don't know if this was correct, but it worked for me):

1. changed listener.ora and tnsnames.ora manually with the new port

2. from sqlplus, ran the following

ALTER SYSTEM SET LOCAL_LISTENER = "(ADDRESS=(PROTOCOL=TCP)(HOST=server1.mydomain)(PORT=1521))";

ALTER SYSTEM REGISTER;

Open in new window


3. emca -deconfig dbcontrol db

4. emca -config dbcontrol db -repos recreate -- typed the host,sid, oracle_home and listener port

5. restarted em console : emctl start dbconsole

Thanks for all your support!
Why didn't you split the points since part of your answer was to change the listener.ora?
@slightwv:
I did change the listener.ora and tnsnames.ora even before asking the question :( as noted in my first comment (followed steps from http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/network.htm#BHCDDAII), what I was really missing was the reconfig command, but yes, I'm sorry I didn't split part of the points with you, you really helped me a lot. If there's any way to split it now, I will, if not, I'll keep it in mind in the next posts (which I'm sure I'll be having) :)
I wasn't aware that you had already changed the listener.ora file.

I misread the question.  That is my mistake.