首页 技术 正文
技术 2022年11月23日
0 收藏 671 点赞 3,124 浏览 5060 个字

修改oracle监听端口

修改端口号的整体步骤:
1.1   查看当前监听的状态
1.2   停止监听
1.3   修改监听文件的端口号
1.4   修改初始化参数local_listener
1.5   重启监听器
1.6   修改完毕,使用新端口登录测试

实践步骤:

1.1 查看当前监听的状态

[test@ASI-1 ~]$lsnrctl status

1.2 停止监听

[test@ASI-1~]$lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 11-MAR-2011 16:36:49

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.100)(PORT=1521)))

The command completed successfully

1.3修改监听文件的端口号

把端口号修改为1530,分别修改listener.ora和tnsname.ora文件

[test@ASI-1 ~]$ cd/usr/opt/oracle/product/10.2.0/db_1/network/admin/

[test@ASI-1 admin]$ pwd

/usr/opt/oracle/product/10.2.0/db_1/network/admin

[test@ASI-1~]$vi  listener.ora

# listener.ora Network Configuration File: /usr/opt/oracle/product/10.2.0/db_1/network/admin/listener.ora

# Generated by Oracle configuration tools.

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = /usr/opt/oracle/product/10.2.0/db_1)

(PROGRAM = extproc)

)

(SID_DESC =

(GLOBAL_DBNAME = orcl)

(ORACLE_HOME = /usr/opt/oracle/product/10.2.0/db_1)

(SID_NAME = orcl)

)

)

LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1530))

)

[test@ASI-1~]$vi tnsnames.ora

# Generated by Oracle configuration tools.

ORCL =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1530))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)

EXTPROC_CONNECTION_DATA =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

(CONNECT_DATA =

(SID = PLSExtProc)

(PRESENTATION = RO)

)

)

1.4 修改初始化参数local_listener

[test@ASI-1~]$sqlplus / as sysdba

SQL*Plus:Release 10.2.0.1.0 – Production on 星期六 7月 19 13:24:02 2008

Copyright (c)1982, 2005, Oracle.  All rights reserved.

连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
With the Partitioning, OLAP and Data Mining options

SQL> showparameter local_listener

NAME                                TYPE        VALUE
———————————— ———– ——————————
local_listener                      string      (address=(protocol=tcp)(host=s
kate)(port=1522))
SQL> alter system setlocal_listener=”(address=(protocol=tcp)(host=192.168.0.100)(port=1530))”;

系统已更改。

1.5 重启监听器

[test@ASI-1~]$lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 11-MAR-2011 17:56:42

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

Starting /usr/opt/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait…

TNSLSNR for Linux: Version 10.2.0.1.0 – Production

System parameter file is /usr/opt/oracle/product/10.2.0/db_1/network/admin/liste

ner.ora

Log messages written to /usr/opt/oracle/product/10.2.0/db_1/network/log/listener

.log

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.100)(PORT=1530

)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.100)(PORT=1530

)))

STATUS of the LISTENER

————————

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 10.2.0.1.0 – Production

Start Date                11-MAR-2011 17:56:42

Uptime                    0 days 0 hr. 0 min. 0 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /usr/opt/oracle/product/10.2.0/db_1/network/admin/list

ener.ora

Listener Log File         /usr/opt/oracle/product/10.2.0/db_1/network/log/listen

er.log

Listening Endpoints Summary…

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.100)(PORT=1530)))

Services Summary…

Service “PLSExtProc” has 1 instance(s).

Instance “PLSExtProc”, status UNKNOWN, has 1 handler(s) for this service…

Service “orcl” has 1 instance(s).

Instance “orcl”, status UNKNOWN, has 1 handler(s) for this service…

The command completed successfully

1.6使用新端口登录测试

1.6.1 检查监听端口是否改变

[test@ASI-1~]$netstat -na | grep “1530”

tcp       0     0 192.168.0.100:1530          0.0.0.0:*       LISTEN

1.6.2  查看监听器的状态

[test@ASI-1~]$lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 11-MAR-2011 18:21:04

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.100)(PORT=1530)))

STATUS of the LISTENER

————————

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 10.2.0.1.0 – Production

Start Date                11-MAR-2011 17:56:42

Uptime                    0 days 0 hr. 24 min. 21 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /usr/opt/oracle/product/10.2.0/db_1/network/admin/listener.ora

Listener Log File         /usr/opt/oracle/product/10.2.0/db_1/network/log/listener.log

Listening Endpoints Summary…

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.100)(PORT=1530)))

Services Summary…

Service “PLSExtProc” has 1 instance(s).

Instance “PLSExtProc”, status UNKNOWN, has 1 handler(s) for this service…

Service “orcl” has 1 instance(s).

Instance “orcl”, status UNKNOWN, has 1 handler(s) for this service…

The command completed successfully

1.6.3 [test@ASI-1 ~]$tnsping orcl

TNS Ping Utility for Linux: Version 10.2.0.1.0 – Production on 11-MAR-2011 18:34:36

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:

/usr/opt/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.100)(PORT = 1530))) (CONNECT_DATA = (SERVICE_NAME = orcl)))

OK (0 msec)

微信扫一扫

支付宝扫一扫

本文网址:https://www.zhankr.net/141295.html

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:875 阅读:5,067
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:806 阅读:3,504
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:565 阅读:4,312
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:730 阅读:4,307
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:4,904
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:3,097
发表评论
暂无评论

还没有评论呢,快来抢沙发~

助力内容变现

将您的收入提升到一个新的水平

点击联系客服

在线时间:8:00-16:00

客服电话

400-888-8888

客服邮箱

ceotheme@ceo.com

扫描二维码

关注微信公众号

扫描二维码

手机访问本站