After installation of SAP system or in support phase, the requirement comes to change the oracle listener port number or even some time it is needed to rename the LISTENER to LISTENER_SID or something.
Lets first see how to change listener port.
To change the port you need to modify 3 files. two tnsnames.ora and one listener.ora file.
The location of tnsnames.ora will be at below two locations
- Stop sap application
- Stop listener
- No need to stop your database.
Now you can change the port numbers in the 3 files mentioned above, The port number is marked with red line can be changed with another number which is permissible as per your scenario.
Now you can start the listener, and your database is running then you can check connectivity from your application server by
R3trans -d it should work now.
You can also do the telnet from Database server or application server to the new port, it should connect.
telnet <DB hostname> <listener port>
Change of listener port done.
Now lets move to rename the listener name itself.
If you can notice listener.ora screenshot above, you can see the name is LISTENER, which is default value.
Now you want to rename it, lets say LISTENER_ECC.
If you will execute
$ ps -ef|grep lsn
|orar q 1007798||1 0 Apr 10||- 3:57 /oracle/R Q/112_64/bin/tnslsnr LISTENER -inherit|
This will show the listener process and its Name.
1. Here you need to stop your listener
$ lsnrctl stop LISTENER
2. Now you can modify the file
As per the screenshot, you need to change LISTENER to LISTENER_ECC in listener.ora file where it is marked with red line, save it and start the new listener
$ lsnrctl start LISTENER_ECC
Then check the process name when you will do
$ ps -ef|grep lsn
|orar s 1069298||1 0 Mar 29||- 4:39 /oracle/R S/112_64/bin/tnslsnr LISTENER_ECC -inherit|
Now you can see the listner is started with new name.
Wait its not done yet, when you will do R3trans -d it will not work!
You need to change the local listener inside oracle database, for that please proceed as below
Let your new listener LISTENER_ECC keep running
Start your SQL prompt with ora<sid>
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
Here you need to modify the parameter "local_listener"
SQL> alter system set local_listener='(address=(protocol=tcp)(host=ara- - -dbp05)(port=1521))';
Note: hostname and port should be same as it is mentioned in listener.ora
SQL> alter system register;
Now you can go and execute R3trans -d, it will be able to connect to database.
The renaming of listener is complete!
Hope this will be of help to some of us.
My other Blogs, if you have time...