- 论坛徽章:
- 0
|
&&&&HP-UX11i,SYBASE12.5,应用软件综合故障解决案例!&&&&
环境:
HPrp7400+VA7100,HP-UX11i,SYBASE12.5,Weblogic6,地税市局大集中税务软件
故障现象:
sybase进程占用CPU资源过高,用top命令看都为90%以上:
故障解决过程:
一、小型机
1、作系统备份
2、常规系统检查,也无报错信息。
3、写脚本来长期作系统CPU利用率的监控
$ crontab -l
57 * * * * /tmp/hpsysmon/hpsysmon.sh
$more /tmp/hpsysmon/hpsysmon.sh
#/bin/sh
LD_LIBRARY_PATH=/sybase/ASE-12_5/lib:/usr/local/openwin/lib:/sybase/FTS-12_5/lib:/sybase/OCS-12_5/lib:/usr/local/openwin/lib:/usr/lib:/sybase/SQLRemote/lib LD_LIBRARY_PATH
export LD_LIBRARY_PATH
prex=`date "+%m%d_%H%M"`
UNIX95= ps -e -o "pid,pcpu,vsz,args"|sort -rn>;>;/tmp/hpsysmon/hpsysmon$prex.log
监控发现在8:00-18:00 sybase进程占用CPU高,而在其余时间占用不多。同时java进程点用CPU资源也相对偏高了一点。
4、对JAVA资源的占用进行优化。
从网上下载补丁PHSS_28955,打上这个补丁(打这个补丁的时候要准备报错,所以根据报错来进行安装选项调整)。
CommandView SDM v1.0是管理VA的软件,它是用JAVA写的。他在作performance信息收集的时候占用的资源会瞬间很高。
所以vi /etc/opt/sanmgr/commandview/server/config/PanConfigParams.txt
加入:
PERFORMANCE_LOG_CLEAN=24 (每24小时截取一次)
PERFORMANCE_KEEP_MIN_LOGS=60 (保留60天的日志文件)
PERFORMANCE_DB_MAX_SIZE= 200 (日志最大为200MB)
然后:
# /opt/sanmgr/commandview/server/sbin/HA_Dial_Stop
# /opt/sanmgr/commandview/server/sbin/HA_Dial_Start
或者重启小机
5、故障依然,只是JAVA进程占用资源少了些。
二、数据库SYBASE12.5
1、报错信息检查,无报错。
2、监控进程连接情况
spid cpu enginenum status program_name loggedindatetime ipaddr
----------- ----------- ----------- ------ ------------ ---------------- ------
2 0 0 sleeping Jan 3 2005 7:28PM NULL
3 0 0 sleeping Jan 3 2005 7:28PM NULL
4 0 0 sleeping Jan 3 2005 7:28PM NULL
5 0 0 sleeping <astc>; Jan 3 2005 7:28PM NULL
6 0 0 sleeping Jan 3 2005 7:28PM NULL
7 0 0 sleeping Jan 3 2005 7:28PM NULL
8 0 1 runnable Jan 3 2005 7:28PM NULL
9 0 0 sleeping Jan 3 2005 7:28PM NULL
147 0 1 sleeping Jan 3 2005 7:28PM NULL
25 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
43 0 1 recv sleep TS Studio Jan 5 2005 2:56PM 156.32.30.66
45 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
46 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
50 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
54 0 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
60 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
98 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
100 0 1 recv sleep TS Studio Jan 5 2005 2:21PM 156.32.30.66
104 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
107 0 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
133 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
141 0 0 running SQL_Advantage Jan 5 2005 2:52PM 156.32.17.167
144 0 0 recv sleep TS Studio Jan 5 2005 2:44PM 156.32.31.52
162 0 1 recv sleep TS Studio Jan 5 2005 2:39PM 156.32.31.20
166 0 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
181 0 0 recv sleep isql Jan 5 2005 2:45PM 156.32.16.8
186 0 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
194 0 0 recv sleep isql Jan 5 2005 1:19PM 156.32.16.8
195 0 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
198 0 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
202 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
230 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
254 0 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
264 0 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
274 0 1 recv sleep isql Jan 5 2005 2:48PM 156.32.16.8
36 1 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
77 1 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
153 1 1 recv sleep TS Studio Jan 5 2005 2:44PM 156.32.31.52
167 1 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
242 1 0 recv sleep TS Studio Jan 5 2005 2:54PM 156.32.23.58
88 2 0 recv sleep TS Studio Jan 5 2005 2:47PM 156.32.22.50
206 2 1 recv sleep TS Studio Jan 5 2005 2:25PM 156.32.21.79
126 3 1 recv sleep TS Studio Jan 5 2005 2:33PM 156.32.18.69
76 4 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
80 4 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
119 4 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
222 4 0 recv sleep TS Studio Jan 5 2005 2:51PM 156.32.27.66
113 5 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
234 5 1 recv sleep TS Studio Jan 5 2005 2:54PM 156.32.23.56
261 5 1 recv sleep TS Studio Jan 5 2005 2:46PM 156.32.26.51
277 5 1 recv sleep TS Studio Jan 5 2005 2:06PM 156.32.26.52
260 6 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
282 7 1 recv sleep TS Studio Jan 5 2005 2:49PM 156.32.23.22
163 8 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
200 8 0 recv sleep Jan 5 2005 12:32PM 156.32.16.12
52 9 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
73 9 1 recv sleep Jan 5 2005 12:32PM 156.32.16.12
249 9 1 recv sleep TS Studio Jan 5 2005 2:08PM 156.32.30.112
267 9 1 recv sleep TS Studio Jan 5 2005 2:48PM 156.32.29.46
290 9 1 recv sleep TS Studio Jan 5 2005 2:50PM 156.32.27.58
87 11 1 recv sleep TS Studio Jan 5 2005 1:38PM 156.32.30.64
83 20 1 recv sleep TS Studio Jan 5 2005 2:19PM 156.32.31.51
53 24 1 recv sleep TS Studio Jan 5 2005 2:12PM 156.32.30.111
65 28 1 recv sleep TS Studio Jan 5 2005 1:44PM 156.32.30.63
265 32 0 recv sleep TS Studio Jan 5 2005 2:22PM 156.32.22.51
286 36 1 recv sleep TS Studio Jan 5 2005 2:23PM 156.32.24.41
204 47 1 recv sleep TS Studio Jan 5 2005 2:11PM 156.32.30.65
238 49 0 recv sleep TS Studio Jan 5 2005 1:25PM 156.32.29.43
219 96 1 recv sleep TS Studio Jan 5 2005 2:23PM 156.32.21.76
123 140 0 recv sleep TS Studio Jan 5 2005 2:34PM 156.32.31.50
56 157 0 recv sleep TS Studio Jan 5 2005 2:14PM 156.32.21.80
255 205 0 recv sleep TS Studio Jan 5 2005 1:51PM 156.32.21.77
241 315 1 recv sleep TS Studio Jan 5 2005 8:09AM 156.32.18.136
Note:
(1)spid= 56,The SQL Text:
SELECT MONTH_DAY FROM TSR91_DECLARE_DATE_DESC WHERE '0701' LIKE rtrim
( TTYPE_CODE ) AND '070109' LIKE rtrim ( TTERM_CODE ) AND '079002' LIKE rtrim (
TITEM_CODE ) AND NTH =1
(2)spid= 123,The SQL Text:
SELECT TSC09_ODD_CODE.TBL_NAME,
TSC09_ODD_CODE.COL_NAME,
TSC09_ODD_CODE.CODE,
TSC09_ODD_CODE.NAME
FROM TSC09_ODD_CODE
WHERE TSC09_ODD_CODE.TBL_NAME = 'TSV_TSM01_TSM02'
(3)spid= 241,The SQL Text:
SELECT count ( TPAYER_ID ) FROM tsv_tss14_tss15 WHERE tpayer_id
='261050104060407088106' and TAXA_SDATE <= '200412-01' and TAXA_EDATE >;=
'200412-01'
3、通过crontab 每个小时作一次10分钟的sysmon
$ crontab -l
0 * * * * nohup /sybase/sybase_ts/sysmon.sh &
@@more sysmon.sh@@
#/bin/sh
SYBASE=/sybase
export SYBASE
SYBASE_FTS=FTS-12_5
export SYBASE_FTS
PATH=/sybase/ASE-12_5/bin:/sybase/OCS-12_5/bin PATH
export PATH
SYBASE_OCS=OCS-12_5
export SYBASE_OCS
SYBASE_ASE=ASE-12_5
export SYBASE_ASE
LM_LICENSE_FILE=/sybase/SYSAM-1_0/licenses/license.dat LM_LICENSE_FILE
export LM_LICENSE_FILE
LD_LIBRARY_PATH=/sybase/ASE-12_5/lib:/usr/local/openwin/lib:/sybase/FTS-12_5/lib:/sybase/OCS-12_5/lib:/usr/local/openwin/lib:/usr/lib:/sybase/SQLRemote/lib LD_LIBRARY_PATH
export LD_LIBRARY_PATH
SYBASE_SYSAM=SYSAM-1_0
export SYBASE_SYSAM
prex=`date "+%m%d_%H%M"`
$SYBASE/$SYBASE_OCS/bin/isql -Usa -Stsstudio >;>;/sybase/sybase_ts/sysmon$prex.out <<!
*******
use master
go
sp_sysmon "00:10:00"
go
!
4、将用户数据库的索引统计信息更新
5、通过监控情况分析,可以确定ASE 数据库工作正常,但是发展有好几个SQL语句好像是非常占用资源.
三、应用软件的修改
1、 最后软件人员对应用软件的一些SQL语句进行了人优化、调整了数据库里的几个索引和修改数据库的相应的查询方面的参数。
2、 sybase进程占用CPU的资源下来了,问题解决了!! |
|