价格更改跟踪功能的批处理作业问题

本文提供了Microsoft Dynamics 365 Commerce 中价格更改跟踪批处理作业的常见问题的解决方法。

症状

Microsoft Dynamics 365 商业 版价格更改跟踪 功能触发在后台运行的批处理作业。 下面是批处理作业的常见问题:

  • 价格更改跟踪批处理作业需要很长时间。
  • 触发了过多的价格更改跟踪批处理作业并在队列中等待。

决议

若要解决问题,请执行以下步骤:

步骤 1:停止创建更多批处理作业

若要停止创建更多批处理作业,请执行以下步骤:

  1. 在商务总部,转到>
  2. 在“价格更改跟踪”下,从网格中删除所有法律实体,然后选择“保存”。
  3. 重启应用程序对象服务器(AOS)。

通常,Microsoft建议在 启用价格更改跟踪功能之前为价格更改跟踪批处理作业 指定批处理组。 此操作将价格更改跟踪批处理作业的影响限制为 AOS 实例,而不是阻止默认批处理作业池。

步骤 2:停止和清除现有批处理作业

若要停止和清除现有批处理作业,请在 Commerce 总部数据库中运行以下 SQL 脚本。

-- find the existing executing jobs
select count(*) from BATCH where CAPTION like '%Price change%' and status = 2 --executing
select count(*) from BATCHJOB where CAPTION like '%Price change%' and status = 2 --executing

-- update the job status (DO NOT update to 0-Hold status; when the batch service restarts, they will be picked up again.) 
update BATCH set STATUS = 3 where CAPTION like '%Price change%' and STATUS = 2 --set to error
Update BATCHJOB set STATUS = 3 where CAPTION like '%Price change%' and STATUS = 2 --set to error

-- clear the jobs
delete from BATCH where CAPTION like '%Price change%' and status = 3 --error
delete from BATCHJOB where CAPTION like '%Price change%' and status = 3 --error