我的 ERP 系统有一个半生不熟的删除跟踪系统,它将以下信息插入一个名为 M2MDeleteLog 的表中。为简单起见,我省略了诸如 RecordId 之类的不必要的列。
LogDate Workstation LogInfo
1/7/2010 11:01:51 TECH-M2MTEST Deleting 1 Rows From SOMast
1/7/2010 11:01:51 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SOMAST from form frmSo Parameters: NONE
1/7/2010 11:01:51 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SODBOM from form frmSo Parameters: NONE
1/7/2010 11:01:51 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SODBOM from form frmSo Parameters: NONE
1/7/2010 11:01:51 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SORELS from form frmSo Parameters: NONE
1/7/2010 11:01:51 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SORELS from form frmSo Parameters: NONE
1/7/2010 11:01:51 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SOITEM from form frmSo Parameters: NONE
1/7/2010 11:01:51 TECH-M2MTEST Deleting 1 Rows From SOItem
1/7/2010 11:01:51 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SOITEM from form frmSo Parameters: NONE
1/7/2010 11:01:51 TECH-M2MTEST Deleting 1 Rows From SOItem
1/7/2010 11:01:00 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SOMAST from form frmSo Parameters: NONE
1/7/2010 11:01:00 TECH-M2MTEST Deleting 1 Rows From SOMast
1/7/2010 11:01:00 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SODBOM from form frmSo Parameters: NONE
1/7/2010 11:01:00 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SODBOM from form frmSo Parameters: NONE
1/7/2010 11:01:00 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SORELS from form frmSo Parameters: NONE
1/7/2010 11:01:00 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SORELS from form frmSo Parameters: NONE
1/7/2010 11:01:00 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SOITEM from form frmSo Parameters: NONE
1/7/2010 11:01:00 TECH-M2MTEST Deleting 1 Rows From SOItem
1/7/2010 11:01:00 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SOITEM from form frmSo Parameters: NONE
1/7/2010 11:01:00 TECH-M2MTEST Deleting 1 Rows From SOItem
1/7/2010 11:00:29 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SOMAST from form frmSo Parameters: NONE
1/7/2010 11:00:29 TECH-M2MTEST Deleting 1 Rows From SOMast
1/7/2010 11:00:28 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SODBOM from form frmSo Parameters: NONE
1/7/2010 11:00:28 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SODBOM from form frmSo Parameters: NONE
1/7/2010 11:00:28 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SORELS from form frmSo Parameters: NONE
1/7/2010 11:00:28 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SORELS from form frmSo Parameters: NONE
1/7/2010 11:00:28 TECH-M2MTEST Deleting 1 Rows From SOItem
1/7/2010 11:00:28 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SOITEM from form frmSo Parameters: NONE
1/7/2010 11:00:28 TECH-M2MTEST Unqualified M2MDELETE by D.STEIN in SOITEM from form frmSo Parameters: NONE
1/7/2010 11:00:28 TECH-M2MTEST Deleting 1 Rows From SOItem
不幸的是,大部分相关信息都在 1 个文本字段中。第一步是从 LogInfo 字段中提取用户 (D.STEIN)、屏幕 (SOMAST) 和屏幕 (frmso)。那部分相对容易。
我想要做的是创建一个计划作业,它每 15 分钟左右运行一次,以查找可疑活动。我将可疑活动定义为每个用户每隔 15 分钟删除 3 次。
可是等等!还有更多!
在我提供的数据中,只有 3 个删除事件,每个间隔不到一分钟。我将定义一个新的删除事件至少在最后一个删除事件之后 20 秒。
如何评估 LogDate,回溯 15 分钟,计算每个用户的删除事件,以便在为某个用户记录超过 3 个时通知管理员?