Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 msdb..backupmediafamily Incorrect - Why???

Author  Topic 

DBADave
Constraint Violating Yak Guru

366 Posts

Posted - 2006-04-24 : 20:50:53
I'm seeing strange results when I query backupmediafamily for some of my databases. I ran a script to generate the "restore database" commands for all databases and noticed this script fails for some databases. For those failures it generates a physical disk path that does not exist. sysdevices has the correct path so I'm not sure where backupmediaset gets its data. It's possible this path existed in the past, but it isn't there anymore. The puzzling thing is these backup files are from new backups.

select max (backup_start_date), physical_device_name
from msdb..backupmediafamily a
join msdb..backupset b
on a.media_set_id = b.media_set_id
where physical_device_name like '%imsql1%'
group by physical_device_name
order by physical_device_name


Any ideas?

Dave

DBADave
Constraint Violating Yak Guru

366 Posts

Posted - 2006-04-24 : 23:22:49
Here is an update. I found that if I do not specify a backup device or if I create a new backup device with a different name, backupmediafamily contains the correct information. However, if I delete the backup device and create it with the same name, backupmediafamily contains the wrong path. For example, the path it contains is G:\MSSQL\Backup\Server1\Accounting.bak when the actual path is G:\MSSQL\Backup\Accounting.bak. I don't understand what's happening.

SQL Server 2000 with sp3a running on Windows 2000 SE.

Dave
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-04-24 : 23:49:32
use sp_dropdevice when deleting, not just deleting it from the drive,
which will delete the entry from master.dbo.sysdevices




--------------------
keeping it simple...
Go to Top of Page

DBADave
Constraint Violating Yak Guru

366 Posts

Posted - 2006-04-25 : 08:08:30
I've confirmed the device gets dropped from sysdevices, however when I recreate it the physical device name is incorrect. I believe this is a bug related to msdb..backupmediafamily.

Thanks, Dave
Go to Top of Page
   

- Advertisement -