Forum Discussion

Y1251's avatar
Y1251
Level 5
5 years ago

check number of emails in archive folder

Hi, 

May i know is any mothed to check number of emails in a archive folder in user ev strucutre backend?

output:

Ryan-archive
          |_Folder1 (number of emails 200)
          |_Folder2 (number of emails 300)
          |_Folder3 (number of emails 250)

Thx

 

4 Replies

  • Hi there,

    You could try using below SQL query against the Vault Store Database:

    SELECT FolderName, COUNT(*) as ItemCount --, FolderPath
    
    FROM [view_Saveset_Archive_Vault] a
    
    INNER JOIN [EnterpriseVaultDirectory].dbo.ArchiveFolderView b ON a.VaultID = b.VaultEntryId
    
    WHERE ArchivePointId = '14E72097B8240CB43A18DBB6AFCEE56D71110000rowi01-ev-01.rowiev.local'
    
    GROUP BY FolderName
    Example output:
    
    FolderName                  ItemCount
    
    Inbox                       1
    
    Sent Items                  2
    
    Top of Information Store    1

    The archive ID can be found from the Vault Admin Console, by looking at the properties of the archive.

    • CConsult's avatar
      CConsult
      Moderator

      Hi,

      you can also use this sql query to also get the archive name.

      Set the archiveID in the where statement, otherwise it will search it for every archive.

      ____________

       

      SELECT  

           Archive.ArchiveName,

           ArchiveFolder.FolderName,

           COUNT(*) as itemsPerFolder,

           Vault.ArchivedItems,

           vault.ArchivedItemsSize

          

      FROM

           EnterpriseVaultDirectory.dbo.root r1

           LEFT JOIN EnterpriseVaultDirectory.dbo.Root r2 on r1.RootIdentity = r2.ContainerRootIdentity

           JOIN EnterpriseVaultDirectory.dbo.Archive on r1.RootIdentity = archive.RootIdentity

           LEFT JOIN EnterpriseVaultDirectory.dbo.ArchiveFolder on r2.RootIdentity = ArchiveFolder.RootIdentity

           RIGHT JOIN EVVSMBXStore01_1.dbo.Vault on r2.VaultEntryId = Vault.Vaultid

           JOIN EVVSMBXStore01_1.dbo.ArchivePoint AP on Vault.ArchivePointIdentity = AP.ArchivePointIdentity

           JOIN EVVSMBXStore01_1.dbo.Saveset on Vault.VaultIdentity = Saveset.VaultIdentity

      /*use below where conditions to narrow down. If two archives have same name, use archive id

      WHERE

      ArchivePointId='XXXX' */

      GROUP BY

           Archive.ArchiveName,

           ArchiveFolder.FolderName,

           Vault.ArchivedItems,

           vault.ArchivedItemsSize

      __________

      results will be like this:

      archivename, Foldername, items per folder, items archived, Size of items in folder

      regards

       

    • Y1251's avatar
      Y1251
      Level 5

      Hi Virgil,

      Thanks, as i try to run the sql and hceck the ArchivePointId, but show below message :"Msg 208, Level 16, State 1, Line 1
      Invalid object name 'view_Saveset_Archive_Vault'." may i know should i change the valut "view_Saveset_Archive_Vault"?

      • Marcde's avatar
        Marcde
        Moderator

        Hi, 

        you need to execute Virgils query against the vaultstore database where the archive in question resides in.

        Just add the follwing line in front of the query:

        USE <NameOfVaultStoreDB>

         

         

        Regards

        Marc