Home All Groups Group Topic Archive Search About

Backup and Restore Problem



Author
6 Dec 2008 4:36 AM
Tony Starr
I need some help.

Today, every time I try and resore a database I get the following message.

System.Data.SqlClient.SqlError: The tail of the log for the database
"XelonReleases" 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. (Microsoft.SqlServer.Smo)

I did a test and created a new database.

I immediately did a backup of the new database using the Full Recovey Model
via SQL Server Management Studio.  The system reported that this completed
successfully.
I then tried to do a restore this new database and got the same error.


Up until today backups/and restores worked without a problem.

Any ideas?

TIA.
Tony

Author
6 Dec 2008 8:26 AM
Tibor Karaszi
The behavior you see is as of SQL Server 2005. It is a friendly
reminder that you might want to backup the current transaction log
before you do the restore (else all changes in the log will be lost).
If you don't want to do this, then do as the message say and add the
REPLACE option to the RESTORE command.

Show quoteHide quote
"Tony Starr" <tonystarr***@ozemailYYY.com.au> wrote in message
news:%23rR07w1VJHA.2512@TK2MSFTNGP04.phx.gbl...
>I need some help.
>
> Today, every time I try and resore a database I get the following
> message.
>
> System.Data.SqlClient.SqlError: The tail of the log for the database
> "XelonReleases" 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.
> (Microsoft.SqlServer.Smo)
>
> I did a test and created a new database.
>
> I immediately did a backup of the new database using the Full
> Recovey Model via SQL Server Management Studio.  The system reported
> that this completed successfully.
> I then tried to do a restore this new database and got the same
> error.
>
>
> Up until today backups/and restores worked without a problem.
>
> Any ideas?
>
> TIA.
> Tony
>
>
Are all your drivers up to date? click for free checkup

Author
6 Dec 2008 11:40 AM
Tony Starr
Hi Tibor,

Thank you for your explanation. The thing that troubles me is that I was
doing backups and restores until today without that message ever appearing.

In my test case I'm creating a database,  backing up the database, then
restoring the database with nothing done in between so I would not expect
there to be anything in the transaction log and hence I would not expect to
get this message.

Can you shed any light on this for me.

Thanks
Tony


Show quoteHide quote
"Tibor Karaszi" <tibor_please.no.email_kara***@hotmail.nomail.com> wrote in
message news:e4M3fx3VJHA.4376@TK2MSFTNGP04.phx.gbl...
> The behavior you see is as of SQL Server 2005. It is a friendly reminder
> that you might want to backup the current transaction log before you do
> the restore (else all changes in the log will be lost). If you don't want
> to do this, then do as the message say and add the REPLACE option to the
> RESTORE command.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
>
> "Tony Starr" <tonystarr***@ozemailYYY.com.au> wrote in message
> news:%23rR07w1VJHA.2512@TK2MSFTNGP04.phx.gbl...
>>I need some help.
>>
>> Today, every time I try and resore a database I get the following
>> message.
>>
>> System.Data.SqlClient.SqlError: The tail of the log for the database
>> "XelonReleases" 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. (Microsoft.SqlServer.Smo)
>>
>> I did a test and created a new database.
>>
>> I immediately did a backup of the new database using the Full Recovey
>> Model via SQL Server Management Studio.  The system reported that this
>> completed successfully.
>> I then tried to do a restore this new database and got the same error.
>>
>>
>> Up until today backups/and restores worked without a problem.
>>
>> Any ideas?
>>
>> TIA.
>> Tony
>>
>>
>
Author
6 Dec 2008 11:58 AM
Tibor Karaszi
I get the same behavior from below script:

ALTER DATABASE model SET RECOVERY FULL

CREATE DATABASE x
BACKUP DATABASE x TO DISK = 'C:\x.bak'
RESTORE DATABASE x FROM DISK = 'C:\x.bak'

Even if you think that there is nothing in the log, there always is
(like system events being refelcted in the log). So this is just how
the product work...

