Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Script to find last full backup size Expand / Collapse
Author
Message
Posted Friday, March 14, 2014 11:22 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Monday, April 21, 2014 12:41 PM
Points: 65, Visits: 234
Hi Guys,

I need sql query to find only last full backup size on shared drive or network location.

for eg: \\10.10.10.10\sql_backup\test.bak
size: 1GB
if full backup perform yesterday then i want to retrieve the size of last full backup only.

SQL Server version: 2005/2008

thnx......reply
Post #1551444
Posted Tuesday, March 18, 2014 10:06 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, September 11, 2014 2:28 PM
Points: 1,194, Visits: 2,219
Try this .. You can add a filter for Backup Location in the Where Clause ..


        SELECT bs.database_name AS DbName
, CAST ( bs.backup_size / 1024.0 / 1024 / 1024 AS DECIMAL(10, 2) ) AS BackupSize_GB
, bs.backup_start_date AS Backup_StartDate
, bs.backup_finish_date AS Backup_EndDate
, bs.name AS BackupName
, bmf.physical_device_name AS DeviceName
FROM msdb.dbo.backupset bs JOIN msdb.dbo.backupmediafamily bmf
ON bs.media_set_id = bmf.media_set_id
WHERE bs.database_name = 'DB_Name' and bs.backup_start_date <= DateAdd(hh, -24, GETDATE()) and bs.type = 'D'
order by bs.backup_start_date desc

--
SQLBuddy
Post #1552297
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse