« 《海量数据库解决方案》一书已经出版 | Blog首页 | 《青衣张火丁》、《中国童话》-最近购入的图书 »
Oracle MTS模式下 进程地址与会话信息
作者:eygle | 【转载请注出处】|【云和恩墨 领先的zData数据库一体机 | zCloud PaaS云管平台 | SQM SQL审核平台 | ZDBM 数据库备份一体机】
链接:https://www.eygle.com/archives/2010/11/oracle_mts_paddr.html
前几天在客户现场,检查一个数据库时发现在OS上根本没有明确的数据库连接,但是在数据库内部却可以看到会话信息。链接:https://www.eygle.com/archives/2010/11/oracle_mts_paddr.html
想了一会,才明白过来,原来这是一个MTS系统,共享服务器模式已经很久没有遇到了,几乎忘却了。
在检查会话信息时,你会发现,用户进程的进程地址PADDR是相同的,都是812960DC :
SQL> select paddr,sid,username,osuser,process,terminal,machine,logon_time from v$session;
PADDR SID USERNAME OSUSER PROCESS TERMINAL MACHINE LOGON_TIME
-------- --- ---------- ---------- ------------ --------------- ----------------- -------------------
8129301C 1 oracle 6568 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:07
812933DC 2 oracle 6570 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:08
8129379C 3 oracle 6573 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:08
81293B5C 4 oracle 6576 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:11
81293F1C 5 oracle 6578 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:11
812942DC 7 oracle 6580 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:11
8129469C 9 oracle 6582 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:11
81294A5C 10 oracle 6584 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:11
81294E1C 11 oracle 6586 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:11
812951DC 12 oracle 6588 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:11
8129559C 13 oracle 6590 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:11
8129595C 14 oracle 6592 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:11
812960DC 15 EYGLE eyg 3572:220 EYGLEE EYGLEENMO\EYGLEE 2010-10-28 09:04:14
812960DC 16 EYGLE eyg 1804:3708 EYGLEE EYGLEENMO\EYGLEE 2010-10-28 09:04:19
8129685C 17 oracle 6611 UNKNOWN EYGLEORACLE1 2010-09-27 11:39:13
81295D1C 20 EYGLE root unknown EYGLEWEB1 2010-10-28 07:45:30
812960DC 24 EYGLE root unknown EYGLEWEB1 2010-10-28 09:11:13
812960DC 30 EYGLE eyg 3296:2968 EYGLEE EYGLEENMO\EYGLEE 2010-10-28 09:04:22
812960DC 31 EYGLE root unknown EYGLEWEB1 2010-10-28 08:21:09
812960DC 32 EYGLE root unknown EYGLEWEB1 2010-10-28 09:13:45
812960DC 33 EYGLE oracle 721122 oracle2 2010-10-13 13:34:13
8129649C 35 SYS oracle 23221 pts/1 EYGLEORACLE1 2010-10-28 09:24:21
而 812960DC 进程正是Dispatcher进程 oracle@EYGLEORACLE1 (D000)
SQL> select addr,spid,program from v$process;而通过监听器也可以看到,数据库所有的连接都来自Dispatcher,没有Dedicated模式的连接建立:
ADDR SPID PROGRAM
-------- ------------ ------------------------------------------------
81292C5C PSEUDO
8129301C 6568 oracle@EYGLEORACLE1 (PMON)
812933DC 6570 oracle@EYGLEORACLE1 (DIAG)
8129379C 6573 oracle@EYGLEORACLE1 (LMON)
81293B5C 6576 oracle@EYGLEORACLE1 (LMD0)
81293F1C 6578 oracle@EYGLEORACLE1 (LMS0)
812942DC 6580 oracle@EYGLEORACLE1 (LMS1)
8129469C 6582 oracle@EYGLEORACLE1 (DBW0)
81294A5C 6584 oracle@EYGLEORACLE1 (LGWR)
81294E1C 6586 oracle@EYGLEORACLE1 (CKPT)
812951DC 6588 oracle@EYGLEORACLE1 (SMON)
ADDR SPID PROGRAM
-------- ------------ ------------------------------------------------
8129559C 6590 oracle@EYGLEORACLE1 (RECO)
8129595C 6592 oracle@EYGLEORACLE1 (CJQ0)
81295D1C 6594 oracle@EYGLEORACLE1 (S000)
812960DC 6596 oracle@EYGLEORACLE1 (D000)
8129649C 23222 oracle@EYGLEORACLE1 (TNS V1-V3)
8129685C 6611 oracle@EYGLEORACLE1 (LCK0)
81296FDC 9955 oracle@EYGLEORACLE1 (S003)
[oracle@EYGLEORACLE1 log]$ lsnrctl service
LSNRCTL for Linux: Version 9.2.0.7.0 - Production on 28-OCT-2010 09:38:51
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=jgzx1)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "jgzx" has 2 instance(s).
Instance "jgzx1", status READY, has 3 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=jgzx1)(PORT=1521))
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
"D000" established:117664 refused:0 current:21 max:1002 state:ready
DISPATCHER <machine: EYGLEORACLE1, pid: 6596>
(ADDRESS=(PROTOCOL=tcp)(HOST=jgzx1)(PORT=32812))
Instance "jgzx2", status READY, has 2 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(ADDRESS=(PROTOCOL=TCP)(HOST=jgzx2)(PORT=1521))
"D000" established:114273 refused:0 current:18 max:1002 state:ready
DISPATCHER <machine: EYGLEORACLE2, pid: 5563>
(ADDRESS=(PROTOCOL=tcp)(HOST=jgzx2)(PORT=32784))
Service "jgzx1" has 1 instance(s).
Instance "jgzx1", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully
由此,MTS模式的特点显而易见,其减少进程可以缩减系统的资源消耗,但是显然会导致排队,并不适用于对响应时间要求较高的OLTP系统。
历史上的今天...
>> 2015-11-02文章:
>> 2009-11-02文章:
>> 2006-11-02文章:
>> 2005-11-02文章:
By eygle on 2010-11-02 09:13 | Comments (8) | FAQ | 2652 |
这篇文章真是太好了,通过这个例子更容易理解共享服务器的运行机制了。专用服务器是时间片轮询执行事务,靠侦听器监视事务。共享服务器是靠调度进程监视事务,需要在公共队列排队。很有意思。
谢谢支持!
本来在CS架构下,Oracle DB的共享服务器模式还是有用的;
但后来随着BS的发展,中间件层的连接池间接取代了调度与数据库连结进程的工作,so专享模式越来越多,共享模式越来越不用了。
谢谢分享!
ebay是采用MTS方式的,同样是对响应时间要求很高的OLTP应用,我也是上次交流的时候了解到了一些信息,让我对MTS模式有了新的认识。
ebay是采用MTS方式的,大规模网站网站应用,连接数非常多,MTS模式就有应用场景了。我也是上次交流的时候获取的信息,让我对MTS模式有了新的认识。
哦,是么?Ebay什么系统使用的MTS?那共享进程要设置多少?
Oracle DB的共享服务器模式还是有用的;