When installing oracle on Linux, I accidentally installed the listener twice. The port number of the listener is changed to 1522 instead of the default 1521. The client has not been connected for a long time, finally, we found that the port number of listener is incorrect. To change the listener port number, follow these steps:
1. Stop listener and run the LSNRCTL Stop command.
2. After the listener is stopped, go to your $ ORACLE_HOME/Network/admin and find the listener. ora file.
3. Use VI to edit this file. Here you can view the port number of listener and change it to the value you want. Here it is changed from 1522 to 1521.
4. Save the modified File
5. Start sqlplus and log on to the database using the system account. sqlplus system/password @***
6. Execute the following command:
Alter system set local_listener = "(address = (Protocol = TCP) (host = oraclehost) (Port = 1521 ))";
Alter system register;
7. Execute LSNRCTL status to verify the listener status.
Change the port number defined in the tnsnames. ora file related to the client or server, and verify the logon using sqlplus on the client.