September 7, 2021 at 6:23 am
Hi All,
How do I find out the owner of bak files ?
There are some old bak files in D:\ that I want to clean up but thinking it is best to get the permission first
thank you
September 7, 2021 at 7:24 am
Speak to fellow DBA's / send a mass mail around asking, there is no way to know without going asking people in the business what they where kept around for.
September 7, 2021 at 12:59 pm
Backup history files might show you what account (user_name) ran the backup if you can find an entry for that database, date & time.
Ant's "Ask Around" suggestion will probably give the best info, if there is any to be had.
I use this to look at backup history, changing date range as needed.
SELECT
bs.database_name AS DatabaseName
,CASE bs.type
WHEN 'D' THEN 'Full'
WHEN 'I' THEN 'Differential'
WHEN 'L' THEN 'Transaction Log'
END AS BackupType
,CAST(DATEDIFF
(SECOND,bs.backup_start_date,bs.backup_finish_date)
AS VARCHAR(4)) + ' ' + 'Seconds' AS TotalTimeTaken
,bs.backup_start_date AS BackupStartDate
,CAST(CAST(bs.backup_size / 1000000 AS INT) AS VARCHAR(14))
+ ' ' + 'MB' AS BackupSize
,bs.server_name AS ServerName
,bs.recovery_model AS RecoveryModel
,*--- select *
FROM msdb.dbo.backupset AS bs
INNER JOIN msdb.dbo.backupmediafamily AS bmf
ON bs.media_set_id = bmf.media_set_id
WHERE backup_start_date > getdate() -1
AND device_type = 2--- 2 = disk omit 7 Virtual because those are Datto "snapshots"
ORDER BY
bs.database_name,
backup_start_date DESC
,backup_finish_date
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply