Tip: Comparing Trace Files

Tip: Comparing Trace Files



Trace files can give a lot of nice troubleshooting information, sometimes too much.  Sometimes, you may have a situation where a problem occurs in one system but not in another.  You could run a trace in both systems, but comparing those trace files is difficult.  Each line has a timestamp, which will be different in each file.

Here is a trick for getting rid of those timestamps.  Here is the source:

sed : Remove first 4 letters in each line

Of course, you need Linux, Unix, or Cygwin for this — something with the sed program.  Here is the command:

sed 's/^.\{51\}//g' "mytrace.tracesql" > modtrace.tracesql

For example, here are the first few lines of a trace file:

PSAPPSRV.248 (181) 	 1-1      10.24.26             Cur#1.248.FSDEV90 RC=0 Dur=0.001000 COM Stmt=SELECT VERSION FROM PSVERSION WHERE OBJECTTYPENAME = 'SYS'
PSAPPSRV.248 (181) 	 1-2      10.24.26    0.003000 Cur#1.248.FSDEV90 RC=0 Dur=0.001000 COM Stmt=SELECT PORTAL_NAME, PORTAL_REFTYPE, PORTAL_OBJNAME FROM PSPRSMDEFN WHERE VERSION > :1 UNION SELECT PORTAL_NAME, PORTAL_REFTYPE, PORTAL_OBJNAME FROM PSPRSMDEL WHERE VERSION > :2
PSAPPSRV.248 (181) 	 1-3      10.24.26    0.000000 Cur#1.248.FSDEV90 RC=0 Dur=0.000000 Bind-1 type=8 length=4 value=214748355

After running the command, here is what it looks like:

Cur#1.248.FSDEV90 RC=0 Dur=0.001000 COM Stmt=SELECT VERSION FROM PSVERSION WHERE OBJECTTYPENAME = 'SYS'
Cur#1.248.FSDEV90 RC=0 Dur=0.001000 COM Stmt=SELECT PORTAL_NAME, PORTAL_REFTYPE, PORTAL_OBJNAME FROM PSPRSMDEFN WHERE VERSION > :1 UNION SELECT PORTAL_NAME, PORTAL_REFTYPE, PORTAL_OBJNAME FROM PSPRSMDEL WHERE VERSION > :2
Cur#1.248.FSDEV90 RC=0 Dur=0.000000 Bind-1 type=8 length=4 value=214748355

Now, you can use a tool like Beyond Compare or Meld to compare the trace files without the timestamp.  If you don’t have a compare tool, look here.

skp@pecan: ~-Downloads_857



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值