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

--//昨天的测试链接:http://blog.itpub.net/267265/viewspace-2663651/=>[20191112]oracle共享连接模式端口.txt
--//链接里面还提到http://www.usn-it.de/index.php/2008/11/10/oracle-how-to-stop-a-mts-dispatcher-process/
--//可以执行如下,kill D000进程,自己也测试看看。
--//alter system shutdown immediate 'D000';

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参数文件.

# 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 :::38229                    :::*                        LISTEN      36466/ora_d000_book
udp        0      0 ::1:57385                   :::*                                    36466/ora_d000_book
udp        0      0 ::1:11314                   :::*                                    36468/ora_s000_book

2.kill d000:

SYS@book> alter system shutdown immediate 'D000';
System altered.
--//alert.log出现:
Wed Nov 13 08:34:13 2019
idle dispatcher 'D000' terminated, pid = (19, 1)

# 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
udp        0      0 ::1:11314                   :::*                                    36468/ora_s000_book

# ps -ef | grep ora_[sd]000
oracle   36468     1  0 08:33 ?        00:00:00 ora_s000_book
--//ora_d000_book进程消失.等了N久也没有出现.

>sqlplus scott/book@192.168.100.78:1521/book
SCOTT@192.168.100.78:1521/book> @ spid
       SID    SERIAL# PROCESS                  SERVER    SPID                     PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- -------------------------------------------------
       267          3 7652:8308                DEDICATED 36540                     19          3 alter system kill session '267,3' immediate;
--//可以发现这个时候登录选择的是DEDICATED模式.注意我这里配置book支持2种服务模式.

d:\tools\sqltemp>sqlplus -s -l scott/book@192.168.100.78:1521/book:SHARED
ERROR:
ORA-12520: TNS:listener could not find available handler for requested type of
server
SP2-0751: Unable to connect to Oracle.  Exiting SQL*Plus

SYS@book> alter system shutdown immediate 'S000';
alter system shutdown immediate 'S000'
*
ERROR at line 1:
ORA-00127: dispatcher S000 does not exist

--//我以前的做法是kill ora_s000_book进程.

SYS@book> alter system set dispatchers='(PROTOCOL=TCP) (SERVICE=book,bookXDB)' scope=memory;
System altered.

#  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 :::53018                    :::*                        LISTEN      36624/ora_d000_book
udp        0      0 ::1:51280                   :::*                                    36624/ora_d000_book
udp        0      0 ::1:11314                   :::*                                    36468/ora_s000_book
--//对比前面的测试监听端口发生了变化.

# ps -ef | grep ora_[sd]000
oracle   36468     1  0 08:33 ?        00:00:00 ora_s000_book
oracle   36624     1  0 08:44 ?        00:00:00 ora_d000_book

d:\tools\sqltemp>sqlplus -s -l scott/book@192.168.100.78:1521/book
@ spid
       SID    SERIAL# PROCESS                  SERVER    SPID                     PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
       281          7 7772:4532                SHARED    36468                     20          1 alter system kill session '281,7' immediate;
--//可以发现这个时候登录选择的是SHARED模式.
--//换一句话讲这个修改dispatchers生效不需要重启服务.

3. 修改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=memory sid='*';

--//注:scope=memory.
--//修改前:
#  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 :::53018                    :::*                        LISTEN      36624/ora_d000_book
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
udp        0      0 ::1:51280                   :::*                                    36624/ora_d000_book
udp        0      0 ::1:11314                   :::*                                    36468/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 192.168.100.78:30005        0.0.0.0:*                   LISTEN      36678/ora_d002_book
tcp        0      0 192.168.100.78:30000        0.0.0.0:*                   LISTEN      36676/ora_d001_book
tcp        0      0 :::53018                    :::*                        LISTEN      36624/ora_d000_book
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
udp        0      0 ::1:40457                   :::*                                    36678/ora_d002_book
udp        0      0 ::1:51280                   :::*                                    36624/ora_d000_book
udp        0      0 ::1:64603                   :::*                                    36676/ora_d001_book
udp        0      0 ::1:11314                   :::*                                    36468/ora_s000_book
--//注意下划线的端口没有变化.

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
--//有时候真心觉得oracle真变态,它是在原来基础上追加了参数dispatchers的内容.

