[20191112]oracle共享连接模式端口.txt
[20191112]oracle共享连接模式端口.txt
--//如果使用共享服务模式,你可以发现每次重启数据库对应的端口号会发生变化.
# netstat -tunlp | egrep "Active|Proto|ora_[ds]"
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::57864 :::* LISTEN 23134/ora_d000_book
udp 0 0 ::1:48080 :::* 23134/ora_d000_book
udp 0 0 ::1:58231 :::* 23132/ora_s000_book
--//重启数据库后,端口号会发生变化.
# netstat -tunlp | egrep "Active|Proto|ora_[ds]"
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::51056 :::* LISTEN 32421/ora_d000_book
udp 0 0 ::1:55948 :::* 32421/ora_d000_book
udp 0 0 ::1:17992 :::* 32423/ora_s000_book
--//如果通过外网使用共享模式连接端口变化对于配置防火墙非常不方便.看了链接:
https://www.usn-it.de/2008/11/10/oracle-how-to-stop-a-mts-dispatcher-process/
--//可以通过指定端口号实现该功能,自己测试看看:
alter system set dispatchers=
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3000))(dispatchers=1)(SERVICE=TEST)',
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3005))(dispatchers=1)(SERVICE=TEST)',
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3010))(dispatchers=1)(SERVICE=TEST)',
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3015))(dispatchers=1)(SERVICE=TEST)',
'(address=(partial=true)(protocol=tcp)(host=hostname)(port=3020))(dispatchers=1)(SERVICE=TEST)'
scope=both sid='SID13';
1.环境:
SYS@book> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> show parameter dispatchers
NAME TYPE VALUE
--------------- ------- -------------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=book,bookXDB)
max_dispatchers integer
SYS@book> create pfile='/tmp/@.ora' from spfile;
File created.
--//保存1份pfile参数文件.
2. 修改dispatchers参数:
alter system set dispatchers=
'(address=(partial=true)(protocol=tcp)(host=192.168.100.78)(port=30000))(dispatchers=1)(SERVICE=book,bookXDB)',
'(address=(partial=true)(protocol=tcp)(host=192.168.100.78)(port=30005))(dispatchers=1)(SERVICE=book,bookXDB)'
scope=both sid='*';
SYS@book> show parameter dispatchers
NAME TYPE VALUE
------------------------------------ ---------------------------------------- ----------------------------------------------------------------------------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=book,bookXDB), (address=(partial=true)(protocol=tcp)(host=192.168.100.78)(po
rt=30000))(dispatchers=1)(SERVICE=book,bookXDB), (address=(partial=true)(protocol=tcp)(host=192.168.
100.78)(port=30005))(dispatchers=1)(SERVICE=book,bookXDB)
max_dispatchers integer
3.重启数据库看看:
SYS@book> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@book> startup
ORACLE instance started.
Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
Database mounted.
Database opened.
# netstat -tunlp | egrep "Active|Proto|ora_[ds]"
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 192.168.100.78:30005 0.0.0.0:* LISTEN 32581/ora_d002_book
tcp 0 0 192.168.100.78:30000 0.0.0.0:* LISTEN 32579/ora_d001_book
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tcp 0 0 :::49854 :::* LISTEN 32577/ora_d000_book
udp 0 0 ::1:45407 :::* 32583/ora_s000_book
udp 0 0 ::1:48884 :::* 32577/ora_d000_book
udp 0 0 ::1:16168 :::* 32579/ora_d001_book
udp 0 0 ::1:16201 :::* 32581/ora_d002_book
--//你可以发现现在端口固定在30000,30005.注意下划线信息.
4.连接测试:
>sqlplus scott/book@192.168.100.78:30000/book
SQL*Plus: Release 12.2.0.1.0 Production on Tue Nov 12 11:28:23 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SCOTT@192.168.100.78:30000/book> @ spid
SID SERIAL# PROCESS SERVER SPID PID P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
309 1 10624:9940 SHARED 32583 22 1 alter system kill session '309,1' immediate;
--//SERVER=SHARED,spid=32583
# ps -ef | grep 3258[3]
oracle 32583 1 0 11:26 ? 00:00:00 ora_s000_book
--//sqlplus scott/book@192.168.100.78:30005/book 也是ok的.
5.收尾还原:
SYS@book> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@book> startup nomount pfile='/tmp/@.ora';
ORACLE instance started.
Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
SYS@book> create spfile from pfile='/tmp/@.ora';
File created.
SYS@book> shutdown immediate ;
ORA-01507: database not mounted
ORACLE instance shut down.
SYS@book> startup
ORACLE instance started.
Total System Global Area 643084288 bytes
Fixed Size 2255872 bytes
Variable Size 205521920 bytes
Database Buffers 427819008 bytes
Redo Buffers 7487488 bytes
Database mounted.
Database opened.
# netstat -tunlp | egrep "Active|Proto|ora_[ds]"
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::20791 :::* LISTEN 32896/ora_d000_book
udp 0 0 ::1:7511 :::* 32898/ora_s000_book
udp 0 0 ::1:7696 :::* 32896/ora_d000_book
--//OK,现在已经还原.端口已经不固定.
[20191112]oracle共享连接模式端口.txt的更多相关文章
- [20191113]oracle共享连接模式端口2.txt
[20191113]oracle共享连接模式端口2.txt --//昨天的测试链接:http://blog.itpub.net/267265/viewspace-2663651/=>[20191 ...
- Oracle dblink的连接模式的关系测试总结
这篇主要介绍一下database link由于连接数据库的方式不同遇到的一些问题,我们知道连接ORACLE服务器的模式一般有两种方式:专用服务器连接(dedicated server)和共享服务器连接 ...
- [20190306]共享服务模式与SDU.txt
[20190306]共享服务模式与SDU.txt --//一些文档提到共享服务模式,服务端SDU=65535,测试验证看看.--//链接:https://blogs.sap.com/2013/02/0 ...
- [20180316]共享服务模式和直接路径读.txt
[20180316]共享服务模式和直接路径读.txt --//在共享服务器模式下,执行计划不会选择直接路径读,通过例子证明. 1.环境:SYS@book> @ &r/ver1PORT_S ...
- oracle共享与专用模式的动态转换及区别(转载)
一直没对专用于共享的互换搞清楚,找到了这篇文章 http://blog.csdn.net/tianlesoftware/archive/2010/06/26/5695784.aspx ,让我实践了一把 ...
- Oracle数据库的连接模式connection Mode、连接connection与会话session
数据库的连接模式Connection Mode: Dedicated Server Mode(专有模式) 当用户发出请求时,如远程的client端通过监听器连接数据库上,ORACLE的服务器端会启用一 ...
- Oracle共享服务器的连接模式
一般Oracle数据库安装默认都是选择专用服务器模式的连接方式,但实际上Oracle也支持共享服务器的连接模式,不过这种在实际生产中见到的很少,我个人只在一些医院行业的客户生产环境中见到过这类配置. ...
- oracle远程连接配置
今日需要对站内所有的空间数据做入库处理,所以在服务器上安装了oracle,在本地需要对其进行连接,在网上查阅了相关资料,整理如下: 远程服务端配置:1. 数据库配置 因为要为外界客户端提供数据服 ...
- asp.net学习之ado.net(连接模式访问)
原文:asp.net学习之ado.net(连接模式访问) ado.net框架支持两种模式的数据访问: 连接模式(Connected)和非连接模式(disconnected).这一节介绍如何使用连 ...
随机推荐
- [转]加密算法(DES,AES,RSA,MD5,SHA1,Base64)比较和项目应用
原文链接:http://www.cnblogs.com/sochishun/p/7028056.html 加密技术通常分为两大类:"对称式"和"非对称式". 对 ...
- .NET 收徒,带你走向架构师。
最近感悟天命,偶有所得,故而打算收徒若干,以继吾之传承. 有缘者,可破瓶颈,走向架构师之峰,指日可待. 入门基本要求: 1.工作经验:1年或以上. 2.入门费用:10000元(RMB). 联系方式(联 ...
- Jmeter录制后的脚本调优
当我们通过badboy或者HTTP代理服务器的方式录制的脚本,会发现脚本杂乱无章,图片.css.html以及各种我们不关心的脚本,因此就需要针对录制后的脚本进行调优 1.去除图片.html/css等不 ...
- How to: Use the Entity Framework Data Model Located in an External Assembly 如何:使用位于外部程序集中的EF数据模型
If you have a non-XAF application, and want to develop an XAF application that utilizes the same dat ...
- ES6- Class类的使用,声明,继承
声明一个类 //class 类 class Coder{ // 类中都是方法 函数 //val是name方法的参数 name(val){ console.log(val) //类 return val ...
- 44.QT-安装MySQL、测试连接MySQL
在上章学习了42.QT-操作SQLite数据库后,发现MySQL和SQLite的语句都大致相同,所以本章只测试MySQL是否能使用 MySQL安装参考链接:https://blog.csdn.net/ ...
- java使用htmlunit工具抓取js中加载的数据
htmlunit 是一款开源的java 页面分析工具,读取页面后,可以有效的使用htmlunit分析页面上的内容.项目可以模拟浏览器运行,被誉为java浏览器的开源实现.这个没有界面的浏览器,运行速度 ...
- EXCEPTION_ACCESS_VIOLATION(0xc0000005)
EXCEPTION_ACCESS_VIOLATION(0xc0000005)eclipse.ini中添加:-XX:CompileCommand=exclude,org.eclipse.jdt.inte ...
- 程序员:May the Force be with you!
程序员如何理解:May the Force be with you! 我们并没有向其他人那样讨论现象级产品的生成原因,因为我们并不清楚这个原因是什么. 我们也不知道足记是否会重复过去一些现象级产品忽生 ...
- python科学计算和数据分析常用库
NumPy NumPy最强大的是n维数组,该库还包含基本的线性代数函数.傅立叶变换.随机函数和其他底层语言(如Fortran.C和C++)集成的工具. SciPy SciPy建立在NumPy基础上,它 ...