Hi,
I am looking for a livereport which gives me the size occupied by documents in recycle bin. Database I want to run in is SQL .
Thanks,
Atiya
I would suggest you will also need to calculate the size of versions as well (as looking up document size will only confirm the latest version size).
I have tried the below, but it gives error "GROUP BY, HAVING, or aggregate functions are not allowed in the recursive part of a recursive common table expression 'subtree'". Can you please advise what is wrong here? I don't have access to SQL query analyzer so need to get it right before asking someone to run it for me.
With subtree (dataid, datasize) as (select dt.dataid, dv.datasize from dtree dt (nolock), dversdata dv (nolock) where dt.dataid=dv.docid and dt.dataid=xxxx union all select s.dataid, sum(s.datasize/1024/1024) from dtree p (nolock), dversdata dp(nolock), subtree s (nolock) where s.dataid=p.dataid and s.dataid=dp.docid group by s.dataid) select dataid, sum(datasize/1024/1024) from subtree (nolock)
The DTREE.ownerid = -4614 represents entries in the RecycleBin. You'll have to check that, as well.
This is in Oracle SQL:
select round((sum(dv.datasize)/1048576), 2) "RecycleBin" from livelink.dtree dt join livelink.dversdata dv on dt.dataid = dv.docid where dt.ownerid = -4614 and dt.subtype <> 0
It starts with DTREE checking the OWNERID and SUBTYPE not a Folder and then extracts all DVERSDATA based on the DTREE.dataid = DVERSDATA.docid relationship and rounds the results to 2 decimal places(obviously optional). I don't need a "group by".
Thanks Colin and Lindsay for your response. It did help me easily get the size of the deleted data. Thanks much for that.
Can you or anyone please help me with below queries as well? The first one gets me the size of deleted documents in recycle bin. The second one gives me size of deleted documents from each external file store. But when I add the size output from each EFS in query 2, it doesn't equal to the size in query 1. Not sure what is going wrong here.
1) select (sum(convert(bigint,dv.datasize))/1024/1024/1024) as 'Size of RB in GB', pd.providertype from DTree dt (nolock), DVersdata dv (nolock), ProviderData pd (nolock) where dv.docid=pd.providerid and dt.dataid=pd.providerid and dt.ownerid = -xxxx and dt.subtype = 144 group by dp.providertype
2) select (sum(convert(bigint,dv.datasize))/1024/1024/1024) as 'Size of RB in GB' from DTree dt (nolock) join DVersdata dv (nolock) on dt.dataid = dv.docid where dt.ownerid = -xxxx and dt.subtype = 144
Appreciate your help.
Hi Lindsay,
I know that was too mismatching. Thanks for pointing that out. Its working fine now.
Thanks for your help,