Showing posts with label whichis. Show all posts
Showing posts with label whichis. Show all posts

Monday, March 12, 2012

Restore Problems

From time to time I receive the following error while
restoring:
"The log in this backup set terminates at LSNxxx, which
is too early to apply to the database. A more recent log
backup that includes LSNxxx can be restored."
I am not backing up any logs. This is my backup command:
BACKUP DATABASE [Order] TO DISK = N'C:\Program
Files\Microsoft SQL Server\MSSQL\BACKUP\Orderback' WITH
INIT , NOUNLOAD , NAME = N'Order backup', NOSKIP ,
STATS = 10, NOFORMAT
This is my restore:
restore database [order]
filegroup = 'primary', filegroup = 'ORDER1', filegroup
= 'ORDER2'
from disk='c:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\Orderback'
with file=1,norecovery,partial,replace,
move 'order_data' to 'c:\program files\microsoft sql
server\mssql\data\order_data.mdf',
move 'order_data1' to 'c:\program files\microsoft sql
server\mssql\data\order_data1.ndf',
move 'order_data2' to 'c:\program files\microsoft sql
server\mssql\data\order_data2.ndf',
move 'order_log' to 'c:\program files\microsoft sql
server\mssql\data\order_log.ldf'
go
restore log [order]
from disk='c:\Program Files\Microsoft SQL
Server\MSSQL\BACKUP\Orderback'
with file=1,recovery
goHi Paul.
I don't think you need that final restore log command - the full database
restore will fully restore the database and log entries in that file so I'm
wondering what you're expecting to get from that restore log command?
Regards,
Greg Linwood
SQL Server MVP
"Paul Offerle" <pofferle@.fmcconnell.com> wrote in message
news:664a01c4016a$6821c020$a001280a@.phx.gbl...
> From time to time I receive the following error while
> restoring:
> "The log in this backup set terminates at LSNxxx, which
> is too early to apply to the database. A more recent log
> backup that includes LSNxxx can be restored."
> I am not backing up any logs. This is my backup command:
> BACKUP DATABASE [Order] TO DISK = N'C:\Program
> Files\Microsoft SQL Server\MSSQL\BACKUP\Orderback' WITH
> INIT , NOUNLOAD , NAME = N'Order backup', NOSKIP ,
> STATS = 10, NOFORMAT
> This is my restore:
> restore database [order]
> filegroup = 'primary', filegroup = 'ORDER1', filegroup
> = 'ORDER2'
> from disk='c:\Program Files\Microsoft SQL
> Server\MSSQL\BACKUP\Orderback'
> with file=1,norecovery,partial,replace,
> move 'order_data' to 'c:\program files\microsoft sql
> server\mssql\data\order_data.mdf',
> move 'order_data1' to 'c:\program files\microsoft sql
> server\mssql\data\order_data1.ndf',
> move 'order_data2' to 'c:\program files\microsoft sql
> server\mssql\data\order_data2.ndf',
> move 'order_log' to 'c:\program files\microsoft sql
> server\mssql\data\order_log.ldf'
> go
> restore log [order]
> from disk='c:\Program Files\Microsoft SQL
> Server\MSSQL\BACKUP\Orderback'
> with file=1,recovery
> go|||When I omit the restore log, I am unable to access the
database. Enterprise Manager displays "(loading)" next to
the database name.|||Paul
Although Greg said the restore database will "will fully restore the
database and log entries in that file", he meant it COULD do the full
restore, but only if you specify the keyword RECOVERY. The default is not to
run recovery, with the assumption that you will first be applying more logs.
Recovery needs to be run with the last thing you're restoring.
Use the recovery option on your RESTORE DATABASE command and you won't need
to restore any logs.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
<anonymous@.discussions.microsoft.com> wrote in message
news:6cca01c401fd$90a802a0$a301280a@.phx.gbl...
> When I omit the restore log, I am unable to access the
> database. Enterprise Manager displays "(loading)" next to
> the database name.|||Try dropping the database before doing the restore.
I have found that doing filegroup restores using the REPLACE option creates
these type of errors.
Good Luck.
**********************************
"Paul Offerle" <pofferle@.fmcconnell.com> wrote in message
news:664a01c4016a$6821c020$a001280a@.phx.gbl...
> From time to time I receive the following error while
> restoring:
> "The log in this backup set terminates at LSNxxx, which
> is too early to apply to the database. A more recent log
> backup that includes LSNxxx can be restored."
> I am not backing up any logs. This is my backup command:
> BACKUP DATABASE [Order] TO DISK = N'C:\Program
> Files\Microsoft SQL Server\MSSQL\BACKUP\Orderback' WITH
> INIT , NOUNLOAD , NAME = N'Order backup', NOSKIP ,
> STATS = 10, NOFORMAT
> This is my restore:
> restore database [order]
> filegroup = 'primary', filegroup = 'ORDER1', filegroup
> = 'ORDER2'
> from disk='c:\Program Files\Microsoft SQL
> Server\MSSQL\BACKUP\Orderback'
> with file=1,norecovery,partial,replace,
> move 'order_data' to 'c:\program files\microsoft sql
> server\mssql\data\order_data.mdf',
> move 'order_data1' to 'c:\program files\microsoft sql
> server\mssql\data\order_data1.ndf',
> move 'order_data2' to 'c:\program files\microsoft sql
> server\mssql\data\order_data2.ndf',
> move 'order_log' to 'c:\program files\microsoft sql
> server\mssql\data\order_log.ldf'
> go
> restore log [order]
> from disk='c:\Program Files\Microsoft SQL
> Server\MSSQL\BACKUP\Orderback'
> with file=1,recovery
> go|||ooops - I missed that the restore db didn't have recovery option..
Regards,
Greg Linwood
SQL Server MVP
"Kalen Delaney" <replies@.public_newsgroups.com> wrote in message
news:%238XCQEgAEHA.1420@.TK2MSFTNGP11.phx.gbl...
> Paul
> Although Greg said the restore database will "will fully restore the
> database and log entries in that file", he meant it COULD do the full
> restore, but only if you specify the keyword RECOVERY. The default is not
to
> run recovery, with the assumption that you will first be applying more
logs.
> Recovery needs to be run with the last thing you're restoring.
> Use the recovery option on your RESTORE DATABASE command and you won't
need
> to restore any logs.
> --
> HTH
> --
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
> <anonymous@.discussions.microsoft.com> wrote in message
> news:6cca01c401fd$90a802a0$a301280a@.phx.gbl...
>|||Thank you very much.