November 12, 2011 at 12:59 pm
I am playing with peacemeal restore.
I am trying to restore a readonly filegroup. If i restore it and recover immediately, everything works as expected and I can select from tables on that Filegroup.
Restore Database BackupTests Filegroup='FG3'
FROM DISK=N'C:\SQLServerFiles\BackupTests\backups\backuptests_Partial_All'
WITH RECOVERY
If i try to recover later it does not work, giving the following error
Restore Database BackupTests Filegroup='FG3'
FROM DISK=N'C:\SQLServerFiles\BackupTests\backups\backuptests_Partial_All'
WITH NORECOVERY
RESTORE Database BackupTests Filegroup='FG3' with RECOVERY
The file or filegroup "FG3" is not in a valid state for the "Recover Data Only" option to be used. Only secondary files in the OFFLINE or RECOVERY_PENDING state can be processed.
Ive tried restoring the transaction log before recovery but it still does not work.
Any idea why this is?
November 12, 2011 at 1:59 pm
Which statement fails? The restore of the filegroup or the restore of the DB with recovery?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 12, 2011 at 2:44 pm
of the second code block, this part fails with the error listed previously:
RESTORE Database BackupTests Filegroup='FG3' with RECOVERY
November 12, 2011 at 3:49 pm
What about just RESTORE DATABASE <dbname> WITH RECOVERY ?
I know that's what you run after a page restore if the last log restore isn't run WITH RECOVERY.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 12, 2011 at 3:51 pm
Yep, that worked, thanks Gail! fantastically helpful as always!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply