Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Restore database

Posted on 2007-12-04
1
1,034 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:novicedbaUK
1 Comment
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 125 total points
ID: 20405105
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.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question