SYS@book> show spparameter dispatchers
SID      NAME            TYPE     VALUE
-------- --------------- -------- --------------------------------------
*        dispatchers     string   (PROTOCOL=TCP) (SERVICE=book,bookXDB)
*        max_dispatchers integer

--//继续测试:
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='*';
--//注:scope=both

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

SYS@book> show spparameter dispatchers
SID      NAME             TYPE     VALUE
-------- ---------------- -------- ----------------------------------------------------------------------------------------------------
*        dispatchers      string   (PROTOCOL=TCP) (SERVICE=book,bookXDB)
*        dispatchers      string   (address=(partial=true)(protocol=tcp)(host=192.168.100.78)(port=30000))(dispatchers=1)(SERVICE=book,bookXDB)
*        dispatchers      string   (address=(partial=true)(protocol=tcp)(host=192.168.100.78)(port=30005))(dispatchers=1)(SERVICE=book,bookXDB)
*        max_dispatchers  integer

--//可以发现这样修改实际上是追加内容.oracle有时候难以理解.

4.连接测试:
d:\tools\sqltemp>sqlplus -s -l scott/book@192.168.100.78:30000/book @spid
       SID    SERIAL# PROCESS                  SERVER    SPID                     PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
       281         11 9076:7200                SHARED    36468                     20          1 alter system kill session '281,11' immediate;
--//SERVER=SHARED,spid=36468

# ps -ef | grep 3646[8]
oracle   36468     1  0 08:33 ?        00:00:00 ora_s000_book
--//sqlplus scott/book@192.168.100.78:30005/book 也是ok的.

5.收尾还原:
--//略.
--//参考链接:http://blog.itpub.net/267265/viewspace-2663651/=>[20191112]oracle共享连接模式端口.txt

6.总结:
--//不需要重启参数dispatchers就能生效.
--//修改dispatchers参数,内容在原来基础上追加

[20191113]oracle共享连接模式端口2.txt的更多相关文章

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

    [20191112]oracle共享连接模式端口.txt --//如果使用共享服务模式,你可以发现每次重启数据库对应的端口号会发生变化.# netstat -tunlp | egrep "A ...

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

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

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

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

  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. [20191218]降序索引疑问4.txt

    [20191218]降序索引疑问4.txt --//前几天优化一个项目,我发现许多表里面有有隐含字段,一般开发很少建立函数索引.我自己检查发现里面存在大量的降序索引.--//我感觉有点奇怪,为什么开发 ...

  2. Linux 桥接网络不自动分配IP的问题

    之前遇到过好多次,知道什么原因就是忘了命令怎么敲,还要去搜索,写一遍加强下记忆,并总结下. 情况一 :网卡冲突问题 1 , 网卡问题 有安装过oracle VM VirtualBox 的,会和VMwa ...

  3. [CodeForces - 1225C]p-binary 【数论】【二进制】

    [CodeForces - 1225C]p-binary [数论][二进制] 标签: 题解 codeforces题解 数论 题目描述 Time limit 2000 ms Memory limit 5 ...

  4. 原创 Hive count 多个度量指标,带有 distinct

    Hive  count 多个度量指标,带有  distinct ,注意点!!! 比如  select  organid, ppi, count(id1) as num1, count(distinct ...

  5. vivo web service:亿万级规模web服务引擎架构

    本文首发于 vivo互联网技术 微信公众号 链接:https://mp.weixin.qq.com/s/ovOS0l9U5svlUMfZoYFU9Q vivo web service是开发团队围绕奇点 ...

  6. C#构造方法(构造函数)

    构造方法特点: 一 ,与类同名 public class Product { public int ID { get; set; } public String NAME { get; set; } ...

  7. Python中:dict(或对象)与json之间的互相转化

    在Python语言中,json数据与dict字典以及对象之间的转化,是必不可少的操作. 在Python中自带json库.通过import json导入. 在json模块有2个方法, loads():将 ...

  8. Git实战指南----跟着haibiscuit学Git(第六篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  9. Refresh design pattern

    多年后, 再次翻阅设计模式书籍, 将每种模式的要点总结于此, 需要本身有一定设计模式基础, 再结合要点, 帮助更好理解与运用. 策略模式 (Strategy) 附加功能单独抽象不同接口 功能以组合方式 ...

  10. 一些实用的Django+HTML设置

    一.关于引入变量 1.变量引入方法: {% block 块名称 %} <p>{{变量名}}<p> {% endblock %} 2.引入变量的值中标签是否转义: 不转义: {% ...