How To modify listener port in oracle 11g Grid

yyp2009發表於2016-02-25
My env as follows:
OS:

[root@ORACLERAC2 ~]# uname -a
Linux ORACLERAC2 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@ORACLERAC2 ~]# cat /proc/version 
Linux version 2.6.32-358.el6.x86_64 (mockbuild@x86-022.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Tue Jan 29 11:47:41 EST 2013
[root@ORACLERAC2 ~]#  lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description:    Red Hat Enterprise Linux Server release 6.4 (Santiago)
Release:        6.4
Codename:       Santiago

DB:
110204 GRID TWO NODE:
[oracle@ORACLERAC2 lib]$ sqlplus '/ as sysdba'
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 25 09:55:35 2016
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE    11.2.0.4.0      Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

1 Only one rac node1 opr as follows:
[grid@ORACLERAC1 ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 25-FEB-2016 09:29:03
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                24-FEB-2016 17:26:54
Uptime                    0 days 16 hr. 2 min. 8 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/ORACLERAC1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=135.149.48.148)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=135.149.48.150)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "standb" has 1 instance(s).
  Instance "standb1", status READY, has 1 handler(s) for this service...
Service "standbXDB" has 1 instance(s).
  Instance "standb1", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@ORACLERAC1 ~]$ srvctl config listener  
Name: LISTENER
Network: 1, Owner: grid
Home:
End points: TCP:1521
[grid@ORACLERAC1 ~]$ srvctl modify listener -l LISTENER -p "TCP:1621" 
[grid@ORACLERAC1 ~]$ srvctl config listener  
Name: LISTENER
Network: 1, Owner: grid
Home:
End points: TCP:1621
[grid@ORACLERAC1 ~]$  srvctl modify scan_listener -p 1621
[grid@ORACLERAC1 ~]$ srvctl config listener  
Name: LISTENER
Network: 1, Owner: grid
Home:
End points: TCP:1621
[grid@ORACLERAC1 ~]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1621
[grid@ORACLERAC1 ~]$ 
[oracle@ORACLERAC1 ~]$ 
[oracle@ORACLERAC1 ~]$ export ORACLE_SID=standb1
[oracle@ORACLERAC1 ~]$ 
[oracle@ORACLERAC1 ~]$ 
[oracle@ORACLERAC1 ~]$ sqlplus '/ as sysdba'
SQL*Plus: Release 11.2.0.4.0 Production on Thu Feb 25 09:33:10 2016
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=135.149.48.148)(PORT=1621))' scope=both  sid='standb1';
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=135.149.48.150)(PORT=1621))' scope=both  sid='standb1';
System altered.
SQL> SQL> 
System altered.
SQL> 
SQL> show parameter remote_listener
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_listener                      string      oraclerac-scan:1621
[grid@ORACLERAC1 ~]$ srvctl stop listener -l LISTENER -n ORACLERAC1
[grid@ORACLERAC1 ~]$ cd /u01/app/11.2.0/grid/network/admin
[grid@ORACLERAC1 admin]$ ls
endpoints_listener.ora  listener1602245PM2650.bak  listener.ora  listener.ora.bak.oraclerac1  samples  shrept.lst  sqlnet.ora
[grid@ORACLERAC1 admin]$ vi endpoints_listener.ora
LISTENER_ORACLERAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oraclerac1-vip)(PORT=1621))(ADDRESS=(PROTOCOL=TCP)(HOST=135.149.48.148)(PORT=1621)(IP=FIRST))))             # line added by Agent
[grid@ORACLERAC1 admin]$ srvctl stop listener -l LISTENER -n ORACLERAC1
[grid@ORACLERAC1 admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 25-FEB-2016 09:39:25
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 2: No such file or directory
[grid@ORACLERAC1 admin]$ 
[grid@ORACLERAC1 admin]$ 
[grid@ORACLERAC1 admin]$  srvctl start  listener -l LISTENER -n ORACLERAC1
[grid@ORACLERAC1 admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 25-FEB-2016 09:39:34
Copyright (c) 1991, 2013, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                25-FEB-2016 09:39:31
Uptime                    0 days 0 hr. 0 min. 3 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/ORACLERAC1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=135.149.48.148)(PORT=1621)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=135.149.48.150)(PORT=1621)))
Services Summary...
Service "standb" has 1 instance(s).
  Instance "standb1", status READY, has 1 handler(s) for this service...
Service "standbXDB" has 1 instance(s).
  Instance "standb1", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@ORACLERAC1 admin]$ 

2 Only another rac node2 opr as follows:
…… 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13750068/viewspace-1994181/,如需轉載,請註明出處,否則將追究法律責任。

相關文章