10-12-2012 02:58 AM
Hi,
I'm trying to run following where Directory DB in one SQL server and Vault Store DB in another SQL server, how can we run this query in this scenario?
select COUNT(*), SUM(SS.ItemSize)/1024 'size in MB' from saveset SS
Solved! Go to Solution.
10-12-2012 03:36 AM
Hi,
You need to use 'linked server' (I am not an DBA, but a DBA should know)
The query I use frequently looks like this:
SELECT A.ArchiveName, COUNT(S.IdTransaction) AS ArchivedItemCount, SUM(S.ItemSize/1024) AS ArchivedItemSize
FROM EnterpriseVaultDirectory.dbo.Archive A,
EnterpriseVaultDirectory.dbo.Root R,
EV02_on_server02.EVVSMailEVxxx_11.dbo.ArchivePoint AP,
EV02_on_server02.EVVSMailEVxxx_11.dbo.Saveset S
WHERE
(A.ArchiveName like '%username%')
AND S.ArchivePointIdentity = AP.ArchivePointIdentity
AND AP.ArchivePointId = R.VaultEntryID
AND R.RootIdentity = A.RootIdentity
AND S.ArchivedDate > dateAdd("m",-1,getDate())
AND S.ArchivedDate < getDate()
GROUP BY A.ArchiveName
Directorydb is on EV01 instance on server01
(where EV02_on_server02) is the instance on the 2nd SQL server
Where EVVSMailEVxxx_11 is the vaultstoredatabase
10-12-2012 03:36 AM
Hi,
You need to use 'linked server' (I am not an DBA, but a DBA should know)
The query I use frequently looks like this:
SELECT A.ArchiveName, COUNT(S.IdTransaction) AS ArchivedItemCount, SUM(S.ItemSize/1024) AS ArchivedItemSize
FROM EnterpriseVaultDirectory.dbo.Archive A,
EnterpriseVaultDirectory.dbo.Root R,
EV02_on_server02.EVVSMailEVxxx_11.dbo.ArchivePoint AP,
EV02_on_server02.EVVSMailEVxxx_11.dbo.Saveset S
WHERE
(A.ArchiveName like '%username%')
AND S.ArchivePointIdentity = AP.ArchivePointIdentity
AND AP.ArchivePointId = R.VaultEntryID
AND R.RootIdentity = A.RootIdentity
AND S.ArchivedDate > dateAdd("m",-1,getDate())
AND S.ArchivedDate < getDate()
GROUP BY A.ArchiveName
Directorydb is on EV01 instance on server01
(where EV02_on_server02) is the instance on the 2nd SQL server
Where EVVSMailEVxxx_11 is the vaultstoredatabase
10-12-2012 03:46 AM
Hmmm Thanks,
I have done the following, worked fine for me
Then
select COUNT(*), SUM(SS.ItemSize)/1024 'size in MB' from saveset SS
inner join ArchivePoint AP on SS.ArchivePointIdentity = AP.Archivepointidentity