gstat
打印运行时间统计信息
语法
gstat -g cpu
操作演示
[gbasedbt@devsvr ~]$ gstat -g cpu
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 01:22:15 -- 333720 Kbytes
Thread CPU Info:
tid name vp Last Run CPU Time #scheds status
2 lio vp 0 3lio* 10/18 03:57:14 0.0297 63 IO Idle
3 pio vp 0 4pio* 10/18 03:57:14 0.1195 14 IO Idle
4 aio vp 0 5aio* 10/18 03:57:14 0.1878 835 IO Idle
5 msc vp 0 6msc* 10/18 03:48:44 0.0083 5 IO Idle
6 fifo vp 0 7fifo* 10/18 02:41:37 0.1005 2 IO Idle
7 main_loop() 1cpu 10/18 04:03:47 0.0350 5170 sleeping secs: 1
8 soctcppoll 8soc* 10/18 04:03:47 4929.8230 20169 running
9 soctcplst 1cpu* 10/18 03:48:44 0.0164 50 sleeping forever
10 flush_sub(0) 1cpu 10/18 04:03:47 0.0041 4954 sleeping secs: 1
11 flush_sub(1) 1cpu 10/18 04:03:47 0.0036 4939 sleeping secs: 1
12 flush_sub(2) 1cpu 10/18 04:03:47 0.0044 4932 sleeping secs: 1
13 flush_sub(3) 1cpu 10/18 04:03:47 0.0089 4928 sleeping secs: 1
14 flush_sub(4) 1cpu 10/18 04:03:47 0.0036 4928 sleeping secs: 1
15 flush_sub(5) 1cpu 10/18 04:03:47 0.0042 4928 sleeping secs: 1
16 flush_sub(6) 1cpu 10/18 04:03:47 0.0041 4929 sleeping secs: 1
17 flush_sub(7) 1cpu 10/18 04:03:47 0.0040 4929 sleeping secs: 1
18 aio vp 1 9aio* 10/18 03:52:14 0.1153 90 IO Idle
19 aio vp 2 10aio* 10/18 03:37:13 0.1130 38 IO Idle
20 aio vp 3 11aio* 10/18 03:37:13 0.1200 29 IO Idle
21 aio vp 4 12aio* 10/18 03:37:13 0.1174 27 IO Idle
22 aio vp 5 13aio* 10/18 03:37:13 0.1065 23 IO Idle
23 aio vp 6 14aio* 10/18 03:37:13 0.1040 20 IO Idle
24 aio vp 7 15aio* 10/18 03:37:13 0.1037 19 IO Idle
25 aio vp 8 16aio* 10/18 03:37:13 0.1019 17 IO Idle
26 aio vp 9 17aio* 10/18 03:37:13 0.0337 13 IO Idle
27 aio vp 11 18aio* 10/18 02:42:44 0.0003 6 IO Idle
28 aio vp 10 19aio* 10/18 03:37:13 0.0005 8 IO Idle
29 aio vp 12 20aio* 10/18 02:42:44 0.0000 5 IO Idle
30 aio vp 13 21aio* 10/18 02:42:44 0.0000 4 IO Idle
31 aio vp 14 22aio* 10/18 02:42:44 0.5042 5 IO Idle
32 aslogflush 1cpu 10/18 04:03:47 0.0159 4925 sleeping secs: 1
33 btscanner_0 1cpu 10/18 04:02:51 0.0104 194 sleeping secs: 70
34 readahead_0 1cpu 10/18 04:01:42 0.0024 235 cond wait ReadAhead
35 auto_tune 1cpu 10/18 04:03:47 0.0102 4924 sleeping secs: 1
52 onmode_mon 1cpu* 10/18 04:03:47 0.0184 4922 sleeping secs: 1
53 periodic 1cpu 10/18 04:03:47 0.0431 4922 sleeping secs: 1
54 memory 1cpu 10/18 02:41:42 0.0005 1 sleeping forever
64 dbutil 1cpu 10/18 04:03:47 0.0106 4948 sleeping secs: 1
65 dbScheduler 1cpu 10/18 04:01:01 0.0658 1860 sleeping secs: 134
66 dbWorker1 1cpu 10/18 03:34:24 0.0101 142 sleeping forever
67 dbWorker2 1cpu 10/18 03:36:00 0.0526 3464 sleeping forever
71 bf_priosweep() 1cpu 10/18 04:02:14 0.0137 91 cond wait bp_cond
73 sqlexec 1cpu 10/18 03:49:05 0.0012 12 cond wait netnorm
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| tid | 线程 ID |
| name | 线程名称 |
| vp | 正在运行线程的虚拟处理器的 ID |
| Last Run | 线程上次运行的时间戳 |
| CPU Time | 直到现在线程运行的时间 |
| #scheds | 线程被安排运行的次数 |
| status | 线程的状态。 |
打印数据库服务器信息
语法
gstat -g dis
操作演示
[gbasedbt@devsvr ~]$ gstat -g dis
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 01:23:35 -- 333720 Kbytes
There are 1 servers found
Server : gbase8s
Server Number : 1
Server Type : IDS
Server Status : Up
Server Version: GBase Database Server Version 12.10.FC4G1TL
Shared Memory : 0x44000000
GBASEDBTDIR : /opt/gbase
ONCONFIG : /opt/gbase/etc/onconfig.gbase8s
SQLHOSTS : /opt/gbase/etc/sqlhosts.gbase8s
Host : devsvr
[gbasedbt@devsvr ~]$
打印高可用性数据复制信息
语法
gstat -g dri
操作演示
[gbasedbt@devsvr ~]$ gstat -g dri
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 01:24:33 -- 333720 Kbytes
Data Replication at 0x467f9028:
Type State Paired server Last DR CKPT (id/pg) Supports Proxy Writes
standard off -1 / -1 NA
DRINTERVAL 0
DRTIMEOUT 30
DRAUTO 0
DRLOSTFOUND /opt/gbase/etc/dr.lostfound
DRIDXAUTO 0
ENCRYPT_HDR 0
Backlog 0
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| Type | 服务器的当前类型:主服务器、辅助服务器或标准服务器 |
| State | on 或 off |
| Paired server | 与该服务器配对的主服务器或辅助服务器的名称 |
| Last DR CKPT | 最后 checkpoint ID 和页 |
| Supports Proxy Writes | 显示该服务器是否配置允许辅助服务器更新。Y = 支持辅助服务器更新,N = 不支持辅助服务器更新 |
| DRINTERVAL | onconfig 文件中配置参数的值 |
| DRTIMEOUT | onconfig 文件中配置参数的值 |
| DRAUTO | onconfig 文件中配置参数的值 |
| DRLOSTFOUND | onconfig 文件中配置参数的值 |
| DRIDXAUTO | onconfig 文件中配置参数的值 |
| ENCRYPT_HDR | onconfig 文件中配置参数的值 |
| Backlog | 在 HDR 数据复制缓冲区中还未发送到 HRD 辅助服务器中的日志页数 |
| Last Send | 最后一个消息发送至对等节点的时间 |
| Last Receive | 从对等节点接收的最后一个消息的时间 |
| Last Ping | 上次 ping 的时间 |
| Last log page applied(log id,page) | 上次应用日志的日志 ID 和页 |
打印全局多线程信息
语法
gstat -g glo
操作演示
[gbasedbt@devsvr ~]$ gstat -g glo
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 01:25:48 -- 333720 Kbytes
MT global info:
sessions threads vps lngspins time
1 43 22 0 5148
sched calls thread switches yield 0 yield n yield forever
total: 108171 82249 26319 72106 2212
per sec: 45 45 0 42 0
Virtual processor summary:
class vps usercpu syscpu total
cpu 1 1.22 0.58 1.80
aio 15 0.17 0.88 1.05
lio 1 0.00 0.09 0.09
pio 1 0.00 0.08 0.08
adm 1 0.00 0.41 0.41
soc 1 0.43 0.33 0.76
msc 1 0.00 0.00 0.00
fifo 1 0.00 0.07 0.07
total 22 1.82 2.44 4.26
Individual virtual processors:
vp pid class usercpu syscpu total Thread Eff
1 4535 cpu 1.22 0.58 1.80 2.84 63%
2 4536 adm 0.00 0.41 0.41 0.00 0%
3 4537 lio 0.00 0.09 0.09 0.09 100%
4 4538 pio 0.00 0.08 0.08 0.08 100%
5 4539 aio 0.00 0.14 0.14 0.14 100%
6 4540 msc 0.00 0.00 0.00 0.00 0%
7 4541 fifo 0.00 0.07 0.07 0.07 100%
8 4542 soc 0.43 0.33 0.76 NA NA
9 4543 aio 0.01 0.06 0.07 0.07 100%
10 4544 aio 0.00 0.07 0.07 0.07 100%
11 4545 aio 0.00 0.07 0.07 0.07 100%
12 4546 aio 0.00 0.06 0.06 0.06 100%
13 4547 aio 0.00 0.06 0.06 0.06 100%
14 4548 aio 0.03 0.03 0.06 0.06 100%
15 4549 aio 0.02 0.06 0.08 0.08 100%
16 4550 aio 0.00 0.07 0.07 0.07 100%
17 4551 aio 0.03 0.03 0.06 0.06 100%
18 4552 aio 0.02 0.04 0.06 0.06 100%
19 4553 aio 0.01 0.05 0.06 0.06 100%
20 4554 aio 0.01 0.05 0.06 0.06 100%
21 4555 aio 0.03 0.03 0.06 0.06 100%
22 4556 aio 0.01 0.06 0.07 0.07 100%
tot 1.82 2.44 4.26
[gbasedbt@devsvr ~]$
虚拟处理器摘要
| 列名 | 描述 |
|---|---|
| sessions | 会话数 |
| threads | 线程总数 |
| vps | 虚拟处理器的总数 |
| lngspins | 线程不得不 spin 超过 10,000 次以获得资源上的 latch 的次数 |
| time | 生成统计信息的时间。服务器启动时开始统计或通过运行 gstat -z 命令重置统计信息。 |
| sched calls | 排定呼叫的总数 |
| thread switches | 从一个线程到另一个线程切换的总次数 |
| yield | 线程收益率的统计信息(在该线程无法继续它的任务直到发生别的条件时发生) |
Virtual Processor Summary
| 列名 | 描述 |
|---|---|
| class | 虚拟处理器的类型 |
| vps | 这个虚拟处理器类的实例的数量 |
| usercpu | 这个虚拟处理器类在 CPU 上运行所花费的总用户时间(秒) |
| syscpu | 这个虚拟处理器类在 CPU 上运行所花费的总系统时间(秒) |
| total | 虚拟处理器类的总 CPU 时间,它是用户时间加上系统时间的总和 |
Individual virtual processors
| 列名 | 描述 |
|---|---|
| vp | 虚拟处理器编号。在 Windows™ 上,是线程 ID 值。 |
| pid | oninit 进程的进程 ID |
| class | 虚拟处理器类 |
| usercpu | 虚拟处理器类在 CPU 上运行的总用户时间(秒) |
| syscpu | 虚拟处理器类在 CPU 上运行的总系统时间(秒) |
| total | 虚拟处理器类的总 CPU 时间,它是用户时间加上系统时间的总和 |
| Thread | 线程在虚拟处理器上运行的总时间 |
| Eff | 效率,总 CPU 时间占线程在虚拟处理器上运行总时间的比率 |
显示异步IO统计信息
语法
gstat -g iof
操作演示
[gbasedbt@devsvr ~]$ gstat -g iof
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 01:27:16 -- 333720 Kbytes
AIO global files:
gfd pathname bytes read page reads bytes write page writes io/s
3 rootdbs.dbf 2519040 1230 264192 129 12859.8
op type count avg. time
seeks 0 N/A
reads 597 0.0000
writes 87 0.0006
kaio_reads 0 N/A
kaio_writes 0 N/A
4 llogdbs.dbf 1052672 514 202752 99 1752.4
op type count avg. time
seeks 0 N/A
reads 3 0.0030
writes 63 0.0005
kaio_reads 0 N/A
kaio_writes 0 N/A
5 plogdbs.dbf 47104 23 305152 149 947.9
op type count avg. time
seeks 0 N/A
reads 5 0.0000
writes 13 0.0015
kaio_reads 0 N/A
kaio_writes 0 N/A
6 tempdbs1.dbf 49152 24 262144 128 64964.0
op type count avg. time
seeks 0 N/A
reads 3 0.0000
writes 10 0.0000
kaio_reads 0 N/A
kaio_writes 0 N/A
7 tempdbs2.dbf 49152 24 262144 128 81757.8
op type count avg. time
seeks 0 N/A
reads 3 0.0000
writes 10 0.0000
kaio_reads 0 N/A
kaio_writes 0 N/A
8 tempdbs3.dbf 49152 24 147456 72 63405.3
op type count avg. time
seeks 0 N/A
reads 3 0.0000
writes 6 0.0000
kaio_reads 0 N/A
kaio_writes 0 N/A
9 binspaces_1.dbf 26624 13 0 0 402560.9
op type count avg. time
seeks 0 N/A
reads 13 0.0000
writes 0 N/A
kaio_reads 0 N/A
kaio_writes 0 N/A
10 binspaces_2.dbf 26624 13 0 0 268688.3
op type count avg. time
seeks 0 N/A
reads 13 0.0000
writes 0 N/A
kaio_reads 0 N/A
kaio_writes 0 N/A
11 sbspaces_1.dbf 30720 15 2048 1 33177.9
op type count avg. time
seeks 0 N/A
reads 15 0.0000
writes 1 0.0003
kaio_reads 0 N/A
kaio_writes 0 N/A
12 sbspaces_2.dbf 2048 1 0 0 302358.9
op type count avg. time
seeks 0 N/A
reads 1 0.0000
writes 0 N/A
kaio_reads 0 N/A
kaio_writes 0 N/A
13 datadbs1_1.dbf 815104 398 10240 5 64150.0
op type count avg. time
seeks 0 N/A
reads 177 0.0000
writes 5 0.0004
kaio_reads 0 N/A
kaio_writes 0 N/A
14 datadbs2_1.dbf 4096 2 2048 1 8148.6
op type count avg. time
seeks 0 N/A
reads 2 0.0000
writes 1 0.0004
kaio_reads 0 N/A
kaio_writes 0 N/A
15 datadbs3_1.dbf 4096 2 2048 1 5827.7
op type count avg. time
seeks 0 N/A
reads 2 0.0000
writes 1 0.0005
kaio_reads 0 N/A
kaio_writes 0 N/A
16 datadbs4_1.dbf 4096 2 2048 1 8090.6
op type count avg. time
seeks 0 N/A
reads 2 0.0000
writes 1 0.0003
kaio_reads 0 N/A
kaio_writes 0 N/A
17 datadbs5_1.dbf 4096 2 2048 1 9085.5
op type count avg. time
seeks 0 N/A
reads 2 0.0000
writes 1 0.0003
kaio_reads 0 N/A
kaio_writes 0 N/A
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| gfd | 该 chunk 或文件的全局文件描述符编号 |
| pathname | Chunk 或文件的路径名 |
| bytes read | 已经对 chunk 或文件执行的读取的字节数 |
| page reads | 已经对 chunk 或文件执行的页读取数 |
| bytes write | 已经对 chunk 或文件执行写入的字节数 |
| page writes | 已经对 chunk 或文件执行的页写入数 |
| io/s | 每妙执行的 I/O 操作数,该值代表 chunk 或文件的 I/O 性能 |
| op type | 操作类型 |
| count | 此操作发生的次数 |
| avg time | 操作结束所花的平均时间 |
打印 AIO 全局信息
语法
gstat -g iog
操作演示
[gbasedbt@devsvr ~]$ gstat -g iog
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 01:28:41 -- 333720 Kbytes
AIO global info:
9 aio classes
18 open files
64 max global files
[gbasedbt@devsvr ~]$
打印 I/O 队列信息
语法
gstat -g ioq
操作演示
[gbasedbt@devsvr ~]$ gstat -g ioq
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 01:35:39 -- 333720 Kbytes
AIO I/O queues:
q name/id len maxlen totalops dskread dskwrite dskcopy
fifo 0 0 0 0 0 0 0
drda_dbg 0 0 0 0 0 0 0
sqli_dbg 0 0 0 0 0 0 0
adt 0 0 0 0 0 0 0
msc 0 0 1 3 0 0 0
aio 0 0 14 146 22 0 0
pio 0 0 1 13 0 13 0
lio 0 0 1 64 0 64 0
gfd 3 0 127 1016 885 131 0
gfd 4 0 1 4 3 1 0
gfd 5 0 1 6 5 1 0
gfd 6 0 7 19 3 16 0
gfd 7 0 7 19 3 16 0
gfd 8 0 5 12 3 9 0
gfd 9 0 1 13 13 0 0
gfd 10 0 1 13 13 0 0
gfd 11 0 2 16 15 1 0
gfd 12 0 1 1 1 0 0
gfd 13 0 74 285 280 5 0
gfd 14 0 1 3 2 1 0
gfd 15 0 1 3 2 1 0
gfd 16 0 1 3 2 1 0
gfd 17 0 1 3 2 1 0
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| q name/id | I/O 队列的名称和编号。 |
| len | 在队列中暂挂 I/O 请求的数量 |
| maxlen | 队列中同时存在的 I/O 请求的最大数量 |
| totalops | 队列中已经完成的 I/O 操作的总数 |
| dskread | 队列已完成的读操作的总数 |
| dskwrite | 队列已完成的写操作的总数 |
| dskcopy | 队列已完成的复制操作的总数 |
q name/id
| 值 | 说明 |
|---|---|
| sqli_dbg | 处理 GBase 技术支持的 SQL 接口调试功能的 I/O |
| fifo | 处理 FIFO VPs 的 I/O |
| adt | 处理审计 I/O |
| msc | 处理杂项 I/O |
| aio | 处理 GBase 8s 异步 I/O |
| kio | 处理内核 AIO |
| pio | 处理物理日志记录 I/O |
| lio | 处理逻辑日志记录 I/O |
| gfd | 全局文件描述符 - 为每个主 chunk 和镜像 chunk 分配单独的全局文件描述符。 |
打印 AIO VP 统计信息
语法
gstat -g iov
操作演示
[gbasedbt@devsvr ~]$ gstat -g iov
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 01:37:10 -- 333720 Kbytes
AIO I/O vps:
class/vp/id s io/s totalops dskread dskwrite dskcopy wakeups io/wup errors tempops
fifo 7 0 i 0.0 0 0 0 0 1 0.0 0 0
msc 6 0 i 0.0 3 0 0 0 4 0.8 0 3
aio 5 0 i 0.1 860 706 42 0 832 1.0 0 0
aio 9 1 i 0.0 107 75 30 0 87 1.2 0 0
aio 10 2 i 0.0 49 24 23 0 35 1.4 0 0
aio 11 3 i 0.0 23 11 10 0 25 0.9 0 0
aio 12 4 i 0.0 11 4 6 0 24 0.5 0 0
aio 13 5 i 0.0 36 28 7 0 19 1.9 0 0
aio 14 6 i 0.0 5 0 3 0 17 0.3 0 0
aio 15 7 i 0.0 2 0 1 0 15 0.1 0 0
aio 16 8 i 0.0 3 0 2 0 14 0.2 0 0
aio 17 9 i 0.0 11 9 2 0 12 0.9 0 0
aio 19 10 i 0.0 6 5 1 0 8 0.8 0 0
aio 18 11 i 0.0 1 1 0 0 6 0.2 0 0
aio 20 12 i 0.0 0 0 0 0 5 0.0 0 0
aio 21 13 i 0.0 0 0 0 0 4 0.0 0 0
aio 22 14 i 0.0 0 0 0 0 4 0.0 0 0
pio 4 0 i 0.0 13 0 13 0 14 0.9 0 13
lio 3 0 i 0.0 64 0 64 0 65 1.0 0 64
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| class | 虚拟处理器类 |
| vp | 虚拟处理器在类中的 ID 编号 |
| s | AIO 虚拟处理器的当前状态 |
| io/s | 自数据库服务器启动以来或自 gstat -z 上次运行以来虚拟处理器的平均 I/O 速度(以每秒操作数衡量) |
| totalops | 自数据库服务器启动以来或自 gstat -z 上次运行以来虚拟处理器执行的 I/O 操作总数(以每秒操作数衡量) |
| dskread | 自数据库服务器启动以来或自 gstat -z 上次运行以来虚拟处理器执行的读操作总数(以每秒操作数衡量) |
| dskwrite | 自数据库服务器启动以来或自 gstat -z 上次运行以来虚拟处理器执行的写操作总数(以每秒操作数衡量) |
| dskcopy | 自数据库服务器启动以来或自 gstat -z 上次运行以来虚拟处理器执行的复制操作总数(以每秒操作数衡量) |
| wakeups | 对于 AIO VPs ,是自数据库服务器启动以来或自 gstat -z 上次运行以来虚拟处理器处于空闲状态的次数 |
| io/wup | 对于 AIO VPs ,是自数据库服务器启动以来或自 gstat -z 上次运行以来该虚拟处理器每次唤醒执行的 I/O 操作平均数 |
| errors | KAIO 超出资源的错误总数 |
| tempops | 仅供内部使用。是用来确定何时添加新 AIO VP 的 I/O 操作计数。它只在 AUTO_AIOVPS 配置参数启用时应用。 |
打印池内存统计信息
语法
gstat -g mem
操作演示
[gbasedbt@devsvr ~]$ gstat -g mem
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 01:39:06 -- 333720 Kbytes
Pool Summary:
name class addr totalsize freesize #allocfrag #freefrag
aqtpool V 46404040 8192 1168 6 2
afpool V 44bd3040 12288 5104 6 4
tpcpool V 463c5040 28672 3232 23 3
seqpool V 463f9040 4096 736 2 1
pnlpool V 463c8040 32768 1680 28 2
sbtlist V 45496040 20480 7200 4 3
dstpool V 463c4040 8192 3728 2 2
tenprp_cach V 46847040 8192 4008 8 1
ampool V 463f1040 4096 304 7 1
srvnm_cache V 463b4040 8192 3920 9 1
32*O0 V 57c0d040 4096 808 1 1
main_loop() V 467db040 188416 13400 40 16
sb_delundoq V 454ce040 49152 8752 4 3
XTF_mem V 4665f040 724992 5008 4 3
25*O0 V 57894040 4096 808 1 1
EXE.25.65 V 57bfd040 4096 680 3 1
EXE.25.65 V 57c89040 32768 288 281 1
26*O0 V 57b61040 4096 808 1 1
27*O0 V 57a8e040 4096 808 1 1
EXE.26.66 V 57913040 4096 680 3 1
EXE.26.66 V 57be8040 4096 744 2 1
EXE.26.66 V 57bfe040 4096 544 5 1
EXE.26.66 V 57b5a040 4096 360 8 1
EXE.27.67 V 57bcd040 4096 744 2 1
EXE.27.67 V 57bfa040 4096 544 5 1
EXE.27.67 V 57a68040 4096 360 8 1
RA_req_64_3 V 57dd5040 40960 896 3 2
bf_prioswee V 468f2040 28672 3056 13 4
RA_req_66_1 V 57c0e040 4096 112 2 1
RA_req_65_3 V 5793f040 40960 896 3 2
pmpool V 463c9040 8192 3728 2 2
RA_req_65_4 V 57998040 4096 112 2 1
memory V 57d77040 28672 3056 13 4
SES.25.65 V 57968040 8192 1400 7 2
RA_req_66_6 V 5786e040 4096 112 2 1
RA_req_65_8 V 57892040 4096 112 2 1
RA_req_67_6 V 57a9d040 4096 112 2 1
SES.26.66 V 57bb8040 8192 3736 3 2
GridQuery V 458ad040 4096 736 2 1
SES.27.67 V 57aad040 8192 3736 3 2
readahead_0 V 5781f040 135168 8880 135 7
userlbacpoo V 463cd040 8192 3728 2 2
PRP.25.65 V 5788d040 4096 216 4 1
ritem V 45640040 16384 2744 10 2
PRP.26.66 V 57a47040 4096 400 3 1
onlinereorg V 467ed040 20480 1720 4 3
PRP.27.67 V 57a56040 4096 400 3 1
onmode_mon V 57d3d040 28672 3056 13 4
lgflushpool V 46b33040 4096 504 3 1
2 V 4682a040 16384 2672 17 2
rsam V 45572040 811008 1416 1036 3
sqcrypto_na V 458b1040 4096 464 2 1
sscpool0 V 463ba040 12288 1584 2 2
3 V 46849040 20480 5152 23 4
SYS.29.69 V 57ba0040 8192 3832 2 2
aslogflush V 46b34040 28672 3056 13 4
aio V 458a8040 1294336 109880 367 50
opcinstpool V 463c7040 8192 2704 3 2
dbausrpool V 46400040 8192 3976 8 2
smartblob V 45495040 16384 6320 8 2
gls V 463b6040 1327104 3936 6197 7
policypool V 463cc040 8192 3728 2 2
DefConvWrit V 4665b040 16384 2776 102 1
proxyWrite V 45489040 49152 2832 2 2
sysprocpool V 46401040 8192 3632 3 2
resroutpool V 463cb040 8192 3728 2 2
btscanner_0 V 57802040 98304 18576 36 9
periodic V 57d5a040 28672 3056 13 4
auto_tune V 5783c040 49152 6736 29 5
smx V 4639a040 8192 3392 11 2
sb_delq V 4549b040 49152 8752 4 3
resident R 4408c040 11292672 22216 10 9
dictpool V 463bb040 479232 3328 124 3
grgid_cache V 463a5040 8192 3920 9 1
mt V 44bd4040 10833920 11216 5998 129
sqlhistory V 46406040 2060288 920 1002 2
env_vars V 44bb3040 61440 2944 341 1
32 V 57ac7040 81920 15616 89 10
24 V 57de2040 102400 16936 66 13
33 V 46a96040 16384 2672 17 2
hstad_cache V 463aa040 16384 136 133 1
25 V 57dd1040 671744 189112 483 68
26 V 57989040 475136 71992 421 36
aggpool V 463ca040 8192 3728 2 2
27 V 578e6040 483328 92920 401 45
procpool V 463c1040 360448 11208 365 22
extdpool V 463fa040 8192 2408 6 2
global V 44bb2040 15257600 849504 3332 250
Shard V 458ae040 12288 4768 3 2
spnam_cache V 463a3040 8192 2776 21 1
compr_cache V 458aa040 8192 4008 8 1
ctcpool V 463c6040 65536 3728 58 3
tmxapool V 463ff040 4096 680 3 1
sb_arcspace V 4556c040 8192 1752 4 2
pwnam_cache V 4639c040 12288 2744 41 3
sb_loheader V 45500040 282624 6528 413 57
RSS V 467fb040 188416 3536 507 43
rascron V 57d94040 36864 7784 24 7
inhpool V 463f3040 8192 2848 23 1
pwuid_cache V 463a0040 8192 2776 21 1
opcpool V 463f2040 8192 3272 18 1
hstnm_cache V 463a8040 8192 3568 13 1
Blkpool Summary:
name class addr size #blks
mt V 44bd6860 3321856 43
global V 44bd0e20 0 0
[gbasedbt@devsvr ~]$
Pool Summary
| 字段 | 说明 |
|---|---|
| name | 池的名称 |
| addr | 池内存地址 |
| totalsize | 池大小,以字节表示 |
| freesize | 在池中的可用内存量 |
| #allocfrag | 在池中的已分配的分片 |
| #freefrag | 在池中的可用分片 |
Blkpool Summary
| 字段 | 说明 |
|---|---|
| name | 池的名称 |
| addr | 池内存地址 |
| size | 池大小,以字节表示 |
| #blks | 池中的 block 数 |
打印网络用户统计信息
语法
gstat -g ntu
操作演示
[gbasedbt@devsvr ~]$ gstat -g ntu
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:04:46 -- 333720 Kbytes
global network information:
#netscb connects read write q-free q-limits q-exceed alloc/max
3/ 3 4 58 58 0/ 1 135/ 10 0/ 0 1/ 1
Individual thread network information (basic):
netscb type thread name sid fd poll reads writes q-nrm q-pvt q-exp
57c79598 soctcp sqlexec 32 2 5 11 11 0/ 1 1/ 1 0/ 0
461a6b90 soctcp soctcplst 3 1 5 4 0 0/ 0 0/ 0 0/ 0
461a2be0 soctcp soctcppoll 2 0 5 56 0 0/ 0 0/ 0 0/ 0
[gbasedbt@devsvr ~]$
打印网络用户时间
语法
gstat -g ntt
操作演示
[gbasedbt@devsvr ~]$ gstat -g ntt
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:06:21 -- 333720 Kbytes
global network information:
#netscb connects read write q-free q-limits q-exceed alloc/max
3/ 3 4 58 58 0/ 1 135/ 10 0/ 0 1/ 1
Individual thread network information (times):
netscb thread name sid open read write address
57c79598 sqlexec 32 03:48:44 03:49:05 03:49:05
461a6b90 soctcplst 3 02:41:38 03:48:44 192.168.3.5|9088|soctcp
461a2be0 soctcppoll 2 02:41:38
[gbasedbt@devsvr ~]$
显示打开的分区(表和索引)
语法
gstat -g opn
操作演示
[gbasedbt@devsvr ~]$ gstat -g opn
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:09:10 -- 333720 Kbytes
rstcb 0x45738068 tid 34
isfd op_mode op_flags partnum ucnt ocnt lk ra partp ocnt ucnt
0 0x70000 0x403 0x800003 1 0 0 0x57918028 0 1
1 0x70000 0x403 0x100086 1 0 0 0x57dd2028 4 5
2 0x70000 0x403 0x100095 1 0 0 0x57de1a48 0 1
3 0x70000 0x403 0x100089 1 0 0 0x578de028 0 1
4 0x70000 0x403 0x10008c 1 0 0 0x57dd2a28 0 1
5 0x70000 0x403 0x100087 1 0 0 0x578de9b0 0 1
......
30 0x70000 0x403 0x900049 1 0 0 0x57be6a30 0 1
31 0x70000 0x403 0x900005 1 0 0 0x57bb5548 0 1
32 0x70000 0x403 0x900004 1 0 0 0x57be78f8 0 1
33 0x70000 0x403 0x900047 1 0 0 0x57c4caf8 0 1
34 0x70000 0x403 0x1000d8 1 0 0 0x57af47f0 0 3
rstcb 0x457391e8 tid 73
isfd op_mode op_flags partnum ucnt ocnt lk ra partp ocnt ucnt
0 0x400 0x297 0x900002 2 2 1 0x57adb6c8 1 2
1 0x2 0x3 0x900002 2 2 0 0x57adb6c8 1 2
rstcb 0x4573bda8 tid 65
isfd op_mode op_flags partnum ucnt ocnt lk ra partp ocnt ucnt
0 0x400 0x297 0x100086 2 2 21 0x57dd2028 4 5
1 0x2 0x3 0x100086 2 2 0 0x57dd2028 4 5
2 0x1000400 0x3 0x1000ea 1 1 S 0 0x579268b8 1 1
3 0x1000440 0x3 0x1000eb 1 1 0 0x57956028 1 1
4 0x1000402 0x403 0x1000d1 2 0 IX 0 0x57986950 0 7
5 0x2 0x3 0x100004 2 2 0 0x57915880 1 2
6 0x400 0x297 0x100004 2 2 61 0x57915880 1 2
7 0x1000442 0x403 0x1000d3 1 0 S 0 0x57a735b0 0 3
8 0x1000400 0x403 0x1000d1 2 0 IX 1 0x57986950 0 7
rstcb 0x4573c668 tid 66
isfd op_mode op_flags partnum ucnt ocnt lk ra partp ocnt ucnt
0 0x400 0x297 0x100086 2 2 1 0x57dd2028 4 5
1 0x2 0x3 0x100086 2 2 0 0x57dd2028 4 5
2 0x1000400 0x403 0x1000d6 4 0 IX 0 0x57a73028 0 4
3 0x1000400 0x403 0x1000d1 2 0 IX 0 0x57986950 0 7
4 0x1000440 0x403 0x1000d3 2 0 0 0x57a735b0 0 3
5 0x1000440 0x403 0x1000d9 3 0 IX 1 0x57a847f0 0 3
6 0x1000402 0x403 0x1000d1 2 0 IX 0 0x57986950 0 7
7 0x1000442 0x403 0x1000d7 2 0 IX 0 0x57adb028 0 2
8 0x1000442 0x403 0x1000d3 2 0 0 0x57a735b0 0 3
9 0x1000442 0x403 0x1000d5 1 0 IX 0 0x578e8780 0 2
10 0x1000402 0x403 0x1000d6 4 0 IX 0 0x57a73028 0 4
11 0x1000442 0x403 0x1000d8 2 0 IX 0 0x57af47f0 0 3
12 0x1000442 0x403 0x1000d9 3 0 IX 0 0x57a847f0 0 3
13 0x1000402 0x403 0x1000d6 4 0 IX 0 0x57a73028 0 4
14 0x1000402 0x407 0x1000d6 4 0 IX 1 0x57a73028 0 4
15 0x1000442 0x403 0x1000d8 2 0 IX 21 0x57af47f0 0 3
16 0x1000442 0x403 0x1000d7 2 0 IX 0 0x57adb028 0 2
17 0x1000442 0x403 0x1000d9 3 0 IX 0 0x57a847f0 0 3
rstcb 0x4573cf28 tid 64
isfd op_mode op_flags partnum ucnt ocnt lk ra partp ocnt ucnt
0 0x400 0x317 0x100086 2 2 41 0x57dd2028 4 5
1 0x2 0x3 0x100086 2 2 0 0x57dd2028 4 5
rstcb 0x4573d7e8 tid 67
isfd op_mode op_flags partnum ucnt ocnt lk ra partp ocnt ucnt
0 0x400 0x297 0x100086 2 2 1 0x57dd2028 4 5
1 0x2 0x3 0x100086 2 2 0 0x57dd2028 4 5
2 0x1000400 0x403 0x1000d6 4 0 IX 0 0x57a73028 0 4
3 0x1000400 0x403 0x1000d1 2 0 IX 0 0x57986950 0 7
4 0x1000440 0x403 0x1000d3 2 0 0 0x57a735b0 0 3
5 0x1000440 0x403 0x1000d9 3 0 IX 1 0x57a847f0 0 3
6 0x1000442 0x403 0x1000d3 2 0 0 0x57a735b0 0 3
7 0x1000442 0x403 0x1000d5 1 0 IX 0 0x578e8780 0 2
8 0x1000402 0x403 0x1000d1 2 0 IX 0 0x57986950 0 7
9 0x1000402 0x403 0x1000d6 4 0 IX 0 0x57a73028 0 4
10 0x1000442 0x403 0x1000d7 2 0 IX 0 0x57adb028 0 2
11 0x1000442 0x403 0x1000d8 2 0 IX 0 0x57af47f0 0 3
12 0x1000442 0x403 0x1000d9 3 0 IX 0 0x57a847f0 0 3
14 0x1000402 0x407 0x1000d6 4 0 IX 1 0x57a73028 0 4
16 0x1000402 0x403 0x1000d6 4 0 IX 0 0x57a73028 0 4
17 0x1000442 0x403 0x1000d9 3 0 IX 0 0x57a847f0 0 3
21 0x1000442 0x403 0x1000d8 2 0 IX 1 0x57af47f0 0 3
22 0x1000442 0x403 0x1000d7 2 0 IX 0 0x57adb028 0 2
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| tid | 当前访问分区资源(表和索引)的线程 ID |
| rstcb | 该线程的 RSAM 线程控制 block 的内存地址 |
| isfd | 与打开分区关联的 ISAM 文件描述符 |
| op_mode | 使用以下十六进制值组合的分区锁定方式的当前状态 |
| op_flags | 分区的当前状态使用以下十六进制值组合: |
| partnum | 已打开资源(表和索引)的分区数 |
| ucnt | 当前访问该分区的用户线程数 |
| ocnt | 打开该分区的次数 |
| lk | 锁类型 |
打印 VP 信息
语法
gstat -g sch
操作演示
[gbasedbt@devsvr ~]$ gstat -g sch
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:11:30 -- 333720 Kbytes
VP Scheduler Statistics:
vp pid class semops busy waits spins/wait bsy lspins
1 4535 cpu 8832 0 0 0
2 4536 adm 0 0 0 0
3 4537 lio 98 0 0 0
4 4538 pio 20 0 0 0
5 4539 aio 867 0 0 0
6 4540 msc 5 0 0 0
7 4541 fifo 2 0 0 0
8 4542 soc 2 0 0 0
9 4543 aio 95 0 0 0
10 4544 aio 42 0 0 0
11 4545 aio 33 0 0 0
12 4546 aio 32 0 0 0
13 4547 aio 27 0 0 0
14 4548 aio 24 0 0 0
15 4549 aio 21 0 0 0
16 4550 aio 19 0 0 0
17 4551 aio 14 0 0 0
18 4552 aio 7 0 0 0
19 4553 aio 10 0 0 0
20 4554 aio 6 0 0 0
21 4555 aio 5 0 0 0
22 4556 aio 5 0 0 0
Thread Migration Statistics:
vp pid class steal-at steal-sc idlvp-at idlvp-sc inl-polls Q-ln
1 4535 cpu 0 0 0 0 0 0
2 4536 adm 0 0 0 0 0 0
3 4537 lio 0 0 0 0 0 0
4 4538 pio 0 0 0 0 0 0
5 4539 aio 0 0 0 0 0 0
6 4540 msc 0 0 0 0 0 0
7 4541 fifo 0 0 0 0 0 0
8 4542 soc 0 0 0 0 0 0
9 4543 aio 0 0 0 0 0 0
10 4544 aio 0 0 0 0 0 0
11 4545 aio 0 0 0 0 0 0
12 4546 aio 0 0 0 0 0 0
13 4547 aio 0 0 0 0 0 0
14 4548 aio 0 0 0 0 0 0
15 4549 aio 0 0 0 0 0 0
16 4550 aio 0 0 0 0 0 0
17 4551 aio 0 0 0 0 0 0
18 4552 aio 0 0 0 0 0 0
19 4553 aio 0 0 0 0 0 0
20 4554 aio 0 0 0 0 0 0
21 4555 aio 0 0 0 0 0 0
22 4556 aio 0 0 0 0 0 0
[gbasedbt@devsvr ~]$
打印共享内存段的统计信息
显示当前有哪些内存段,及每个内存段的使用情况。
语法
gstat -g seg
操作演示
[gbasedbt@devsvr ~]$ gstat -g seg
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:13:11 -- 333720 Kbytes
Segment Summary:
id key addr size ovhd class blkused blkfree
1179648 52574801 44000000 11866112 572216 R 2897 0
1212417 52574802 44b51000 33439744 393384 V 8164 0
1245186 52574803 46b35000 113287168 1 B 27658 0
1277955 52574804 4d73f000 166359040 1 B 40615 0
1310724 52574805 575e6000 8388608 99720 V 1831 217
1343493 52574806 57de6000 8388608 99720 V 25 2023
Total: - - 341729280 - - 81190 2240
(* segment locked in memory)
No reserve memory is allocated
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| id | 共享内存分段 ID |
| key | 与共享内存分段 ID 相关联的共享内存键 |
| addr | 共享内存分段地址 |
| size | 共享内存分段大小(字节) |
| ovhd | 共享内存分段控制信息(开销)大小(字节) |
| class | 共享内存的类型(B 代表共享内存池、V 代表虚拟、VX 代表虚拟扩展、M 代表消息) |
| blkused | 已使用内存的 block 数 |
| blkfree | 空闲内存的 block 数 |
打印与会话有关的信息
打印Session连接信息。
语法
gstat -g ses [session_id]
操作演示
[gbasedbt@devsvr ~]$ gstat -g ses
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:14:13 -- 333720 Kbytes
session #RSAM total used dynamic
id user tty pid hostname threads memory memory explain
33 gbasedbt - 0 - 0 16384 13712 off
32 gbasedbt 0 4795 devsvr 1 86016 69592 off
27 gbasedbt - 0 - 1 499712 412488 off
26 gbasedbt - 0 - 1 503808 414152 off
25 gbasedbt - 0 - 1 675840 485928 off
24 gbasedbt - 0 - 1 102400 85464 off
3 gbasedbt - 0 - 0 20480 15328 off
2 gbasedbt - 0 - 0 16384 13712 off
[gbasedbt@devsvr ~]$
指定SessionID,可以显示更详细的信息。
[gbasedbt@devsvr ~]$ gstat -g ses 32
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:14:55 -- 333720 Kbytes
session effective #RSAM total used dynamic
id user user tty pid hostname threads memory memory explain
32 gbasedbt - 0 4795 devsvr 1 86016 69592 off
Program :
/opt/gbase/bin/dbaccess
tid name rstcb flags curstk status
73 sqlexec 457391e8 Y-BP--- 3936 cond wait netnorm -
Memory pools count 2
name class addr totalsize freesize #allocfrag #freefrag
32 V 57ac7040 81920 15616 89 10
32*O0 V 57c0d040 4096 808 1 1
name free used name free used
overhead 0 6576 scb 0 144
opentable 0 3792 filetable 0 616
ru 0 600 log 0 16536
temprec 0 2208 keys 0 176
ralloc 0 1024 gentcb 0 1616
ostcb 0 2968 sqscb 0 20928
sql 0 72 hashfiletab 0 552
osenv 0 2752 sqtcb 0 8696
fragman 0 336
sqscb info
scb sqscb optofc pdqpriority optcompind directives
461fc290 57acf028 0 0 2 1
Sess SQL Current Iso Lock SQL ISAM F.E.
Id Stmt type Database Lvl Mode ERR ERR Vers Explain
32 - mydb CR Not Wait 0 0 9.24 Off
Last parsed SQL statement :
update t_user set f_username = 'gbase8s' where f_userid = 2
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| Session id | 会话 ID |
| user | 启动该会话的用户名 |
| tty | 与此会话的前端关联的 tty |
| pid | 与此会话的前端关联的进程 ID |
| hostname | 此会话已连接的主机名 |
| #RSAM threads | 为此会话分配的 RSAM 线程的数量 |
| total memory | 为此会话分配的内存量 |
| used memory | 此会话实际使用的内存量 |
| dynamic explain | 生成会话的 SQL 语句的说明输出(on 或 off) |
| 字段 | 说明 |
|---|---|
| tid | 线程 ID |
| name | 线程的名称 |
| rstcb | RSAM 控制 block |
| flags | 使用以下代码描述线程的状态: |
| curstk | 当前堆栈大小 |
| status | 当前线程状态 |
| name | 池名称 |
| class | 池所分配位置的内存类。R 代表常驻、V 代表虚拟、M 代表消息 |
| addr | 池结构的地址 |
| totalsize | 池获得的内存的总的大小,以字节表示 |
| freesize | 在池中的可用字节数量 |
| #allocfrag | 在池中已分配内存分片的数量 |
| #freefrag | 在池中的可用分片数量 |
| 字段 | 说明 |
|---|---|
| name | 已经从池中分配内存的组件的名称 |
| free | 释放的字节数量 |
| used | 分配的字节数量 |
| 字段 | 说明 |
|---|---|
| scb | 会话控制 block。这是共享内存中主会话结构的地址 |
| sqscb | 会话的 SQL 级别控制 block |
| optofc | OPTOFC 环境变量或 ONCONFIG 配置文件设置的当前值 |
| pdqpriority | PDQPRIORITY 环境变量或 ONCONFIG 配置文件设置的当前值 |
| optcompind | OPTCOMPIND 环境变量或 ONCONFIG 配置文件设置的当前值 |
| directives | DIRECTIVES 环境变量或 ONCONFIG 配置文件设置的当前值 |
打印 sbspace 信息
语法
gstat -g smb [c | s] [e | h] [cad | fdd | lod]
| 命令 | 解释 |
|---|---|
| gstat -g smb c | 列出 sbspace 中的所有的 chunk |
| gstat -g smb e | 列出所有智能大对象表类型的条目 |
| gstat -g smb cad | 列出智能大对象 chunk 头表条目 |
| gstat -g smb e fdd | 列出智能大对象文件描述符条目 |
| gstat -g smb e lod | 列出智能大对象头表中的条目 |
| gstat -g smb fdd | 列出智能大对象文件描述符 |
| gstat -g smb h | 列出所有智能大对象表类型头 |
| gstat -g smb h cad | 列出智能大对象 chunk 头表头 |
| gstat -g smb h fdd | 列出智能大对象文件描述符表头 |
| gstat -g smb h lod | 列出智能大对象文头表的表头 |
| gstat -g smb lod | 列出在智能大对象头表中的头和条目 |
| gstat -g smb s | 列出 sbspace 属性(所有者、名称、页大小、-Df 标识设置) |
操作演示
[gbasedbt@devsvr ~]$ gstat -g smb c
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:17:18 -- 333720 Kbytes
Chunk Summary:
sbnum 8 chunk 9
Chunk: address flags offset size orig fr usr pgs free pg
46ac9028 FR------ 0 51200 47678 47678 47678
path: /opt/gbase/gbase8s_dbs/sbspaces_1.dbf
start pg npages
Ud1 : 53 23839
Md : 23892 3469
Ud2 : 27361 23839
sbnum 8 chunk 10
Chunk: address flags offset size orig fr usr pgs free pg
46aca028 -R------ 0 51200 47725 47725 47725
path: /opt/gbase/gbase8s_dbs/sbspaces_2.dbf
start pg npages
Ud1 : 3 23862
Md : 23865 3472
Ud2 : 27337 23863
[gbasedbt@devsvr ~]$
打印与 SQL 有关的会话信息
语法
gstat -g sql <Session_ID>
操作演示
[gbasedbt@devsvr ~]$ gstat -g sql 32
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:18:16 -- 333720 Kbytes
Sess SQL Current Iso Lock SQL ISAM F.E.
Id Stmt type Database Lvl Mode ERR ERR Vers Explain
32 - mydb CR Not Wait 0 0 9.24 Off
Last parsed SQL statement :
update t_user set f_username = 'gbase8s' where f_userid = 2
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| Sess id | 会话标识 |
| SQL Stmt type | SQL 语句类型 |
| Current Database | 会话的当前数据库的名称 |
| ISO Lvl | 隔离级别 |
| Lock mode | 当前会话的锁定方式 |
| SQL Error | 当前语句遇到的 SQL 错误号 |
| ISAM Error | 当前语句遇到的 ISAM 错误号 |
| F.E. Version | 当前客户端程序使用的 SQLI 协议的版本 |
| Explain | SET EXPLAIN 设置 |
| 字段 | 说明 |
|---|---|
| DR | Dirty 读取 |
| CR | 已提交读取 |
| CS | 游标锁定 |
| DRU | Dirty 读取,保留更新锁 |
| CRU | 已提交读取,保留更新锁 |
| CSU | 游标锁定,保留更新锁 |
| LC | 已提交读取,最后提交 |
| LCU | 已提交读取,最后提交,保留更新锁 |
| RR | 可重复的读取 |
| NL | 没有事务的数据库 |
打印线程概要文件
语法
gstat -g tpf <thread_id>
操作演示
[gbasedbt@devsvr ~]$ gstat -g bth
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:19:37 -- 333720 Kbytes
This command attempts to identify any blocking threads.
No blocking thread identified.
Threads waiting on resources
tid name blocking resource blocker
34 readahead_0 Condition (ReadAhead) -
71 bf_priosweep() Condition (bp_cond) -
73 sqlexec Condition (netnorm) -
[gbasedbt@devsvr ~]$ gstat -g tpf 73
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:19:59 -- 333720 Kbytes
Thread profiles
tid lkreqs lkw dl to lgrs isrd iswr isrw isdl isct isrb lx bfr bfw lsus lsmx seq
73 163 0 0 0 3 77 0 1 0 0 0 0 164 1 208 0 1
[gbasedbt@devsvr ~]$
| 列名 | 说明 |
|---|---|
| tid | 线程 ID |
| lkreqs | 锁请求数 |
| lkw | 锁等待数 |
| dl | 死锁数 |
| to | 远程死锁超时 |
| lgrs | 日志记录 |
| isrd | 读取数 |
| iswr | 写入数 |
| isrw | 重新写入数 |
| isdl | 删除数 |
| isct | 提交数 |
| isrb | 回滚数 |
| lx | 长事务 |
| bfr | 缓冲区读取数 |
| bfw | 缓冲区写入数 |
| lsus | 当前使用的日志空间 |
| lsmx | 使用的最大日志空间 |
| seq | 顺序扫描数 |
打印等待队列线程队列
语法
gstat -g wai
操作演示
[gbasedbt@devsvr ~]$ gstat -g wai
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:21:13 -- 333720 Kbytes
Waiting threads:
tid tcb rstcb prty status vp-class name
2 4671d148 0 1 IO Idle 3lio* lio vp 0
3 4673e368 0 1 IO Idle 4pio* pio vp 0
4 4675f368 0 1 IO Idle 5aio* aio vp 0
5 46780368 20e1f00 1 IO Idle 6msc* msc vp 0
6 467b1368 0 1 IO Idle 7fifo* fifo vp 0
7 467d2608 45732028 3 sleeping secs: 1 1cpu main_loop()
9 4684c808 0 2 sleeping forever 1cpu* soctcplst
10 468f02b0 457328e8 1 sleeping secs: 1 1cpu flush_sub(0)
11 468f05f0 457331a8 1 sleeping secs: 1 1cpu flush_sub(1)
12 468f0930 45733a68 1 sleeping secs: 1 1cpu flush_sub(2)
13 468f0c70 45734328 1 sleeping secs: 1 1cpu flush_sub(3)
14 468f1028 45734be8 1 sleeping secs: 1 1cpu flush_sub(4)
15 468f1368 457354a8 1 sleeping secs: 1 1cpu flush_sub(5)
16 468f16a8 45735d68 1 sleeping secs: 1 1cpu flush_sub(6)
17 468f19e8 45736628 1 sleeping secs: 1 1cpu flush_sub(7)
18 46ac12c8 0 1 IO Idle 9aio* aio vp 1
19 46af0368 0 1 IO Idle 10aio* aio vp 2
20 46b11368 0 1 IO Idle 11aio* aio vp 3
21 46b32368 0 1 IO Idle 12aio* aio vp 4
22 5761f368 0 1 IO Idle 13aio* aio vp 5
23 57640368 0 1 IO Idle 14aio* aio vp 6
24 57661368 0 1 IO Idle 15aio* aio vp 7
25 57682368 0 1 IO Idle 16aio* aio vp 8
26 576a3368 0 1 IO Idle 17aio* aio vp 9
27 576c46a8 0 1 IO Idle 18aio* aio vp 11
28 576c4368 0 1 IO Idle 19aio* aio vp 10
29 576c49e8 0 1 IO Idle 20aio* aio vp 12
30 576c4d28 0 1 IO Idle 21aio* aio vp 13
31 46af0760 0 1 IO Idle 22aio* aio vp 14
32 57769758 45736ee8 2 sleeping secs: 1 1cpu aslogflush
33 46b118a0 457377a8 1 sleeping secs: 40 1cpu btscanner_0
34 5761f750 45738068 3 cond wait ReadAhead 1cpu readahead_0
35 576616a8 45738928 3 sleeping secs: 1 1cpu auto_tune
52 57d220e8 45739aa8 3 sleeping secs: 1 1cpu* onmode_mon
53 57d22428 4573ac28 3 sleeping secs: 1 1cpu periodic
54 57d22768 4573b4e8 3 sleeping forever 1cpu memory
64 57de3760 4573cf28 1 sleeping secs: 1 1cpu dbutil
65 57dc0760 4573bda8 1 sleeping secs: 135 1cpu dbScheduler
66 57880610 4573c668 1 sleeping forever 1cpu dbWorker1
67 579c5610 4573d7e8 1 sleeping forever 1cpu dbWorker2
71 57c50c60 4573a368 1 cond wait bp_cond 1cpu bf_priosweep()
73 57c005c8 457391e8 1 cond wait netnorm 1cpu sqlexec
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| tid | 线程 ID |
| tcb | 线程控制 block 的内存地址 |
| rstcb | RSAM 线程控制 block 的内存地址 |
| prty | 线程优先级。较大的数字代表较高的优先级 |
| status | 线程的当前状态 |
| vp-class | 上次运行线程的 VP 的虚拟处理器整数 ID 与运行线程的 VP 类的名称连接 |
| name | 线程名称 |
打印线程的等待统计信息
语法
gstat -g wst
操作演示
[gbasedbt@devsvr ~]$ gstat -g cfg | grep WSTATS
Your evaluation license will expire on 2022-10-14 00:00:00
WSTATS 0
[gbasedbt@devsvr ~]$ gadmin -wf WSTATS=1
Your evaluation license will expire on 2022-10-14 00:00:00
Value of WSTATS has been changed to 1.
[gbasedbt@devsvr ~]$ gstat -g cfg | grep WSTATS
Your evaluation license will expire on 2022-10-14 00:00:00
WSTATS 1
[gbasedbt@devsvr ~]$ gstat -g wst
Your evaluation license will expire on 2022-10-14 00:00:00
On-Line -- Up 02:25:37 -- 333720 Kbytes
name tid state n avg(us) max(us)
btscanne 189 IO Wait 1 1 1
btscanne 189 yield 0 19 4 12
btscanne 189 yield time 372 88.0s 180.3s
btscanne 189 other mutex 26 4 30
btscanne 189 ready 1147 21 2724
btscanne 189 run 419 229 3868
btscanne 189 IO Idle 1 2 2
sqlexec 191 IO Wait 1 801 801
sqlexec 191 other cond 4 112 143
sqlexec 191 ready 6 10 57
sqlexec 191 run 5 147 307
[gbasedbt@devsvr ~]$
| 字段 | 说明 |
|---|---|
| name | 线程名称 |
| tid | 线程 ID |
| state | 说明在此输出行内等待的线程。如果单个线程在多个不同的状态中等待,那么它可能有多行输出 |
| n | 在此状态下等待的线程次数 |
| avg(us) | 每次等待发生的时候,线程在此状态下等待的平均用户时间。时间的单位为微秒,值后的 s 表示以秒为单位计算用户时间。 |
| max(us) | 等待发生的时候,线程在此状态下等待的最大用户时间。时间的单位为微秒,值后的 s 表示以秒为单位计算用户时间。 |
state说明
| 值 | 说明 |
|---|---|
| chkpt cond | 线程等待 checkpoint 条件 |
| cp mutex | 线程等待 checkpoint 互斥可用 |
| deadlock mutex | 线程等待死锁互斥可用 |
| empty Q | 线程等待队列中的空缓冲区 |
| fork | 线程等待子线程运行 |
| full Q | 线程等待队列上的一个完整的缓冲区 |
| IO Idle | I/O 线程空闲 |
| IO Wait | 线程产生,同时等待 I/O 完成 |
| join wait | 线程等待另一个线程退出 |
| lock mutex | 线程等待锁定互斥可用 |
| lockfree mutex | 线程等待锁释放互斥可用 |
| logflush | 发生逻辑日志清空 |
| log mutex | 线程等待逻辑日志互斥可用 |
| logcopy cond | 线程等待逻辑日志复制互斥可用 |
| logio cond | 线程等待逻辑日志条件 |
| lrus mutex | 线程等待缓冲区 LRU 互斥可用 |
| misc | 现场等待杂项理由 |
| other cond | 线程等待内部条件 |
| other mutex | 线程等待内部系统互斥可用 |
| other yield | 线程等待内部原因 |
| OS read | 线程等待操作系统读请求完成 |
| OS write | 线程等待操作系统写请求完成 |
| ready | 线程已准备好运行 |
| run | 线程已运行 |
| sort io | 线程等待排序 I/O 完成 |
| vp mem sync | 线程等待虚拟处理器同步 |
| yield bufwait | 线程产生,同时等待缓冲区可用 |
| yield 0 | 线程产生,但立即超时 |
| yield time | 线程产生超时 |
| yield forever | 线程产生并保持这种方式,直到它被唤醒 |
最后修改时间:2022-05-13 16:43:29
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




