You have backup a database on SQL Server 2005. Then, you try to restore the backup file on the existing database and receive the error message below:
Restore failed for Server ‘SQL Server name‘. (Microsoft.SqlServer.Smo)
Additional information:
System.Data.SqlClient.SqlError: The tail of the log for the database “dbName” has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log. (Microsoft.SqlServer.Smo)
This error message is likely to be a warning message rather than an error message. It indicates that you are going to restore a database to replace the existing database and some data may be lose. For example, you perform backup on this following schedule:
- database at 10:00 AM
- transaction log at 11:00 AM
- transaction log at 01:00 PM
Now if you are going to restore the backup at 04:00 PM. You will lose any work after 01:00 till 04:00 which is same as the error message above try to warn you.
Solution
To solve the problem, you can either:
- Replace the existing database with a backup file. This option is fast and easy but you will lose any work after the last backup has been performed.
- Do backup transaction log again with NORECOVERY option before restoring a database. With NORECOVERY option, the database will be in restoring state and waiting for restoration.
In this post, I will show only the first solution only. For the second solution, see How to: Back Up the Tail of the Transaction Log (SQL Server Management Studio)
hey cool….. very informative.. Its working for me.
Thanks
=) Nice. It helped me =)
thank for for …infomation
now i got the answer
tank u..
i face error of this type anyone know plz. help
system.data.sqlclient.sqlerror:the media set has 2 media families but only 1 are provided.all members must be provided(Microsoft.sqlserver.smo)
Hi, Lalit
See this post – http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/abf50e00-c9b0-4809-9e61-43ed8a53e968.
Cool, informative. Thanks
Its coollll man.
its workign for me.
Thanks for this post.
thanks 🙂
it’s working… thank you so much…
hi i tried to restore the database in my laptop sqlserver 2005 databse ,i followed the above procedure it wont work plz help ….
still iam facing the problem
It is very usefull to me. I soent for nearly three hours
Brilliant! Thank you sooooooooooo much.
thanks brother 🙂
Hi, It is not solved for me.
Anybody can assist me. I’ve got the following error even I’ve checked the Replace db option
TITLE: Microsoft SQL Server Management Studio
——————————
Restore failed for Server ‘USER’. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476
——————————
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All members must be provided. (Microsoft.SqlServer.Smo)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&LinkId=20476
——————————
BUTTONS:
OK
——————————
Many Many Thanks !
This Worked for me !
Was struggling since hours….
Just a Click…. Wonders
Its not working for me…
System.Data.SqlClient.SqlError: The media set has 2 media families but only 1 are provided. All members must be provided. (Microsoft.SqlServer.Smo)
got this error how to resolve plzz reply soon 🙁
Thanks it works for me