Change Listener Ports in RAC Environment


Look at the current port configured for the scan_listener
$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
$ lsnrctl status LISTENER_SCAN1

LSNRCTL for Solaris: Version 11.2.0.4.0 - Production on 01-JAN-20** 21:26:16

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Solaris: Version 11.2.0.4.0 - Production
Start Date                01-JAN-20** 16:08:18
Uptime                    0 days 5 hr. 17 min. 58 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /oracle/product/11.2.0.4/grid/log/diag/tnslsnr/db1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.160)(PORT=1521)))
Services Summary...
.
.
.
The command completed successfully
$ lsnrctl status LISTENER_SCAN2

LSNRCTL for Solaris: Version 11.2.0.4.0 - Production on 01-JAN-20** 21:28:32

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN2
Version                   TNSLSNR for Solaris: Version 11.2.0.4.0 - Production
Start Date                19-NOV-2017 10:42:19
Uptime                    1 days 10 hr. 46 min. 13 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /oracle/product/11.2.0.4/grid/log/diag/tnslsnr/db1/listener_scan2/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.162)(PORT=1521)))
Services Summary...
.
.
.
The command completed successfully
$ lsnrctl status LISTENER_SCAN3

LSNRCTL for Solaris: Version 11.2.0.4.0 - Production on 01-JAN-20** 21:31:37

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN3
Version                   TNSLSNR for Solaris: Version 11.2.0.4.0 - Production
Start Date                19-NOV-2017 10:42:22
Uptime                    1 days 10 hr. 49 min. 14 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /oracle/product/11.2.0.4/grid/log/diag/tnslsnr/db1/listener_scan3/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.161)(PORT=1521)))
Services Summary...
.
.
.
The command completed successfully
Change the scan_listener port
$ srvctl modify scan_listener -p TCP:1523
Check that the new parameter was setup properly
$ srvctl config scan_listener 
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1523
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1523
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1523
Look at the current port configured for the listener
$ srvctl config listener -l LISTENER
Name: LISTENER
Network: 1, Owner: oracle
Home:
End points: TCP:1521
$ lsnrctl status LISTENER

LSNRCTL for Solaris: Version 11.2.0.4.0 - Production on 01-JAN-20** 21:38:20

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host1-vip)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 11.2.0.4.0 - Production
Start Date                01-JAN-20** 09:31:31
Uptime                    0 days 12 hr. 6 min. 48 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /oracle/base/diag/tnslsnr/db1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.158)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.150)(PORT=1521)))
Services Summary...
.
.
.
The command completed successfully
Change the listener port
$ srvctl modify listener -l LISTENER -p 1523 
Change port 1521 to 1523 in listener.ora on all nodes
$ vi $GRID_HOME/network/admin/listener.ora
From
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = host1-vip )(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
To
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = host1-vip )(PORT = 1523))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1523))
    )
  )
In 12c change MGMTDB listener
Look at the current port configured for the listener
$ srvctl config listener -l MGMTLSNR
Name: MGMTLSNR
Type: Management Listener
Owner: oracle
Home:
End points: TCP:1525
Listener is enabled.
Listener is individually enabled on nodes:
Listener is individually disabled on nodes:
Change the listener port
$ srvctl modify listener -l MGMTLSNR -p 1523 
Check that the new parameter was setup properly
$ srvctl config listener -l MGMTLSNR
Name: MGMTLSNR
Type: Management Listener
Owner: oracle
Home:
End points: TCP:1523
Listener is enabled.
Listener is individually enabled on nodes:
Listener is individually disabled on nodes:
Stop listeners
$ srvctl stop scan_listener
$ srvctl stop listener
$ srvctl stop MGMTLSNR
Start listeners
$ srvctl start listener
$ srvctl start scan_listener
$ srvctl start MGMTLSNR
Check that the new parameter was setup properly
$ lsnrctl status LISTENER

LSNRCTL for Solaris: Version 11.2.0.4.0 - Production on 01-JAN-20** 21:38:20

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=host1-vip)(PORT=1523)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 11.2.0.4.0 - Production
Start Date                01-JAN-20** 09:31:31
Uptime                    0 days 12 hr. 6 min. 48 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /oracle/base/diag/tnslsnr/db1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.158)(PORT=1523)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1523)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.150)(PORT=1523)))
Services Summary...
.
.
.
The command completed successfully
$ lsnrctl status LISTENER_SCAN1

LSNRCTL for Solaris: Version 11.2.0.4.0 - Production on 02-JAN-20** 21:26:16

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Solaris: Version 11.2.0.4.0 - Production
Start Date                02-JAN-20** 16:08:18
Uptime                    0 days 5 hr. 17 min. 58 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /oracle/product/11.2.0.4/grid/log/diag/tnslsnr/db1/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.160)(PORT=1523)))
Services Summary...
.
.
.
The command completed successfully
$ lsnrctl status LISTENER_SCAN2

LSNRCTL for Solaris: Version 11.2.0.4.0 - Production on 02-JAN-20** 21:28:32

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN2
Version                   TNSLSNR for Solaris: Version 11.2.0.4.0 - Production
Start Date                19-NOV-2017 10:42:19
Uptime                    1 days 10 hr. 46 min. 13 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /oracle/product/11.2.0.4/grid/log/diag/tnslsnr/db1/listener_scan2/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.162)(PORT=1523)))
Services Summary...
.
.
.
The command completed successfully
$ lsnrctl status LISTENER_SCAN3

LSNRCTL for Solaris: Version 11.2.0.4.0 - Production on 02-JAN-20** 21:31:37

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN3
Version                   TNSLSNR for Solaris: Version 11.2.0.4.0 - Production
Start Date                19-NOV-2017 10:42:22
Uptime                    1 days 10 hr. 49 min. 14 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0.4/grid/network/admin/listener.ora
Listener Log File         /oracle/product/11.2.0.4/grid/log/diag/tnslsnr/db1/listener_scan3/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=***.***.*.161)(PORT=1523)))
Services Summary...
.
.
.
The command completed successfully
Change ASM instances & database parameters for the new port
SQL> show parameter listener
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
listener_networks                    string
local_listener                       string      (DESCRIPTION=(ADDRESS_LIST=(AD
                                                 DRESS=(PROTOCOL=TCP)(HOST=***.
                                                 ***.*.158)(PORT=1521))))
remote_listener                      string      scan_address:1521
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=***.***.*.158)(PORT=1523))))';alter system set remote_listener='scan_address:1523';
Modify tnsnames.ora
$ vi $ORACLE_HOME/network/admin/tnsnames.ora
From
DB1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = host1-vip)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = db1)
    )
  )
To
DB1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = host1-vip)(PORT = 1523))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = db1)
    )
  )
Check the new port via tnsping
$ tnsping db1

TNS Ping Utility for Solaris: Version 11.2.0.4.0 - Production on 20-NOV-2017 21:49:09

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:
/oracle/product/11.2.0.4/dbhome_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host1-vip)(PORT = 1523))) (CONNECT_DATA = (SERVICE_NAME = db1)))
OK (10 msec)
$ sqlplus system@db1

SQL*Plus: Release 11.2.0.4.0 Production on Mon Nov 20 21:50:28 2017

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Enter password:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options
SQL>

Comments

Popular posts from this blog

Fixing & Registering ORACLE_HOMES in Central Inventory

List RMAN backups size

AWR Generating & Setting