How to reduce K2_log_1.ldf size?

  • 6 March 2021
  • 2 replies
  • 76 views

Hi,

 

K2_log_1.ldf file size has already reached 233GB

11825i93B038F947E5C268.png

 

Please advise how to reduce this. 

I’ve tried to shrink the database log using the method shown in the pic below but still, the size the massive.

15119i931BDA7B3CFF73D0.png

 

 


2 replies

Userlevel 5
Badge +13

One option is to archive old K2 data off into a backup database. K2 stores a lot of data about your workflow processes that it retains even after the workflow finishes. That data is probably not valuable after a certain amount of time (depends on your reporting requirements) so it makes sense to regularly archive it. Depending on what version of K2 you are running there are different approaches for archiving. K2 4.7 and below has the archive function available in the K2 workspace. K2 5 and above requires a script.

Additionally, check if your workflows are retaining large pieces of data in data fields. File data in particular… at the end of your workflow, clear out those values via “Transfer Data” events to prevent K2 from retaining them. Hope this helps!

Userlevel 3
Badge +10

It is likely that your database is using the default full recovery mode, in which case regular transaction log backups and database shrinks are usually needed to maintain the ldf file size.


 


https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/transaction-log-backups-sql-server?view=sql-server-ver15


 


You can try using SQL's maintenance plan wizard to schedule regular transaction logs backups and shrinks:


https://logicalread.com/automated-ops-sql-server-maintenance-plans-mo01/#.YGyJ8OhKhGM


https://www.mssqltips.com/sqlservertip/6099/getting-started-with-sql-server-maintenance-plans--part-1/

Reply