修改OracleRAC监听端口号:

修改前一定要查看修改后的端口有没有被占用:

# netstat -an|grep <new-listener-port>

1、查看当前数据库监听状态:

(grid用户执行)

$ lsnrctl status

$ srvctl config listener

示例:

[+ASM1][grid@ceshi1 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 05-APR-2022 06:34:12

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

Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 05-APR-2022 06:18:47
Uptime 0 days 0 hr. 15 min. 25 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0.4/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/ceshi1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.48.130)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.48.132)(PORT=1522)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl1", status BLOCKED, has 1 handler(s) for this service...
Service "test" has 1 instance(s).
Instance "orcl1", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully [+ASM1][grid@ceshi1 ~]$ srvctl config listener
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
End points: TCP:1522

2、修改集群监听端口:

  1. 修改监听端口:(grid用户单节点执行)

    $ srvctl modify listener -l LISTENER -p "TCP:<new-listener-port>"
  2. 修改scan端口:(grid用户单节点执行)

    $ srvctl modify scan_listener -p <new-scan-port>

示例:

[+ASM1][grid@ceshi1 ~]$ srvctl modify listener -l LISTENER -p "TCP:1533"

[+ASM1][grid@ceshi1 ~]$ srvctl modify scan_listener -p 1533

3、手动修改LOCAL_LISTENER:

(oracle用户所有节点执行)

SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=<Host-name>)(PORT=<new-port-number>))))' scope=both sid='[<your-chosen-instance> | * ] '

注意:按照实例所在节点修改"IP""实例名"

示例:

节点一:

#修改LOCAL_LISTENER
[orcl1][oracle@ceshi1 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Tue Apr 5 07:26:34 2022 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= 192.168.48.130)(PORT=1533))" SID='orcl1'; System altered. #查看LOCAL_LISTENER
SQL> show parameter LOCAL_LISTENER NAME TYPE VALUE
------------------------ ------- ------------------------------
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.48.130)(PORT=1533))

节点二:

#修改LOCAL_LISTENER
[orcl2][oracle@ceshi2 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Wed Apr 6 02:50:46 2022 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= 192.168.48.131)(PORT=1533))" SID='orcl2'; System altered. #查看LOCAL_LISTENER
SQL> show parameter LOCAL_LISTENER NAME TYPE VALUE
------------------------ ------- ------------------------------
local_listener string (ADDRESS=(PROTOCOL=TCP)(HOST=192.168.48.131)(PORT=1533))

若移除监听(REMOTE_LISTENER)也需要进行类似更改

4、停止集群监听和SCAN:

停止监听和scan:(grid用户单节点执行)

$ srvctl stop listener [-l <lsnr_name>] [-n <node_name>] [-f]
$ srvctl stop scan [-i <ordinal_number>] [-f]
$ srvctl stop scan_listener [-i <ordinal_number>] [-f]

示例:

$ srvctl stop listener -l LISTENER
$ srvctl stop scan_listener

5、修改listener.ora文件:

修改listener.ora文件中的端口信息:(grid用户所有节点执行)

$ vi $GRID_HOME/network/admin/listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))            # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent LISTENER =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.48.130)(PORT = 1522))
)

将默认侦听器配置文件下的(端口=1521)更改为所需的值。如果您没有此文件,则可以使用以下示例:

LISTENER =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
(ADDRESS = (PROTOCOL = TCP)(HOST = myhostname)(PORT = myport))
)

若配置了$GRID_HOME/network/admin/tnsnames.ora文件也需要进行端口调整

6、启动集群监听和SCAN:

启动监听和scan:(grid用户所有节点执行)

$ srvctl start listener [-l <lsnr_name>] [-n <node_name>]
$ srvctl start scan [-i <ordinal_number>] [-n <node_name>]
$ srvctl start scan_listener [-n <node_name>] [-i <ordinal_number>]

示例:

#启动集群监听和SCAN
$ srvctl start listener -l LISTENER
$ srvctl start scan_listener

7、验证数据库监听端口状态:

(grid用户执行)

$ lsnrctl status

$ srvctl config listener

示例:

节点一:

[+ASM1][grid@ceshi1 /u01/app/11.2.0.4/grid/network/admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 06-APR-2022 06:24:25

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

Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 06-APR-2022 06:24:16
Uptime 0 days 0 hr. 0 min. 8 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0.4/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/ceshi1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.48.130)(PORT=1533)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.48.132)(PORT=1533)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
Service "test" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
The command completed successfully [+ASM1][grid@ceshi1 /u01/app/11.2.0.4/grid/network/admin]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
/u01/app/11.2.0.4/grid on node(s) ceshi2,ceshi1
End points: TCP:1533

节点二:

[+ASM2][grid@ceshi2 /u01/app/11.2.0.4/grid/network/admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 07-APR-2022 02:01:14

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

Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 07-APR-2022 01:48:13
Uptime 0 days 0 hr. 13 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0.4/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/ceshi2/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.48.131)(PORT=1533)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.48.133)(PORT=1533)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl2", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl2", status READY, has 1 handler(s) for this service...
Service "test" has 1 instance(s).
Instance "orcl2", status READY, has 1 handler(s) for this service...
The command completed successfully [+ASM2][grid@ceshi2 /u01/app/11.2.0.4/grid/network/admin]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
/u01/app/11.2.0.4/grid on node(s) ceshi2,ceshi1
End points: TCP:1533

