简体   繁体   English

恢复数据库

[英]restoring database

I had to uninstall SQL Server 2005, because it was configured to be used only in windows authentication mode, and install it again in mixed mode. 我必须卸载SQL Server 2005,因为它已配置为仅在Windows身份验证模式下使用,然后在混合模式下再次安装。 I had to take a backup of my only database there, and restore it again on installing the sql server back, though the backup was taken successfully but when am trying to restore it, it is giving me an error as 我必须在那里备份我唯一的数据库,然后在重新安装sql server时再次将其还原,尽管备份已成功完成,但在尝试还原时却给我一个错误

System.Data.SqlClient.SqlError: The media has 2 media families but only 1 are provided. All members must be provided. (Microsoft.SqlServer.Smo)

I am using SQL server management studio, and trying to restore the database by right clicking on the databases folder, selecting restore database option, and then providing a database name, in "destination for restore", and in "source for restore" am selecting from device option and then providing with the path of my .bak file(backup file of the database), but the thing is not working, saying that the restored has failed and giving the above mentioned description for the error. 我正在使用SQL Server Management Studio,并尝试通过右键单击“数据库”文件夹,选择“还原数据库”选项,然后在“还原目标”和“还原源”中提供数据库名称来还原数据库从设备选项,然后提供我的.bak文件(数据库的备份文件)的路径,但该操作不起作用,表示还原已失败,并给出了上述错误描述。

I suggest that you do not use the SSMS GUI to perform your database RESTORE unless you are familiar with all of the various options and settings. 我建议您不要使用SSMS GUI来执行数据库还原,除非您熟悉所有各种选项和设置。 Using the T-SQL RESTORE command you can define explicitly what you are looking to do. 使用T-SQL RESTORE命令,您可以显式定义要执行的操作。

I would suggest that you first verify your database backup file by using the RESTORE VERIFYONLY command. 我建议您首先使用RESTORE VERIFYONLY命令来验证数据库备份文件。

See SQL Server Books online: 请参阅SQL Server联机丛书:

http://msdn.microsoft.com/en-us/library/ms188902.aspx http://msdn.microsoft.com/en-us/library/ms188902.aspx

Is there any chance you backed up to two backup files (ie, striped backup), and you're only specifying one of them in the restore? 您是否有可能备份两个备份文件(即条带化备份),而在还原中仅指定其中一个? The restore seems to be complaining that if can't find all the files it needs to start the restore. 还原似乎在抱怨,如果找不到所有文件,则需要启动还原。

if you haven't already tried this: crate a blank database with the exact same name as the data base you're restoring from, with the files at the exact same location. 如果您尚未尝试过:创建一个与您要还原的数据库名称完全相同的空白数据库,并且文件位于相同的位置。 right click the blank database and restore from your backup. 右键单击空白数据库,然后从备份中还原。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM