Question : Restore database

I ma trying to restore a Microsoft SQL Server 2005 database (full and transaction log backup)

i ma using the following script

restore database xxxxxxx
from disk = '\\xxxxxxx\xxxxxxxx\xxxxxxxxx\xxxxxx_backup_200711302217.bak'
with norecovery;

restore database agrprod
from disk = '\\xxxxxxxx\xxxxxxx\xxxxxx\xxxxxx_backup_200712032007.trn'
with recovery

However, I am getting the following error


Msg 3159, Level 16, State 1, Line 1
The tail of the log for the database "xxxxx" 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.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.


Msg 3117, Level 16, State 4, Line 5
The log or differential backup cannot be restored because no files are ready to rollforward.
Msg 3013, Level 16, State 1, Line 5
RESTORE DATABASE is terminating abnormally.


Please help as its urgent

Many thanks

Answer : Restore database

Well, which option do you want:
1. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log. or
2. Backup the Transaction log again.

I suspect you want the first.
Random Solutions  
 
programming4us programming4us