可以使用 onstat -g ses 命令显示会话的信息。
缺省情况下,只有 DBSA 可以查看 onstat -g ses 信息。然而,当 UNSECURE_ONSTAT 配置参数设置为 1 时,所有的用户都可以查看该信息。
可以指定以下调用之一。
图: onstat -g ses 命令输出
session #RSAM total used dynamic id user tty pid hostname threads memory memory explain 24 gbasedbt - 0 - 0 12288 7936 off 23 gbasedbt - 17602 carson 1 57344 48968 off 3 gbasedbt - 0 - 0 12288 9168 off 2 gbasedbt - 0 - 0 12288 7936 off
图: onstat -g sessessionid 命令输出
session effective #RSAM total used dynamic id user user tty pid hostname threads memory memory explain 53 gbasedbt - 36 18638 apollo11 1 73728 63048 off Program : /usr/gbasedbt/bin/dbaccess tid name rstcb flags curstk status 77 sqlexec 4636ba20 Y--P--- 4240 cond wait sm_read - Memory pools count 1 name class addr totalsize freesize #allocfrag #freefrag 53 V 4841d040 73728 10680 84 6 name free used name free used overhead 0 3288 scb 0 144 opentable 0 2904 filetable 0 592 log 0 16536 temprec 0 2208 gentcb 0 1656 ostcb 0 2920 sqscb 0 21296 sql 0 72 hashfiletab 0 552 osenv 0 2848 sqtcb 0 7640 fragman 0 392 sqscb info scb sqscb optofc pdqpriority optcompind directives 481b70a0 483e2028 0 0 0 1 Sess SQL Current Iso Lock SQL ISAM F.E. Id Stmt type Database Lvl Mode ERR ERR Vers Explain 53 - sysmaster CR Not Wait 0 0 9.24 Off Last parsed SQL statement : Database 'sysmaster@lx1' Xadatasources participated in this session : Xadatasource name RMID Active xabasicdb@atmol10:sitaramv.xads_t3_i1 6 YES xabasicdb@atmol10:sitaramv.xads_t2_i1 4 YES xabasicdb@atmol10:sitaramv.xads_t1_i3 3 YES xabasicdb@atmol10:sitaramv.xads_t1_i2 2 YES xabasicdb@atmol10:sitaramv.xads_t1_i1 1 YES xabasicdb@atmol10:sitaramv.xads_t2_i2 5 NO DRDA client info Userid: Wrkstnname: nemea Applname: db2jcc_application Acctng: JCC03510nemea Programid: Autocommit: Packagepath:
显示在您的会话中使用的客户端程序的完整路径。使用客户端程序信息来监视或停止访问数据库。
尽管该部分没有标题,但是以下输出显示有关线程的信息。
位置 1
位置 2
位置 3
位置 4
位置 5
位置 6
位置 7
每个会话池重复这些信息。
显示特定会话的 SQL 信息。该部分具有和 onstat -g sql 命令相同的信息。请参阅 onstat -g sql 命令:打印与 SQL 有关的会话信息。
Last parsed SQL statement 部分具有和 onstat -g sql 命令相同的信息。请参阅 onstat -g sql 命令:打印与 SQL 有关的会话信息。