EV FSA Query to list top folders
Hello
I am looking to create a SQL query to list the top folders archived on a particular archive or vault store, if possible.
For example: In the last 1 year, list the top 5 folders that contributed writing to archival storage.
I was able to list the archives, but not able to find a way to list the folders.
Thanks in advance for your insights.
The script can be an easy one based on Plaudone1's (run it against your FSA VS DB and assume the EVD db is also on the same SQL instance):
SELECT TOP 5
FolderPath,
SUM(ItemSize)/1024 AS 'Archived Size (MB)'
FROM
EnterpriseVaultDirectory.dbo.root r1
JOIN EnterpriseVaultDirectory.dbo.Root r2 on r1.RootIdentity = r2.ContainerRootIdentity
JOIN EnterpriseVaultDirectory.dbo.ArchiveFolder on r2.RootIdentity = ArchiveFolder.RootIdentity
JOIN Vault on r2.VaultEntryId = Vault.Vaultid
JOIN Saveset ss on Vault.VaultIdentity = ss.VaultIdentity
JOIN SavesetProperty sp on ss.savesetidentity = sp.SavesetIdentity
WHERE ss.ArchivedDate BETWEEN '2020-08-03 23:03:00.000' AND '2022-08-03 23:03:00.000'
GROUP BY
FolderPath
ORDER BY
'Archived Size (MB)' descJust update the date range as you wish, or as you asked, a year for the current time.
SELECT TOP 5
FolderPath,
SUM(ItemSize)/1024 AS 'Archived Size (MB)'
FROM
EnterpriseVaultDirectory.dbo.root r1
JOIN EnterpriseVaultDirectory.dbo.Root r2 on r1.RootIdentity = r2.ContainerRootIdentity
JOIN EnterpriseVaultDirectory.dbo.ArchiveFolder on r2.RootIdentity = ArchiveFolder.RootIdentity
JOIN Vault on r2.VaultEntryId = Vault.Vaultid
JOIN Saveset ss on Vault.VaultIdentity = ss.VaultIdentity
JOIN SavesetProperty sp on ss.savesetidentity = sp.SavesetIdentity
WHERE ss.ArchivedDate <DATEADD(YEAR, -1, GETUTCDATE())
GROUP BY
FolderPath
ORDER BY
'Archived Size (MB)' desc