How to get the database backup location?

Zahid. Ahamed 41 Reputation points
2020-09-29T01:48:55.507+00:00

Hi Expert,

I am not sure in which location the database backup is performing. I ran a query and it returned the following output. And also I don't see any database backup job in the SQL Server agent. But the backup is performing every day. Please look into the attach screenshot

29001-image.png

SQL Server | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. m 4,281 Reputation points
    2020-09-29T03:30:45.04+00:00

    Hi @Zahid. Ahamed ,

    Please execute code as next to check your device type:

    SELECT  
        database_name,  
        backup_finish_date,  
        CASE msdb..backupset.type  
            WHEN 'D' THEN 'Database'  
            WHEN 'L' THEN 'Log'  
        END AS backup_type,  
        physical_device_name,  
     device_type  
    FROM msdb.dbo.backupmediafamily  
    INNER JOIN msdb.dbo.backupset  
        ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id  
    --WHERE (CONVERT(datetime, msdb.dbo.backupset.backup_start_date, 102) >= GETDATE() - 1)  
    ORDER BY database_name,backup_finish_date  
    

    29041-20200929devicetype.jpg

    Quote from this doc. :SQL-Server-physical_device_name-in-the-Backup-log-shows-GUID
    Please verify these rows have value 7 in the column "device_type" or not. The value 7 means "Virtual device". These rows are actually very useful for monitoring, for example it help to know that the Virtual Machine backups are running full database backups on a SQL Server instance. there's no trace of these backup files since they are above the scope of the virtual machine (above the level of your control) - these are triggered by the host,meaning azure in this case (Hyper-V or VMware for example triggers these).

    In conclusion: These backups are not related to our backup in the level of the instance.

    BR,
    Mia


    If the answer is helpful, please click "Accept Answer" and upvote it.


5 additional answers

Sort by: Most helpful
  1. Zahid. Ahamed 41 Reputation points
    2020-10-01T03:35:57.163+00:00

    @m Thanks for you clarification. Your given query retuned value is 7 in my case.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.