My virtual machine disk space is starting to get a bit low. Rather than just adding more disk I want to do some housekeeping and one of the things I would like to do is delete a lot of test event frames that I have going back several years. My idea was to delete these event frames, then use the SQL Server database shrink tool to reclaim the unused space. I was going to just use SQL Commander and do a query to delete the old event frames - but that doesn't seem to be a statement that is supported with OLEDB Enterprise. I had not noticed this before but it seems to be something that should be supported. So I just used PSE to do the same thing rather than writing an App.
So my question is whether the SQL Server shrink function can be used while the PI System is running or is there a better way to recover disk space used by PIFD.
Hi Simon
You can use AFDiag commandline in %pihome64%\AF for your requirement. Since your PI AF is deployed on SQL Server would request you to follow below process.
Step 1 : Delete event frames which are no longer required (AFDiag if you want to delete using end date)
Step 2: Shrink database using /DBCC shrinkdabase command
Step 3: Reindex PI AF database (AFDiag)
You can use AFDiag -? to list all options.
options :
/DeleteEventFrames:<DateTime string>
Delete EventFrames from the PI AF Database with an end time
before the date specified in local time (for example /DelEF:"2017-01-31 23:00:00"). (short form /DelEF)
/Reindex Completely rebuild every index in the PI AF database. This
is useful after a massive data insertion to substantially
improve performance. (short form /RI)