Offender是Trafodion数据库用于查看运行时执行Sql语句的工具。
以下介绍操作示例及详细用法。
首先登陆数据库安装服务器,切换到trafodion用户并且切换到工具所在目录:
# su - trafodion
$ cdw
$ cd export/limited-support-tools/LSO/
然后执行offender语句,最常用的offender命令如下:
$ ./offender -s active
输出结果示例:
[trafodion@esgzb-del-n005 LSO]$ ./offender -s active
EsgynDB Advanced Conversational Interface 2.4.1
Copyright (c) 2015-2018 Esgyn Corporation
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+>+>+>+>+>+>+>+>+>+>+>+>+>
CURRENT_TIMESTAMP LAST_ACTIVITY_SECS QUERY_ID EXECUTE_STATE SOURCE_TEXT
-------------------------- -------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2018-07-17 21:55:26.717561 -2 MXID11000000585212398595685787020000000000206U3333308T150000000_25___SQLCI_DML_LAST__ DEALLOCATED "select count(*) from CQGPRS20180612;
--- 1 row(s) selected.
>>
End of MXCI Session
详细用法如下:
[trafodion@esgzb-del-n005 LSO]$ ./offender -h
This script runs a Lightweight SQL Offender script
syntax: -s|--script <script-name> [-t|--time <time>] [-n|--node <node>]
[-m|--memsize]
[-h|--help]
Either the short form (-x) or long form (--name) of the parameters can be
used
-s|--script Manditory. <script-name> must be one of:
cpu_offender
mem_offender
wm_mem_offender
active
se_blocked
se_offender
inactive
in_sql
in_client
dead
unmonitored
in_compile
-t|--time Optional Default 30
values: 0 < <time> < 32768
Time span (in seconds) to search for matching offenders.
Applies to scripts: dead,inactive,in_sql,in_client,unmonitored,in_compile
-m|--memsize Optional Default 250
Processes exceeding the given memory threshold in MB
Applies to mem_offender and wm_mem_offender
-n|--node Optional Default ALL NODES
values: -1 < <node> < 2048
Restricts the query to the given SQL node number
-h|--help Display this text and exit