SP 8.1.9
I'm trying to write a Powershell script that will return data on all filespaces 
that haven't been backed up in > x days.  I've had the basic query from the 
Filespaces table working for years, but now I'm trying to include the total 
object count from the Occupancy table for each filespace, and I'm not adept 
enough at query writing to do that.  I suspect I need some flavor of join but 
not sure which one.

Here was my first attempt, more to show what I'm trying to do, it obviously 
isn't working.  If anyone has this working and is willing to share, I'd 
appreciate it.

SELECT '$myTsmServer' AS TsmServer, FS.Node_Name, FS.Filespace_Name, 
FS.Filespace_ID, DAYS(Current_Date)-DAYS(FS.Backup_End) AS Age, 
SUM(OC.Num_Files) FROM Filespaces FS, Occupancy OC WHERE 
FS.Filespace_ID=OC.Filespace_ID AND FS.filespace_id=OC.filespace_id AND 
DAYS(Current_Date)-DAYS(FS.Backup_End)>$myAgeLimit

Steve Schaub
Systems Eng II, Backup & Recovery
BlueCross BlueShield of Tennessee



------------------------------------------------------------------------------
Please see the following link for the BlueCross BlueShield of Tennessee E-mail 
disclaimer:  
https://www.bcbst.com/about/our-company/corporate-governance/privacy-security/email-policy.page
 
<https://www.bcbst.com/about/our-company/corporate-governance/privacy-security/email-policy.page>

Reply via email to