Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi I want restore database from backup file so i have used the following command

restore database myTestDbName from disk ='C:\temp\mybackuo.bak'

while executing the command I got following error

"The tail of the log for the database "myTestDbName" 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. RESTORE DATABASE is terminating abnormally."

To get the back up of data base i used following command

backup database myTestDbName to disk ='c:\temp\mybackuo.bak' with init,stats=10

Please reply me as soon as possible.



share|improve this question

migrated from Oct 12 '10 at 16:23

This question came from our site for professional and enthusiast programmers.

the error message gives you the answer to your problem – Nick Kavadias Oct 13 '10 at 0:31

This is really a question for ServerFault, but the documentation is quite clear about what the error means and what action you need to take:

See also here:

In your case, if you really do want to overwrite the existing database, you need to specify WITH REPLACE.

share|improve this answer

You have the solution to your problem in your question. :-

The problem is that you have an existing database log that you need to backup before you restore the database.

You can either do the command Backup Log with NoRecovery, then you will be able to restore your DB


If you want to overwrite this log you can use the with backup log with replace or with stopat clauses.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.