Show quoteHide quote
"Tony Starr" <tonystarr***@ozemailYYY.com.au> wrote in message
news:%23tvPkd5VJHA.5032@TK2MSFTNGP05.phx.gbl...
> Hi Tibor,
>
> Thank you for your explanation. The thing that troubles me is that I
> was doing backups and restores until today without that message ever
> appearing.
>
> In my test case I'm creating a database,  backing up the database,
> then restoring the database with nothing done in between so I would
> not expect there to be anything in the transaction log and hence I
> would not expect to get this message.
>
> Can you shed any light on this for me.
>
> Thanks
> Tony
>
>
> "Tibor Karaszi" <tibor_please.no.email_kara***@hotmail.nomail.com>
> wrote in message news:e4M3fx3VJHA.4376@TK2MSFTNGP04.phx.gbl...
>> The behavior you see is as of SQL Server 2005. It is a friendly
>> reminder that you might want to backup the current transaction log
>> before you do the restore (else all changes in the log will be
>> lost). If you don't want to do this, then do as the message say and
>> add the REPLACE option to the RESTORE command.
>>
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>>
>> "Tony Starr" <tonystarr***@ozemailYYY.com.au> wrote in message
>> news:%23rR07w1VJHA.2512@TK2MSFTNGP04.phx.gbl...
>>>I need some help.
>>>
>>> Today, every time I try and resore a database I get the following
>>> message.
>>>
>>> System.Data.SqlClient.SqlError: The tail of the log for the
>>> database "XelonReleases" 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.
>>> (Microsoft.SqlServer.Smo)
>>>
>>> I did a test and created a new database.
>>>
>>> I immediately did a backup of the new database using the Full
>>> Recovey Model via SQL Server Management Studio.  The system
>>> reported that this completed successfully.
>>> I then tried to do a restore this new database and got the same
>>> error.
>>>
>>>
>>> Up until today backups/and restores worked without a problem.
>>>
>>> Any ideas?
>>>
>>> TIA.
>>> Tony
>>>
>>>
>>
>
>
Author
7 Dec 2008 3:36 AM
Tony Starr
Thanks Tibor,

I guess that maybe I had been previously using the Simple Recovery Model and
that somehow it got changed to Full Recovery. That's the only explanation I
can come up with.

Thank you for your time and assistance.

Cheers
Tony



Show quoteHide quote
"Tibor Karaszi" <tibor_please.no.email_kara***@hotmail.nomail.com> wrote in
message news:OGVtCo5VJHA.2512@TK2MSFTNGP04.phx.gbl...
>I get the same behavior from below script:
>
> ALTER DATABASE model SET RECOVERY FULL
>
> CREATE DATABASE x
> BACKUP DATABASE x TO DISK = 'C:\x.bak'
> RESTORE DATABASE x FROM DISK = 'C:\x.bak'
>
> Even if you think that there is nothing in the log, there always is (like
> system events being refelcted in the log). So this is just how the product
> work...
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
>
> "Tony Starr" <tonystarr***@ozemailYYY.com.au> wrote in message
> news:%23tvPkd5VJHA.5032@TK2MSFTNGP05.phx.gbl...
>> Hi Tibor,
>>
>> Thank you for your explanation. The thing that troubles me is that I was
>> doing backups and restores until today without that message ever
>> appearing.
>>
>> In my test case I'm creating a database,  backing up the database, then
>> restoring the database with nothing done in between so I would not expect
>> there to be anything in the transaction log and hence I would not expect
>> to get this message.
>>
>> Can you shed any light on this for me.
>>
>> Thanks
>> Tony
>>
>>
>> "Tibor Karaszi" <tibor_please.no.email_kara***@hotmail.nomail.com> wrote
>> in message news:e4M3fx3VJHA.4376@TK2MSFTNGP04.phx.gbl...
>>> The behavior you see is as of SQL Server 2005. It is a friendly reminder
>>> that you might want to backup the current transaction log before you do
>>> the restore (else all changes in the log will be lost). If you don't
>>> want to do this, then do as the message say and add the REPLACE option
>>> to the RESTORE command.
>>>
>>> --
>>> Tibor Karaszi, SQL Server MVP
>>> http://www.karaszi.com/sqlserver/default.asp
>>> http://sqlblog.com/blogs/tibor_karaszi
>>>
>>>
>>> "Tony Starr" <tonystarr***@ozemailYYY.com.au> wrote in message
>>> news:%23rR07w1VJHA.2512@TK2MSFTNGP04.phx.gbl...
>>>>I need some help.
>>>>
>>>> Today, every time I try and resore a database I get the following
>>>> message.
>>>>
>>>> System.Data.SqlClient.SqlError: The tail of the log for the database
>>>> "XelonReleases" 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. (Microsoft.SqlServer.Smo)
>>>>
>>>> I did a test and created a new database.
>>>>
>>>> I immediately did a backup of the new database using the Full Recovey
>>>> Model via SQL Server Management Studio.  The system reported that this
>>>> completed successfully.
>>>> I then tried to do a restore this new database and got the same error.
>>>>
>>>>
>>>> Up until today backups/and restores worked without a problem.
>>>>
>>>> Any ideas?
>>>>
>>>> TIA.
>>>> Tony
>>>>
>>>>
>>>
>>
>>
>

Bookmark and Share