oracle12c 端口查看,Oracle12c修改端口号
Oracle12c数据库更改端口号
修改端口号的整体步骤
1.1、查看当前监听的状态
1.2、停止监听
1.3、修改监听文件的端口号
1.4、修改初始化参数local_listener
1.5、重启监听器
1.6、修改完毕,使用新端口登录测试
实践步骤:
1、查看当前监听的状态
[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 17:34:54
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 20-DEC-2016 22:26:52
Uptime 0 days 19 hr. 8 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/12.1.0/db/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/qywsxxdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "qyws_jkda" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_qyrk" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_tjzb" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_xnh" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_yzxt" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdb" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdbXDB" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdb_pdb1" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
The command completed successfully
2、停止监听
[oracle@localhost admin]$ lsnrctl stop
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 17:56:15
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully
3、修改监听文件的端口号
监听文件位置:$ORACLE_HOME/network/admin/通过系统自带vi工具将listener.ora和tnsname.ora文件中port参数的值由1521改成1522,存盘即可。或者通过netca实用程序配置更改监听端口。
4、启动监听程序
[oracle@localhost admin]$ lsnrctl start
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 17:56:20
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Starting /u01/app/oracle/12.1.0/db/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 12.1.0.2.0 - Production
System parameter file is /u01/app/oracle/12.1.0/db/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 21-DEC-2016 17:56:20
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/12.1.0/db/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)))
The listener supports no services
The command completed successfully
5、修改初始化参数local_listener参数
此处将4和5步骤调换,就是为了通过测试,说明为什么要修改local_listener参数,首先,在不修改该参数的情况,我们注册数据库到监听程序。
[oracle@localhost admin]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Wed Dec 21 17:56:25 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show parameter local_li
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string
SQL> alter system register;
System altered.
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@localhost admin]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 17:56:36
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 21-DEC-2016 17:56:20
Uptime 0 days 0 hr. 0 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/12.1.0/db/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)))
The listener supports no services
The command completed successfully
通过手动注册数据库,可以看到数据库并未注册到监听程序,此时的local_listener为默认值,默认情况下会注册默认监听程序。接下来我们修改local_listener参数的值,看看修改后的效果。
SQL> alter system set local_listener="(address = (protocol = tcp)(host = 192.168.227.11)(port = 1522))" scope=both;
System altered.
SQL>
SQL>
SQL> show parameter local_li
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (address = (protocol = tcp)(ho
st = 192.168.227.11)(port = 15
22))
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 21-DEC-2016 18:02:09
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 21-DEC-2016 17:56:20
Uptime 0 days 0 hr. 5 min. 49 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/12.1.0/db/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=localhost.localdomain)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/qywsxxdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "qyws_jkda" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_qyrk" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_tjzb" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_xnh" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qyws_yzxt" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdb" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdbXDB" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
Service "qywsxxdb_pdb1" has 1 instance(s).
Instance "qywsxxdb", status READY, has 1 handler(s) for this service...
The command completed successfully
可以看到监听程序很快就会自动注册可以识别到的数据库实例。
那么为什么在这里要修改local_listener参数的值呢,默认情况下该参数为空值,依然可以动态将数据库实例自动注册监听呢?首先,我们得知道是pmon进程在实时动态注册数据库的,一般在默认情况下,pmon只会动态注册port等于1521的监听,否则pmon不能动态注册listener,如果想让pmon动态注册listener,那么就需要设置local_listener参数。这也是为什么必须在修改端口时,必须要修改local_listener参数的原因。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31403259/viewspace-2131183/,如需转载,请注明出处,否则将追究法律责任。
oracle12c 端口查看,Oracle12c修改端口号相关推荐
- 查看mysql 默认端口号和修改端口号
1. 登录mysql mysql -u root -p //输入密码 2. 使用命令show global variables like 'port';查看端口号 mysql> show glo ...
- 登陆到虚拟机查看目前服务器开放的端口,查看虚拟机开放端口号
查看虚拟机开放端口号 内容精选 换一换 Linux命令随用随记 1.touch start.sh 创建文件 2.chmod 777 start.sh 修改文件权限 3.firewall-cmd --q ...
- mysql怎么看端口号_mysql端口号(怎么查看mysql的端口号)
mysql端口号(怎么查看mysql的端口号) 2020-05-07 21:54:58 共10个回答 如何查看mysql的端口号 1使用命令showglobalvariableslike'port'; ...
- 查看计算机远程端口,如何查看服务器远程端口号.doc
如何查看服务器远程端口号 如何查看服务器远程端口号 篇一:服务器端口怎么打开_系统端口安全配置 服务器端口怎么打开 方法/步骤 1. 1 首先在右下角电脑连接右键打开网络连接设置. 2. 2 选择一个 ...
- CentOS 7 CentOS7查看开放端口命令及开放端口号
查看已开放的端口 firewall-cmd --list-ports 查询端口号8080 是否开启 firewall-cmd --query-port=8080/tcp 开放端口(开放后需要要重启防火 ...
- centos7查看udp端口_CentOS7查看开放端口命令及开放端口号
CentOS 7查看以开放端口命令: firewall-cmd -list-ports 查看端口是否开放命令: 第一个方法就是使用lsof -i:端口号命令行,例如lsof -i:80.如果没有任何信 ...
- php redis 修改端口号,如何修改redis默认端口
redis修改默认端口的方法是:首先要先下载文件并解压编译及安装,安装好后全局启动并且设置密码,然后再修改端口号,最后指定运行配置即可 [推荐课程:redis教程] (1)通过下面的链接进行下载,然后 ...
- linux 7查看开放端口号,CentOS7查看开放端口命令及开放端口号
centos 7查看以开放端口命令: firewall-cmd -list-ports 查看端口是否开放命令: 第一个方法就是使用lsof -i:端口号命令行,例如lsof -i:80.如果没有任何信 ...
- centos 端口范围_CentOS7查看开放端口命令及开放端口号
CentOS 7查看以开放端口命令: firewall-cmd -list-ports 查看端口是否开放命令: 第一个方法就是使用lsof -i:端口号命令行,例如lsof -i:80.如果没有任何信 ...
最新文章
- 为啥我从后台查到的值在页面显示的是undefined_再谈一个管理后台列表功能应有的素质...
- Android 事件分发面试题2
- 日志级别_SpringBoot实战(十三):Admin动态修改日志级别
- Spring Data JPA 从入门到精通~javax.persistence概况介绍
- oracle进程瞬间暴增,oracle goldengate ogg 源段传输进程lag延迟不断增加的原因?
- Oracle序列生成器
- 免费python课程排行榜-用python爬取2017年中国最好大学排名
- [转载] Python中的enumerate函数介绍
- Android 来电自动接听
- 达观RPA自动订单处理机器人, 助力制造业订单处理效率提升
- Opencv摄像头相关参数
- ICO图标在线生成,php生成ICO图标在线制作源码
- 50 岁的程序员该何去何从?
- 华为领衔,“5G+摄像头”拿下双影帝,多家国产手机凭借拍照入围MWC最佳演员...
- 军团要塞2正版服务器,Team Fortress 2
- python爬虫点触验证码的识别思路(图片版)
- Generative Adversarial Registration for Improved Conditional Deformable Templates 论文
- CSDN Markdown简明教程3-表格和公式
- leetcode 1641. Count Sorted Vowel Strings(python)
- 智能手机的中文输入法统计