[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的更多相关文章

  1. [20191113]oracle共享连接模式端口2.txt

    [20191113]oracle共享连接模式端口2.txt --//昨天的测试链接:http://blog.itpub.net/267265/viewspace-2663651/=>[20191 ...

  2. Oracle dblink的连接模式的关系测试总结

    这篇主要介绍一下database link由于连接数据库的方式不同遇到的一些问题,我们知道连接ORACLE服务器的模式一般有两种方式:专用服务器连接(dedicated server)和共享服务器连接 ...

  3. [20190306]共享服务模式与SDU.txt

    [20190306]共享服务模式与SDU.txt --//一些文档提到共享服务模式,服务端SDU=65535,测试验证看看.--//链接:https://blogs.sap.com/2013/02/0 ...

  4. [20180316]共享服务模式和直接路径读.txt

    [20180316]共享服务模式和直接路径读.txt --//在共享服务器模式下,执行计划不会选择直接路径读,通过例子证明. 1.环境:SYS@book> @ &r/ver1PORT_S ...

  5. oracle共享与专用模式的动态转换及区别(转载)

    一直没对专用于共享的互换搞清楚,找到了这篇文章 http://blog.csdn.net/tianlesoftware/archive/2010/06/26/5695784.aspx ,让我实践了一把 ...

  6. Oracle数据库的连接模式connection Mode、连接connection与会话session

    数据库的连接模式Connection Mode: Dedicated Server Mode(专有模式) 当用户发出请求时,如远程的client端通过监听器连接数据库上,ORACLE的服务器端会启用一 ...

  7. Oracle共享服务器的连接模式

    一般Oracle数据库安装默认都是选择专用服务器模式的连接方式,但实际上Oracle也支持共享服务器的连接模式,不过这种在实际生产中见到的很少,我个人只在一些医院行业的客户生产环境中见到过这类配置. ...

  8. oracle远程连接配置

    今日需要对站内所有的空间数据做入库处理,所以在服务器上安装了oracle,在本地需要对其进行连接,在网上查阅了相关资料,整理如下: 远程服务端配置:1. 数据库配置    因为要为外界客户端提供数据服 ...

  9. asp.net学习之ado.net(连接模式访问)

    原文:asp.net学习之ado.net(连接模式访问)    ado.net框架支持两种模式的数据访问: 连接模式(Connected)和非连接模式(disconnected).这一节介绍如何使用连 ...

随机推荐

  1. 剑指offer-47:不用加减乘除做加法

    参考:https://www.cnblogs.com/zhangziqiu/archive/2011/03/30/ComputerCode.html <原码,反码,补码 详解> 题目描述 ...

  2. C语言笔记 03_常量&存储类

    常量 常量是固定值,在程序执行期间不会改变.这些固定的值,又叫做字面量. 常量可以是任何的基本数据类型,比如整数常量.浮点常量.字符常量,或字符串字面值,也有枚举常量. 整数常量 整数常量可以是十进制 ...

  3. Maven pom.xml文件深度学习

    本文介绍Maven项目构建中,pom.xml文件的生成规则和常用节点的使用方法.pom.xml官方网址:http://maven.apache.org/pom.html pom简介 pom作为项目对象 ...

  4. react + typescript 学习

    react,前端三大框架之一,也是非常受开发者追捧的一门技术.而 typescript 是 javascript 的超集,主要特点是对 类型 的检查.二者的结合必然是趋势,不,已经是趋势了.react ...

  5. 【原创】flash中DataGrid数据列显示顺序的解决办法(非数据排序)

    今天在用flash做一个简单的地图展示功能,需要把xml绑定到DataGrid,完成后,又仔细看了几遍,发现列的顺序不对,准确的说是不稳定,不固定,于是在网上查了一下,没有相关的内容.于是自己研究了一 ...

  6. 深度好文:PHP写时拷贝与垃圾回收机制(转)

    原文地址:http://www.php100.com/9/20/87255.html 写入拷贝(Copy-on-write,简称COW)是一种计算机程序设计领域的优化策略.其核心思想是,如果有多个调用 ...

  7. Add the Scheduler Module 添加计划程序模块

    Important 重要 Scheduler requires the Event business class to be in your XAF application model. Follow ...

  8. 怎么将CAD转JPG?教你两种CAD转JPG方法

    在CAD中,对于CAD图纸格式的转换那是比较常见的了,因为CAD图纸的格式是dwg格式的,在使用的时候不是那么的方便,就需要将CAD图纸转换为偏于查看的格式.那怎么将CAD转JPG呢?具体要怎么来进行 ...

  9. sql server使用sp_executesql返回拼接字符串里面的输出参数

    问题: 今天一同事请教博主,他拼接了一个语句,select表格形式数据,然后使用@@rowcount获取到行数. 但他又有这样特别的需求:想只获取行数而不返回表格数据结果,因为是while循环,不想返 ...

  10. Java的反射机理

    Java反射是一种间接操作目标对象的机制,核心是JVM在运行的时候才动态加载类,并且对于任意一个类,都能够知道这个类的全部属性和方法等,调用方法以及访问属性,而且不需要提前在编译期知道运行的对象是什么 ...