The Runtime writes session information to the "log database". This article shows how to purge sessions from this database.
The purge described in this article will delete rows from the Runtime's session tables. Please note that some RDBMS systems need DBA operations in order to free the physical storage of tables and indexes (defragmentation, move, shrink, rebuild...).
Manual purge from the Sessions view
The purge can be executed manually directly from the Designer. The purge will be executed on the Runtime to which the Designer is connected.
Click on the "Delete until" button and you will prompted for a date. The purge will delete all sessions until the specified date/time.
You can also click on the "Delete all" button, which will delete ALL the sessions from the log database.
Using the "purge" command
Another way of purging is to execute the purge command.
This can be done from the Command tab in the Runtime editor (available in Analytics and in the Designer) :
A few examples for this command :
- purge keep 100 session: deletes all sessions except the last 100 sessions
- purge keep 50 session status killed: deletes all sessions with status "killed" except the last 50 killed sessions. The sessions with other status are left.
- purge keep 10 day: deletes all sessions older than 10 days.
- purge keep 3 session sessionname MONTHLY%: deletes all sessions whose name starts with "MONTHLY" except the 3 latest sessions.
You can also execute this command from your OS command line, using the startcommand utility :
> startcommand.bat "connect to localhost port 42000;purge keep 5 day"
Please note that when you execute a purge command on a runtime that uses a log database that is shared with other runtimes, it will affect all the sessions that are stored in the database (not only those that were written by the runtime that is executing the purge command).
Scheduling a purge in the Runtime Scheduler
The scheduler can purge the session logs automatically. To do this, select the "Purge" tab in the Runtime editor (available in Analytics and in the Designer) :
For more information on the sheduler and Cron examples, please read the Stambia Designer help.
Consulting purge log file
The log file "com.indy.engine.42000.rdbmsLog.log" contains information related to the log database.
When the purge is executed, you can consult this file to find out how many sessions were purged. Here is an example:
15/02/2019 14:35:25,229 INFO - Purging log database sessions...
15/02/2019 14:35:25,229 INFO - Delete until 2019/02/14 14:35:25.229: start
15/02/2019 14:35:25,251 INFO - Delete until 2019/02/14 14:35:25.229: Deleted 121 sessions
15/02/2019 14:35:25,251 INFO - Delete until 2019/02/14 14:35:25.229: Total of deleted sessions: 121
15/02/2019 14:35:25,251 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist Action
15/02/2019 14:35:25,467 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist ChildSession
15/02/2019 14:35:25,467 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist Delivery
15/02/2019 14:35:25,652 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist UAL
15/02/2019 14:35:25,652 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist Action Static
15/02/2019 14:35:25,746 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist Property Static
15/02/2019 14:35:26,069 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist Action Statistic
15/02/2019 14:35:26,100 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist Process Statistic
15/02/2019 14:35:26,115 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist Session Statistic
15/02/2019 14:35:26,131 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist AltId
15/02/2019 14:35:26,184 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist Link
15/02/2019 14:35:26,285 INFO - Delete until 2019/02/14 14:35:25.229: Delete Unexist Property
15/02/2019 14:35:26,532 INFO - Delete until 2019/02/14 14:35:25.229: End