Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to restore SQL Server database - 'The file or filegroup <logfilename> cannot be selected for this operation.'

When restoring a full DB backup to a different SQL Server 2005 Express server, I receive the following message:

The file or filegroup "mydatabase_log" cannot be selected for this operation. RESTORE DATABASE is terminating abnormally. (Microsoft SQL Server, Error: 3219)

I've checked the restore options to make sure that filenames are valid locations for it to restore to.

Any suggestions?

like image 306
Daniel O Avatar asked Dec 23 '08 11:12

Daniel O


People also ask

What is file and filegroup backup in SQL Server?

When the database size and performance requirements make a full database backup impractical, you can create a file backup instead. A file backup contains all the data in one or more files (or filegroups). For more information about file backups, see Full File Backups (SQL Server) and Differential Backups (SQL Server).

Why did my SQL Server restore fail?

Error Message is very clear about the cause of restore failure. Since we detached the database, the mdf and ldf files are still available at the location when the database was created. It’s good that SQL is not over writing the files by itself unless we specify explicitly.

Is it possible to restore files and filegroups in SQL Server?

Privacy policy. Thank you. This topic describes how to restore files and filegroups in SQL Server by using SQL Server Management Studio or Transact-SQL. The system administrator restoring the files and filegroups must be the only person currently using the database to be restored. RESTORE is not allowed in an explicit or implicit transaction.

How to resolve the ‘restore database failed’ error?

If someone is using the database, the restore operation will fail. To resolve the issue, you will need to disconnect the active users. You can do so, by following any of these methods: NOTE: Before disconnecting the users, use SQL stored procedure ‘sp_who’ to check all users currently using the db.

How do I restore a deleted file in SQL Server?

To restore files and filegroups. After you connect to the appropriate instance of the SQL Server Database Engine, in Object Explorer, click the server name to expand the server tree. Expand Databases. Depending on the database, either select a user database or expand System Databases, and then select a system database.


1 Answers

I fixed it by using Restore Database instead of Restore Files

like image 179
Daniel O Avatar answered Sep 22 '22 06:09

Daniel O