Pruning old launch history entries


Back in 2009, we added launch history logging to SCORM Engine. At first it was merely an useful tool for troubleshooting user issues, but more recently, having information about package launch and exit times available at runtime enables Engine to detect concurrent launches of the same course by the same user, or when data is received from a course that has already exited. By detecting these events, Engine can stop bad data from overwriting good in our customers' databases.

However, this protection comes at a cost: the ScormLaunchHistory table, where Engine records information about each launch, can easily grow quite large. We are frequently asked if anything can be done to reduce the amount of space used by ScormLaunchHistory. A previous article recommended disabling launch history logging, and removing all data from the ScormLaunchHistory table, stating that "this data is not used at runtime." That is no longer the case, so a little more consideration is required before deciding to disable launch history logging, and more care should be taken when removing existing launch history data. If you disable launch history logging, you will lose the protection that it provides. It is safe to remove old rows from the ScormLaunchHistoryTable, but you'll need to make sure that the rows are old enough that they don't include any legitimately unexited launches.

If you are using Engine version 2013.2.0.333 or newer, then you can use a built-in feature that automatically removes old launch history entries by adding a couple of settings to your configuration file. In you are using the .NET version of Engine, then you can add the following lines to SCORMEngineSettings.config:

<add key="ShouldExpireLaunchHistory" value="True" />
<add key="ExpireLaunchHistoryAfterDays" value="30" />

For the Java version of Engine, add the following lines to

<entry key="ShouldExpireLaunchHistory">True</entry>
<entry key="ExpireLaunchHistoryAfterDays">30</entry>

You can adjust the value of ExpireLaunchHistoryAfterDays if you'd like, but it should be longer than a launched course could reasonably be left open. In most cases, the default of 30 days should be fine.

If you are using an older version of Engine, and don't care to upgrade, then you can manually remove old launch history entries by running a query like the following, where @cuttoffdate is the date before which entries should be removed:

DELETE FROM ScormLaunchHistory WHERE NOT update_dt IS NULL AND update_dt < @cutoffdate;

As with the ExpireLaunchHistoryAfterDays setting, be careful not to use too recent of a cut-off date.

In addition to removing old launch history entries, you can also disable logging of runtime API communications, which constitute the majority of the space used by ScormLaunchHistory. Engine will still be able to detect concurrent launches and postbacks from exited launches, but you will lose potentially useful troubleshooting information. To disable logging of runtime API communications, override the DefaultCaptureHistoryDetailed method in your integration class:

public override YesNo DefaultCaptureHistoryDetailed(LearningStandard learningStandard, bool singleSco, ExternalConfiguration externalConfig)
    return new YesNo(YesNoValue.NO);
Was this article helpful?
2 out of 2 found this helpful
Have more questions? Submit a request


Powered by Zendesk