For RAC and/or SCAN please see:Changing Listener Ports On RAC/EXADATA (Doc ID 1473035.1)

Oracle RAC修改监听端口号的更多相关文章

  1. Oracle修改监听端口号1521[转]

    在oracle中,默认的监听端口号为1521,一旦有人扫描出这个端口号就会知道此服务器为oracle数据库服务器,存在极其大的安全隐患,在这里,教大家如何修改oracle默认端口号为9999: 1.查 ...

  2. oracle 11g rac修改监听端口(远程监听和本地监听)

    转至:https://www.cnblogs.com/yj411511/p/12459533.html 目录 1.修改远程监听端口 1.1 查看远程监听状态 1.2 修改SCAN listener端口 ...

  3. Oracle 11gR2 RAC修改监听默认端口

    一.修改SCAN listener port 1.1 修改SCAN listener port 1.2 重启SCAN listener生效新端口 1.3 确认更改 二.修改Listener Ports ...

  4. Linux 系统 Oracle 11g 修改监听端口

    1.查看监听:lsnrctl status 2.停止监听:lsnrctl stop 3.修改oracle安装目录的下的配置文件listener.ora:一般路径为自己Oracle安装目录+/app/o ...

  5. Oracle修改监听端口教程

    Oracle默认监听端口1521,一众扫描器通常通过探测1521端口是否开启来探测是否存在Oracle服务,如果修改默认监听端口在一定程度上可以提升数据库和主机的安全性. 比如这里我们修改成2521为 ...

  6. Oracle修改监听IP地址

    oracle 11g断网安装时,没有检测net的功能,所以安装完后,netstat -an 发现自动监听的是127.0.0.1:1521,这样安装完成后,其他的主机根本无法连接,是什么原因呢? 排错后 ...

  7. AIX下RAC搭建 Oracle10G(五)安装oracle、建立监听

    AIX下RAC搭建系列 AIX下RAC搭建 Oracle10G(五)安装oracle.建立监听 环境 节点 节点1 节点2 小机型号 IBM P-series 630 IBM P-series 630 ...

  8. 如何让oracle DB、监听和oem开机启动(dbstart)

    如何让oracle DB.监听和oem开机启动(dbstart) 让oracle DB.监听和oem开机启动(dbstart) Oracle提供了伴随操作系统自动重启的功能,在Windows中,可以修 ...

  9. 【转载】PhpStudy修改Apache的端口号

    phpStudy是一个PHP调试环境的程序集成包.该程序包集成最新的Apache+PHP+MySQL+phpMyAdmin+ZendOptimizer,一次性安装,无须配置即可使用,是非常方便.好用的 ...

随机推荐

  1. 学习FastDfs(一)

    一.简介 FastDFS是一个开源的轻量级分布式文件系统,由跟踪服务器(tracker server).存储服务器(storage server)和客户端(client)三个部分组成 fastfds有 ...

  2. CAN总线系列讲座第六讲——SJA1000的滤波器设置

    CAN总线的滤波器设置就像给总线上的节点设置了一层过滤网,只有符合要求的CAN信息帧才可以通过,其余的一概滤除. 在验收滤波器的帮助下,只有当接收信息中的识别位和验收滤波器预定义的值相等时,CAN 控 ...

  3. python学习笔记(九)——线程与进程

    一.线程 Python 中为我们提供了两个模块来创建线程. _thread threading thread 模块已被废弃.用户可以使用 threading 模块代替.所以,在 Python 中不能再 ...

  4. Architecture Principles

    Architecture Principles - Completed Components Name Statement Rationale Implications TOGAF Principle ...

  5. web移动开发中如何实现图标点击态的蒙层效果

    webapp开发中经常需要加入点击二态,即用户点击(tap)页面某个部分时该部分的样式进行相应的变化来相应用户的点击操作,这样能够带来更好的用户体验,今天我们要讨论的是如何给图标加上点击的二态效果. ...

  6. jq easyui数据网络的分页过程

    第一次写技术方面的文章,有点忐忑,总怕自己讲的不对误导别人.但是万事总有个开头,有不足错误之处,请各位读者老爷指出. 言归正传,最近刚进新公司,上头要求我先熟悉熟悉easyui这个组件库.在涉及到da ...

  7. js 简易模块加载器 示例分析

    前端模块化 关注前端技术发展的各位亲们,肯定对模块化开发这个名词不陌生.随着前端工程越来越复杂,代码越来越多,模块化成了必不可免的趋势. 各种标准 由于javascript本身并没有制定相关标准(当然 ...

  8. 使用Dropbox搭建静态网站详细教程

    DropBox是一款非常好用的免费网络文件同步工具,是Dropbox公司运行的在线存储服务,通过云计算实现因特网上的文件同步,用户可以存储并共享文件和文件夹.今天小z和大家分享一下如何使用dropbo ...

  9. Tomcat安装(安装版)

    安装Tomcat(安装版) 下载地址https://tomcat.apache.org/ 下载成功,双击进行安装(一路Next). 等待安装结束. 然后打开浏览器输入地址:http://localho ...

  10. mysql8.0.13本地安装忘记密码解决办法

    之前一直用图形化界面,加上考研期间也没动,竟然把我的数据库密码给忘了,无地自容....... 找了找教程,问题如下: MySQL从低版本向高版本迭代变化的过程,越来越严谨的安全性是其一大特点之一,在版 ...