Event banner
SharePoint Server Subscription Edition AMA
Event Ended
Tuesday, May 10, 2022, 08:00 AM PDTEvent details
We are very excited to announce a SharePoint Server Subscription Edition AMA!
An AMA is a live text-based online event similar to a “YamJam” on Yammer or an “Ask Me Anything” on Reddit. This AM...
EmilyPerina
Updated May 10, 2022
Steve Zhang
Microsoft
May 10, 2022Hi Brice,
Sorry I am not quite following the question. Could you please tell more about what the bug is?
Thanks
Steve
bwernet
May 10, 2022Copper Contributor
In our Sharepoint 2019 setup, despite files being deleted from both recycle bins in sharepoint, space is not freed in our databases.
We discovered that there is another level of recycle bin in the database, and that the stored procedure that should delete thoses items can't execute: one date in the procedure is set to 31-12-9999, which is not interpreted as a date value. Other default dates in other stored procedures are set to 01-01-9999 which works for any language.
So we "patch" sharepoint 2019 by changing this date in every database created by sharepoint...
- Steve ZhangMay 11, 2022
Microsoft
Hi Brice, Coud you please help to tell which store procedure includes this invalid date? Thanks Steve- bwernetMay 11, 2022Copper Contributor
The proble lies in the stored procedure "[dbo].[proc_CleanupThirdStageRecycleBinItem]":
IF (@MaxRunTimeInSeconds IS NULL OR @MaxRunTimeInSeconds <= 0) SET @EndTime = '9999-12-31' ELSE SET @EndTime = DATEADD(second, @MaxRunTimeInSeconds, GETUTCDATE())
We replace SET @EndTime = '9999-12-31' by SET @EndTime = '9999-01-01' and voilà!
Remark: it seems the default "max time" used in other procedure is '9999-01-01'
- Steve ZhangMay 24, 2022
Microsoft
Hi Brice,
After checking with engineer, directly running stored procedure is not supported. The best option is timer job. You can clean up recyclebin by using below timerjob.
$db = Get-SPContentDatabase Your-DB-Name
$j = Get-SPTimerJob -Identity "job-recycle-bin-cleanup" -WebApplication $db.WebApplication
$j.Execute($db.Id)Thanks
Steve