another technical blog...technically

Monday, June 11, 2018

BluePrism: drill down about housekeeping BP DB

As you already know, it's so easy to finish space on a DB server when you use BP.
The reason could be, a poor design of logging (e.g log everything) or maybe logging in a loop.
It's clear that you don't need to log everything, but only what you have effectively to justify if you make a mess and also log errors for sure.
Now you are thinking: what the hell I've done? Why i was so stupid to log everything?

Well, you are in good company, I did the same. But now it's time to fix everything.
Now you are thinking that you can use Archiving feature to store the session log somewhere but what if archiving doesn't work, or mabe you just want to erase the unneeded data.

Always remember that delete a lot of data does not mean only wasting a lot of time, but also to see the transaction log growing a lot, so try this only when you are sure you can backup the DB.
It's clear that there is always the risk of corrupting the DB when you do something at the core level of a product.

So let's begins, the first thing you can do it's to delete the content in BPAScheduleLog and BPAScheduleLogEntry. The scheduler log grows perpetually so could be a good idea to trucate BPAScheduleLogEntry and delete BPAScheduleLog, this is what BP says, they also provide you a script to delete all data in a particular time frame, but this is another story.

The other massively filled table is BPASessionLog_NonUnicode, and here BP propose a script which helps you delete all entries, but in our case we want to selectively delete only the log entry we need (maybe log about a specific Business Object or Process Page).

BP said it could work so, before applying on a real DB, let's test it up.
Let's create the base case, so I created 2 processes:
  • Test.Log1
    • Page1: calls Test.VBO.Log1 actions
    • Page2: calls Test.VBO.Log2 actions
  • Test.Log2
    • Page1: calls Test.VBO.Log1 actions
    • Page2: calls Test.VBO.Log2 actions
and 2 VBOs
  • Test.VBO.Log1
    • Action1: returns 2+2
    • Action2: returns 2*2
  • Test.VBO.Log2
    • Action1: returns 2-2
    • Action2: returns 2/2
Log is enabled everywhere, and i made every process run 2 times on the same machine.


 Here i entered in the DB and i discovered with this simple query what combination of:
  • Process name
  • Process page name
  • VBO 
  • VBO action
is logged the most
SELECT processname,pagename,objectname,actionname,count(*) as num
FROM [BluePrism].[dbo].[BPASessionLog_NonUnicode]
group by processname,pagename,objectname,actionname order by num desc
And here... only the brave... what happens if i selectively delete rows here?
The answer is: absolutely nothing, i posted some screenshot below indeed that makes you understand the only pitfall i noticed on my local Blue Prism installation.
So, have fun cleaning your DB from unnecessary rows.
See ya.
written in: Milano MI, Italia

3 comments:

  1. Hi,

    How can i get values of Timetable :- Today&Tomorrow of schedules in BP Databse There are no specific table for these

    ReplyDelete
  2. Hi I want to pull the log of each workqueue item.
    select * from dbo.BPAWorkQueuelog is returning empty.

    and I do not see any reference to itemID in any column of BPASessionLog_NonUnicode to pull item wise log.

    Please suggest

    ReplyDelete

Because of a lot of SPAM about courses, I need to moderate all comments here.
I ensure you that I will answer whenever possible (if you are not a spammer).

Me, myself and I

My Photo
I'm just another IT guy sharing his knowledge with all of you out there.
Wanna know more?