Map DPM mount points to Data Source
A volte è necessario sapere (anche se solo per curiosità), quale Data Source (sorgente) corrisponde an un certo JUNCTION (volume montato come mount point) nella cartella Volumes sotto DPM, in particolare sotto il path C:\Program Files\Microsoft System Center 2012\DPM\DPM\Volumes\DiffArea\SqlServerWriter
La seguente query SQL restituisce tutti i sorgenti dei dati con il Mount Point corrispondente
select server.servername,datasource.datasourcename,Volume.MountPointPath
from tbl_SPM_Volume Volume
join tbl_SPM_VolumeSet VolumeSet on VolumeSet.VolumeSetId=Volume.VolumeSetId
join tbl_PRM_LogicalReplica Replica on Replica.PhysicalReplicaId=VolumeSet.VolumeSetId
join dbo.tbl_PRM_ReplicaVolume ReplicaVol on VolumeSet.VolumeSetId=replicavol.ReplicaId
join tbl_IM_Datasource Datasource on Datasource.DatasourceId=Replica.DatasourceId
join tbl_AM_Server Server on Server.ServerId=Datasource.serverid
join tbl_SPM_Extent Extent on Extent.GuidName=Volume.GuidName
join tbl_SPM_Disk disk on disk.DiskID=Extent.DiskID
and Replica.Validity in (1,2,3)
and volume.usage in (1)
Ovviamente se si ha la necessità di trovare quale sorgente corrisponde a un determinato Mount Point, basterebbe aggiungere la clausola WHERE in una riga separata come da seguito
select server.servername,datasource.datasourcename,Volume.MountPointPath
from tbl_SPM_Volume Volume
join tbl_SPM_VolumeSet VolumeSet on VolumeSet.VolumeSetId=Volume.VolumeSetId
join tbl_PRM_LogicalReplica Replica on Replica.PhysicalReplicaId=VolumeSet.VolumeSetId
join dbo.tbl_PRM_ReplicaVolume ReplicaVol on VolumeSet.VolumeSetId=replicavol.ReplicaId
join tbl_IM_Datasource Datasource on Datasource.DatasourceId=Replica.DatasourceId
join tbl_AM_Server Server on Server.ServerId=Datasource.serverid
join tbl_SPM_Extent Extent on Extent.GuidName=Volume.GuidName
join tbl_SPM_Disk disk on disk.DiskID=Extent.DiskID
and Replica.Validity in (1,2,3)
and volume.usage in (1)
where MountPointPath like '%vol_52fde851-712c-4fd5-b3f2-c29461c814bd%'