From: Kern Sibbald Date: Wed, 20 Jan 2010 11:40:36 +0000 (+0100) Subject: More query.sql changes X-Git-Tag: Release-5.0.0~41 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c4d1428a850e21ae71acb3078672cb95c4b8b3ff;p=bacula%2Fbacula More query.sql changes --- diff --git a/bacula/examples/sample-query.sql b/bacula/examples/sample-query.sql index d3ad146699..036d4ae9d0 100644 --- a/bacula/examples/sample-query.sql +++ b/bacula/examples/sample-query.sql @@ -207,3 +207,34 @@ SELECT VolumeName,VolStatus,Storage.Name AS Location, AND InChanger=0 AND ((VolStatus='Purged') OR (VolStatus='Append') OR (VolStatus='Recycle')) ORDER BY VolMounts ASC, Pool.Name ASC, VolumeName ASC +# 18 +:List Volumes by Volume: +SELECT VolumeName, Job.JobId as JobID, Job.Name as JobName, Job.StartTime as +Start, sum(JobFiles) AS Files,sum(JobBytes) AS Bytes + FROM Job,JobMedia,Media + WHERE JobMedia.JobId=Job.JobId + AND JobMedia.MediaId=Media.MediaId + GROUP by VolumeName, Job.JobID, Job.Name, Job.StartTime + ORDER by VolumeName; +# 19 +:List Volumes by Jobs: +SELECT Job.Name as JobName, Job.JobId as JobID, VolumeName, Job.StartTime as +Start, sum(JobFiles) AS Files,sum(JobBytes) AS Bytes + FROM Job,JobMedia,Media + WHERE JobMedia.JobId=Job.JobId + AND JobMedia.MediaId=Media.MediaId + GROUP by VolumeName, Job.JobID, Job.Name, Job.StartTime + ORDER by JobName, Start; +# 20 +:List Volumes for a jobname: +*Enter Job name: +SELECT Job.Name as JobName, Job.JobId as JobID, VolumeName, Job.StartTime as +Start, sum(JobFiles) AS Files,sum(JobBytes) AS Bytes + FROM Job,JobMedia,Media + WHERE Job.Name='%1' + AND JobMedia.JobId=Job.JobId + AND JobMedia.MediaId=Media.MediaId + GROUP by VolumeName, Job.JobID, Job.Name, Job.StartTime + ORDER by JobName, Start; + +