Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

Thanks

Munish

share|improve this question

migrated from stackoverflow.com 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

2 Answers 2

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:

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

See also here:

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

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

Or..

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

 
discard

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