10g RAC 修改監聽端口

11gRAC修改端口:       http://blog.csdn.net/bamuta/article/details/29863943 

11gRAC增加監聽1:    http://blog.csdn.net/bamuta/article/details/29865023

11gRAC增加監聽2:    http://blog.csdn.net/bamuta/article/details/30029437

10gRAC修改端口            http://blog.csdn.net/bamuta/article/details/30050833


10g RAC監聽

         10gRAC的監聽相對較爲簡單,和單實例配置差不多,在oracle用戶下,oracle home下配置。

 

10g修改端口:

下面步驟將1521修改爲1522

 

修改listener(兩個節點都需要改)

 

o10n2->cd/oracle/product/10.2.0/db_1/network/admin/

o10n2->vi listener.ora

 

SID_LIST_LISTENER_O10N2 =
 (SID_LIST =
   (SID_DESC =
     (SID_NAME = PLSExtProc)
     (ORACLE_HOME = /oracle/product/10.2.0/db_1)
     (PROGRAM = extproc)
    )
  )
 
LISTENER_O10N2 =
 (DESCRIPTION_LIST =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = o10n2-vip)(PORT = 1522)(IP = FIRST))
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.150.72)(PORT = 1522)(IP =FIRST))
    )
  )
 

查看local_listener

SQL> show parameter local

 

NAME                                 TYPE        VALUE

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

local_listener                       string      LISTENER_BAMUTA1

SQL> show parameter remote_listener

 

NAME                                 TYPE        VALUE

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

remote_listener                      string      LISTENERS_BAMUTA

 

修改tnsnames.ora裏的端口(兩個節點上都要改)

 
LISTENER_BAMUTA2 =
 (ADDRESS = (PROTOCOL = TCP)(HOST = o10n2-vip)(PORT = 1522))
 
 
LISTENER_BAMUTA1 =
 (ADDRESS = (PROTOCOL = TCP)(HOST = o10n1-vip)(PORT = 1522))
 
 
LISTENER_O10N2 =
 (DESCRIPTION_LIST =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = TCP)(HOST = o10n2-vip)(PORT = 1522)(IP = FIRST))
     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.150.72)(PORT = 1522)(IP =FIRST))
    )
  )


 

 

兩個節點上啓動新的端口:

 

o10n2->lsnrctl

LSNRCTL> setcurrent_listener LISTENER_O10N2

Current Listener is LISTENER_O10N2

--在另1個節點1個可以用set current_listener LISTENER_O10N1命令啓動。

LSNRCTL> start

o10n2->lsnrctl status LISTENER_O10N2

 

LSNRCTL for Linux: Version 10.2.0.4.0 -Production on 11-JUN-2014 13:51:54
 
Copyright (c) 1991, 2007, Oracle.  All rights reserved.
 
Connecting to(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=o10n2-vip)(PORT=1522)(IP=FIRST)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_O10N2
Version                   TNSLSNR for Linux: Version10.2.0.4.0 - Production
Start Date                11-JUN-2014 12:00:57
Uptime                    0 days 1 hr. 50 min. 57 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File        /oracle/product/10.2.0/db_1/network/log/listener_o10n2.log
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.150.82)(PORT=1522)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.150.72)(PORT=1522)))
Services Summary...
Service "PLSExtProc" has 1instance(s).
 Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) forthis service...
Service "aa" has 2 instance(s).
 Instance "bamuta1", status READY, has 1 handler(s) for thisservice...
 Instance "bamuta2", status READY, has 2 handler(s) for thisservice...
Service "bamuta" has 2instance(s).
 Instance "bamuta1", status READY, has 1 handler(s) for thisservice...
 Instance "bamuta2", status READY, has 2 handler(s) for thisservice...
Service "bamutaXDB" has 2instance(s).
 Instance "bamuta1", status READY, has 1 handler(s) for thisservice...
 Instance "bamuta2", status READY, has 1 handler(s) for thisservice...
Service "bamuta_XPT" has 2instance(s).
 Instance "bamuta1", status READY, has 1 handler(s) for thisservice...
 Instance "bamuta2", status READY, has 2 handler(s) for thisservice...
Service "ocm2" has 2 instance(s).
 Instance "bamuta1", status READY, has 1 handler(s) for thisservice...
 Instance "bamuta2", status READY, has 2 handler(s) for thisservice...
The command completed successfully
 

注意,此時1522已經啓動好了,並且可以連接了,但是1521也還是可以連接的。

 

o10n1->lsnrctl status

 

LSNRCTL for Linux: Version 10.2.0.4.0 -Production on 11-JUN-2014 13:55:33
 
Copyright (c) 1991, 2007, Oracle.  All rights reserved.
 
Connecting to(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version10.2.0.4.0 - Production
Start Date                11-JUN-2014 13:55:30
Uptime                    0 days 0 hr. 0 min. 3 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File  /oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File        /oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=o10n1)(PORT=1521)))
The listener supports no services
The command completed successfully

 

如果需要關掉原來的1521端口,可以通過lsnrctl stop關掉。但是現在不能用srvctl關掉。這樣會關掉1522的監聽,且並不會關掉1521的端口。

 

[root@o10n1 bin]# srvctlstop listener -n o10n1

[root@o10n1 bin]# srvctl stop listener -no10n2

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章