yum -y install dstat iotop
[root@pgdb ~]# dstat -tndi
----system---- -net/total- -dsk/total- ----interrupts---
time | recv send| read writ| 62 63 64
10-06 14:41:16| 0 0 | 361k 1014k| 195 194 193
10-06 14:41:17|6070B 11k| 0 32k| 7 14 1
10-06 14:41:18| 24k 19k| 0 32k| 6 13 1
10-06 14:41:19|1475B 1113B| 0 0 | 0 0 1
10-06 14:41:20| 747B 724B| 0 8192B| 0 5 1
10-06 14:41:21| 60B 198B| 0 0 | 0 0 1
10-06 14:41:22| 124B 198B| 0 0 | 0 0 1
10-06 14:41:23|1464B 2875B| 0 0 | 0 0 1
10-06 14:41:24|1830B 10k| 0 0 | 1 0 1
10-06 14:41:25|4206B 5228B| 0 72M| 4 0 1
10-06 14:41:26|1188B 1537B| 0 8192B| 0 0 1
10-06 14:41:27| 180B 198B| 0 0 | 0 0 1
10-06 14:41:28| 377B 803B| 0 0 | 0 0 1
10-06 14:41:29| 712B 5313B| 0 0 | 0 0 1
10-06 14:41:30|3389B 3210B| 0 0 | 0 0 1
10-06 14:41:31| 667B 1262B| 0 0 | 0 0 1
q10-06 14:41:32| 620B 539B| 0 0 | 0 2 2
10-06 14:41:33|2613B 7337B| 0 0 | 0 0 1
^C[root@pgdb ~]# iostat -xm 1
Linux 3.10.0-1062.el7.x86_64 (pgdb) 06/10/2022 _x86_64_ (8 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
7.26 0.00 0.80 0.03 0.00 91.92
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 0.02 0.22 1.24 4.48 0.35 0.99 479.54 0.05 7.91 16.92 5.42 0.80 0.46
dm-0 0.00 0.00 1.24 4.66 0.35 0.99 466.08 0.05 7.75 16.96 5.29 0.77 0.45
dm-1 0.00 0.00 0.02 0.05 0.00 0.00 8.01 0.00 33.56 5.58 47.67 0.91 0.01
sdb 0.00 0.00 0.01 0.01 0.00 0.00 521.06 0.00 14.33 9.82 16.71 0.94 0.00
avg-cpu: %user %nice %system %iowait %steal %idle
0.12 0.00 0.12 0.00 0.00 99.75
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
avg-cpu: %user %nice %system %iowait %steal %idle
0.00 0.00 0.00 0.00 0.00 100.00
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
avg-cpu: %user %nice %system %iowait %steal %idle
0.00 0.00 0.12 0.00 0.00 99.88
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
avg-cpu: %user %nice %system %iowait %steal %idle
0.12 0.00 0.12 0.00 0.00 99.75
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
avg-cpu: %user %nice %system %iowait %steal %idle
0.38 0.00 0.13 0.00 0.00 99.50
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 0.00 0.00 0.00 1.00 0.00 0.01 16.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-0 0.00 0.00 0.00 1.00 0.00 0.01 16.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
avg-cpu: %user %nice %system %iowait %steal %idle
0.13 0.00 0.00 0.00 0.00 99.87
Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
^C
[root@pgdb ~]# iotop -oP -d 2
5717 be/4 postgres 0.00 B/s 3.91 K/s 0.00 % 0.02 % postgres: walwriter
12302 be/4 postgres 0.00 B/s 3.91 K/s 0.00 % 0.01 % postgres: gistar Check 10.168.14.186(60170) idle
Total DISK READ : 0.00 B/s | Total DISK WRITE : 3.35 M/s
Actual DISK READ: 0.00 B/s | Actual DISK WRITE: 3.92 K/s
PID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
2200 be/4 postgres 0.00 B/s 3.92 K/s 0.00 % 0.01 % postgres: sgdd zddb 192.168.207.205(49935) idle
10804 be/4 root 0.00 B/s 0.00 B/s 0.00 % 0.01 % [kworker/6:2]
5719 be/4 postgres 0.00 B/s 56.80 K/s 0.00 % 0.00 % postgres: stats collector
21447 be/4 root 0.00 B/s 3.26 M/s 0.00 % 0.00 % sftp-server
根据pid关联库的spid
select sid,serial#,username,program,sql_id from gv$session where paddr in (select addr from gv$process where spid=2200);



