|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Backup and Restore Problem
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 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 quoteTibor 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 > > 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 >> >> > 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 quoteTibor 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 >>> >>> >> > > 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 >>>> >>>> >>> >> >> >
Other interesting topics
JOIN based on date
Disaster Recovery Options What can cause SQL 2000 to stop responding for a while replicate image of DB at a remote site Using Alias with Failover Is it possible to associate sql login with network address? SQL Server 2005 Script Out User Permission Prod-> Dev FT Index - Avoid Noise Words how to ignore error.... Defrag SQL Server Files |
|||||||||||||||||||||||