首页 > 数据库 > DB2 > 正文

深入了解DB2 Universal Database进程(3)

2020-03-09 22:22:52
字体:
来源:转载
供稿:网友

示例

  下面的例子显示了在aix上运行ps -ef命令时可能得到的输出:

在db2start后:
    root 49504     1   0 13:13:07             -  0:00 db2wdog
db2inst1 22142 49180   0 13:13:10      -  0:00 db2gds
db2inst1 43072 49180   0 13:13:17      -  0:00 db2syslog
db2inst1 45294 74134   0 12:12:43  pts/2  0:00 /usr/bin/ksh
db2inst1 49180 49504   0 13:13:10      -  0:00 db2sysc
db2inst1 55920 49180   0 13:13:19      -  0:00 db2resync
db2inst1 59012 22142   0 13:13:19      -  0:00 db2srvlst
db2inst1 60680 49180   0 13:13:17      -  0:00 db2ipccm

数据库管理器配置文件有下面的设置,他们影响到你最初看到的进程:

max number of existing agents           (maxagents) = 200
agent pool size                                 (num_poolagents) = 100(calculated)
initial number of agents in pool          (num_initagents) = 0

  因为num_initagents为0,在db2start时没有"db2agent(idle)"进程显示。如果在db2agent前把num_initagents设置为5,在运行db2start后将显示下面的额外进程:

db2inst1 35542 59814   0 16:25:57      -  0:00 db2agent (idle)
db2inst1 43096 59814   0 16:25:57      -  0:00 db2agent (idle)
db2inst1 49628 59814   0 16:25:57      -  0:00 db2agent (idle)
db2inst1 58170 59814   0 16:25:57      -  0:00 db2agent (idle)
db2inst1 64012 59814   0 16:25:57      -  0:00 db2agent (idle)

  在连接到数据库sample后(num_initagents仍然为0):

root 49504     1   0 13:13:07    -  0:00 db2wdog
db2inst1 25844 35124   0 16:04:50    -  0:00 db2pfchr
db2inst1 35124 65638   0 16:04:17    -  0:00 db2gds
db2inst1 35540 35124   0 16:04:50    -  0:00 db2loggr (sample)
db2inst1 41940 65638   0 16:04:19    -  0:00 db2resync
db2inst1 45058 35124   0 16:04:50    -  0:00 db2pfchr
db2inst1 49300 35124   0 16:04:19    -  0:00 db2srvlst
db2inst1 49626 35124   0 16:04:50    -  0:00 db2dlock (sample)
db2inst1 55852 65638   0 16:04:17    -  0:00 db2ipccm
db2inst1 58168 35124   0 16:04:50    -  0:00 db2loggw (sample)
db2inst1 59048 35124   0 16:04:50    -  0:00 db2pfchr
db2inst1 64010 55852   0 16:04:50    -  0:00 db2agent (sample)
db2inst1 65638 22238   0 16:04:17    -  0:00 db2sysc
db2inst1 70018 35124   0 16:04:50    -  0:00 db2pclnr
db2inst1 72120 35124   0 16:04:51    -  0:00 db2event (db2detaildeadlock)
db2inst1 74198 65638   0 16:04:17    -  0:00 db2syslog
db2inst1 74578     1   0 16:04:47    -  0:00 /home/db2inst1/sqllib/bin/db2bp
  50112c14631 5

  在连接到sample数据库后,出现了"db2agent(sample)"进程。这个进程显示实际上有一个到sample数据库的连接。如果我们运行下面的命令:

db2 connect reset

  db2agent(sample)将变成db2agent(idle)。这是因为num_poolagents设置为大于0,这意味着代理仍然分配在缓冲池中,虽然它时空闲的。如果num_poolagents设置为0,那么在"connect reset"后,就没有db2agent进程运行了。

  sample数据库的数据库配置文件有下面的设置:

number of asynchronous page cleaners   (num_iocleaners) = 1
number of i/o servers                   (num_ioservers) = 3

  注意有三个db2pfchr进程,他们与num_ioservers的值相对应,有一个db2pclnr进程与num_iocleaners的值相对应。

总结

  还有许多其它的进程可能出现或者不出现,这依赖于不同的db2行为和配置设定。我们演示了怎样调查哪个进程正在运行、这些进程显示什么信息、以及它们受到数据库设置怎样的影响的示例。现在你能使用这些知识提高管理db2数据库的能力。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表