10g RAC 修改监听端口

时间:2022-12-04 07:45:29

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