The lock12_5 table is one the Task Persistence tables in the IDM object store. It's used to lock events in progress while the environment is up and running but it does not automatically delete its table entries after events are updated, therefore the table can grow to host millions of rows and cause system slowness or database session locking or other DB errors.
While lock12_5 table does get cleaned up by the cleanup stored procedures or by the Cleanup Submitted Tasks task, however, it is common to see leftovers in this table even when cleanup is regularly scheduled on your environment. As best practice, the table should be cleaned up regularly by your DBA and should be purged if you are seeing any DB errors, contention, or locked sessions against task12_5.
The lock12_5 table should be purged only while the environment is not running so as not to delete active locks. As long as the environment is not running, there is no possibility of transaction loss or data integrity issues when all rows are deleted.
To cleanup the lock12_5 table:
1. Stop the Identity Manager user environment.
In the IDM Management Console select the environment then click stop.
2. On the task persistence database, kill any locks or active sessions to the lock12_5 table, if any exist.
3. Delete all rows from lock12_5 table.
4. In the IDM Management Console select the environment and click to start the environment.