11-15-2017 07:30 AM
Hi,
Does anyone happen to have a SQL query to collect the total number of items on legal hold and total size?
Per EV database is fine.
Regards,
Jaime
11-15-2017 11:58 PM
Hello Jaime,
I can't get you an exact query, but I can get you some pointers:
https://www.veritas.com/support/en_US/article.100021469.html
https://www.veritas.com/support/en_US/article.100034248.html
https://www.veritas.com/support/en_US/article.100019406.html
You might be able to use these to add the size somehow.
11-16-2017 06:31 AM
How's this?
Simple:
--Returns number of items on legal hold and total size of items on legal hold in current Vault Store DB
SELECT COUNT(DISTINCT hs.SavesetIdentity) AS 'Number of held items', SUM(s.ItemSize) AS 'Size of held items (KB)' FROM HoldSaveset AS hs JOIN Saveset AS s ON s.SavesetIdentity = hs.SavesetIdentity
More detailed:
--Returns number of items on legal hold and total size of items on legal hold in current Vault Store DB,
--broken down by container for further detail
SELECT ISNULL(av.ArchiveName,'Total for VS') AS 'Container',
COUNT(DISTINCT hs.SavesetIdentity) AS 'Number of held items',
SUM(s.ItemSize) AS 'Size of held items (KB)'
FROM HoldSaveset AS hs
JOIN Saveset AS s ON s.SavesetIdentity = hs.SavesetIdentity
JOIN ArchivePoint AS ap ON ap.ArchivePointIdentity = s.ArchivePointIdentity
JOIN EnterpriseVaultDirectory.dbo.ArchiveView AS av ON av.VaultEntryId = ap.ArchivePointId
GROUP BY ROLLUP(av.ArchiveName)
--Chris
05-07-2020 08:31 AM
Will the results report on compressed or uncompressed?
05-07-2020 12:03 PM
ItemSize should be the compressed size as held in EV, I believe.
05-12-2020 07:41 AM
Yes, ItemSize is compressed. The OriginalSize is in the SavesetProperty table in bytes. This would reflect in KB -
SUM(OriginalSize)/1024 AS OrignalSize_KB
Patrick