Tuesday, March 27, 2012

abnormal message when performing restore on 2005

Hi!
I have performed a full, differential and translog backup of my database.
Now when I try to restore the full backup it I get this message
Msg 3159, Level 16, State 1, Line 1
The tail of the log for the database "userdb" 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.
I then used this command
restore database userdb from disk='X:\backups\userfulldev.bak' with replace
and it restored the information correctly...
But im a bit curious exactly what I did wrong. Usually I never have to use
the "with replace" option when I restore my databases...
your thoughts?
/henrikThat is a new "error" message designed to keep you from erasing potentially
useful data. It applies when the following conditions are al true
You are restoring over an existing database
The database is in full recovery mode
There are active log segments (segments that have not been backed up).
The assumption is that the database contains useful transactions that must
be preserved.
--
Geoff N. Hiten
Senior Database Administrator
Microsoft SQL Server MVP
"Henrik Nordgren" <HenrikNordgren@.discussions.microsoft.com> wrote in
message news:84A018FB-0A32-4991-BC94-BD875EAB553B@.microsoft.com...
> Hi!
> I have performed a full, differential and translog backup of my database.
> Now when I try to restore the full backup it I get this message
> Msg 3159, Level 16, State 1, Line 1
> The tail of the log for the database "userdb" 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.
>
> I then used this command
> restore database userdb from disk='X:\backups\userfulldev.bak' with
> replace
> and it restored the information correctly...
> But im a bit curious exactly what I did wrong. Usually I never have to use
> the "with replace" option when I restore my databases...
> your thoughts?
> /henrik
>|||On Feb 14, 1:47 pm, Henrik Nordgren
<HenrikNordg...@.discussions.microsoft.com> wrote:
> Hi!
> I have performed a full, differential and translog backup of my database.
> Now when I try to restore the full backup it I get this message
> Msg 3159, Level 16, State 1, Line 1
> The tail of the log for the database "userdb" 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.
> I then used this command
> restore database userdb from disk='X:\backups\userfulldev.bak' with replace
> and it restored the information correctly...
> But im a bit curious exactly what I did wrong. Usually I never have to use
> the "with replace" option when I restore my databases...
> your thoughts?
> /henrik
This is telling you that something modified your database after your
last log backup was done. There are "new" transactions in the log
that you will lose if you proceed with the restore...

No comments:

Post a Comment