Skip to content

msdb.dbo.rds_restore_database error: File 'D:\rdsdbdata\DATA\samplestaging' is claimed by 'samplestaging_log'(2) and 'samplestaging'(1).

0

tsql: exec msdb.dbo.rds_restore_database @restore_db_name='samplestaging', @s3_arn_to_restore_from='arn:aws:s3:::sample-db-backup/samplestagingbackup/samplestaging_Full_Backup20240915.bak'

task_info: [2024-09-15 11:53:22.240] Task execution has started. [2024-09-15 11:53:22.367] File 'D:\rdsdbdata\DATA\samplestaging' is claimed by 'samplestaging_log'(2) and 'samplestaging'(1). The WITH MOVE clause can be used to relocate one or more files. RESTORE DATABASE is terminating abnormally. [2024-09-15 11:54:22.050] File 'D:\rdsdbdata\DATA\samplestaging' is claimed by 'samplestaging_log'(2) and 'samplestaging'(1). The WITH MOVE clause can be used to relocate one or more files. RESTORE DATABASE is terminating abnormally. [2024-09-15 11:54:22.053] samplestagingbackup/samplestaging_Full_Backup20240915.bak: S3 processing has been aborted [2024-09-15 11:54:22.080] File 'D:\rdsdbdata\DATA\samplestaging' is claimed by 'samplestaging_log'(2) and 'samplestaging'(1). The WITH MOVE clause can be used to relocate one or more files. RESTORE DATABASE is terminating abnormally.

please help!

asked 2 years ago189 views

1 Answer
0

The error you're encountering indicates that there's a conflict with the file locations specified in your restore operation. The file D:\rdsdbdata\DATA\samplestaging is being claimed by both the data and log files of the database, which is causing the restore to fail.

To resolve this, use the WITH MOVE clause in your RESTORE DATABASE command to specify different locations for the data and log files. This allows you to relocate the files to a directory where there is no conflict. Here’s a general example of how you might modify your command:

RESTORE DATABASE samplestaging 
FROM DISK = 'arn:aws:s3:::sample-db-backup/samplestagingbackup/samplestaging_Full_Backup20240915.bak' 
WITH MOVE 'samplestaging' TO 'D:\rdsdbdata\DATA\samplestaging_data.mdf',
     MOVE 'samplestaging_log' TO 'D:\rdsdbdata\DATA\samplestaging_log.ldf';

In this command, replace 'D:\rdsdbdata\DATA\samplestaging_data.mdf' and 'D:\rdsdbdata\DATA\samplestaging_log.ldf' with appropriate file paths where you want to store the data and log files.

EXPERT

answered 2 years ago

  • hello,

    thank you for your answer but the suggested script is producing another issue.

    tsql: RESTORE DATABASE samplestaging FROM DISK ='arn:aws:s3:::sample-db-backup/samplestagingbackup/samplestaging_Full_Backup20240915.bak' WITH MOVE 'samplestaging' TO 'D:\rdsdbdata\DATA\samplestaging_data.mdf', MOVE 'samplestaging_log' TO 'D:\rdsdbdata\LOG\samplestaging_log.ldf'; error: Cannot open backup device 'D:\rdsdbdata\BACKUP\arn:aws:s3:::zantrik-db-backup\zantrikstagingbackup\zantrikstaging_Full_Backup20240915.bak'. Operating system error 123(The filename, directory name, or volume label syntax is incorrect.).

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.