我的编程空间,编程开发者的网络收藏夹
学习永远不晚

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

短信预约 信息系统项目管理师 报名、考试、查分时间动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

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

[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: oolssqltemp>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: oolssqltemp>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: oolssqltemp>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参数,内容在原来基础上追加

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

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

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

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

[20191113]oracle共享连接模式端口2.txt--//昨天的测试链接:http://blog.itpub.net/267265/viewspace-2663651/=>[20191112]oracle共享连接模式端口.txt --//链接里面还提到
[20191113]oracle共享连接模式端口2.txt
2015-12-08

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

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

编程热搜

目录