使用 onstat –u 命令来显示有关需要数据库服务器任务控制块的活动线程的信息。
活动线程包括属于用户会话的线程,以及与数据库服务器守护程序(如,页面清除程序)相对应的一些线程。图 1 显示 onstat -u 输出的示例。
还使用 onstat -u 命令来确定某个用户是否正在等待资源,或持有过多的锁定,或了解该用户已执行了多少 I/O 的信息。
有关这些标志的信息,请参阅《GBase 8s 管理员参考》。
会话标识为 0 表示守护程序线程。
图: onstat -u 输出
Userthreads address flags sessid user tty wait tout locks nreads nwrites 80eb8c ---P--D 0 gbasedbt - 0 0 0 33 19 80ef18 ---P--F 0 gbasedbt - 0 0 0 0 0 80f2a4 ---P--B 3 gbasedbt - 0 0 0 0 0 80f630 ---P--D 0 gbasedbt - 0 0 0 0 0 80fd48 ---P--- 45 chrisw ttyp3 0 0 1 573 237 810460 ------- 10 chrisw ttyp2 0 0 1 1 0 810b78 ---PR-- 42 chrisw ttyp3 0 0 1 595 243 810f04 Y------ 10 chrisw ttyp2 beacf8 0 1 1 0 811290 ---P--- 47 chrisw ttyp3 0 0 2 585 235 81161c ---PR-- 46 chrisw ttyp3 0 0 1 571 239 8119a8 Y------ 10 chrisw ttyp2 a8a944 0 1 1 0 81244c ---P--- 43 chrisw ttyp3 0 0 2 588 230 8127d8 ----R-- 10 chrisw ttyp2 0 0 1 1 0 812b64 ---P--- 10 chrisw ttyp2 0 0 1 20 0 812ef0 ---PR-- 44 chrisw ttyp3 0 0 1 587 227 15 active, 20 total, 17 maximum concurrent