■■oracle11g修改默认监听端口
正常情况下,oracle数据库服务端口一般是默认的1521端口,因为安全等原因可能需要修改此端口号为其他端口,以下为标准的步骤概要。
■在sqlplus修改数据库参数local_listener
备份原配置参数:create pfile='/home/oracle/listener.ora.orig20190530' from memory;
alter system set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1527))' scope=both;
■停监听
lsnrctl stop
■改监听配置文件listener.ora,把1521改为1527,其他地方不动
标准的配置格式 LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = cos6512c)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = /u01/app/oracle
■启动监听
lsnrctl start
■检查监听状态、数据库状态
■■增加监听端口
■listener.ora配置文件增加端口配置
LISTENER1527 = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = cos6512c)(PORT = 1527)) ) )
■启动新端口
lsnrctl> start listener1527
■数据库修改配置配置参数
alter system set local_listener='(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1527))))' scope=both;
文章评论
■11g监听启动报错
[oracle@cos6512c:/home/oracle]lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 30-MAY-2019 09:40:09
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0.4/bin/tnslsnr: please wait...
TNS-12537: TNS:connection closed
TNS-12560: TNS:protocol adapter error
TNS-00507: Connection closed
Linux Error: 29: Illegal seek
需要修改/etc/hosts文件如下
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
确保127.0.0.1这行存在。
而12c是不存在这个问题的,即使没这一行,也可以正常启动监听。