Wednesday, March 7, 2012

Restoring filegroups in 2005.

Howdy all. I want to be able to restore just 1 filegroup from a filegroup
backup, without having to restore the log afterwords even if the data has
changed post filegroup backup. While this would leave the data inconsistant,
it may be desired at times. From BOL:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/2f552700-efb3-48f1-b96d-c073
049100f0.htm
****************************************
********** ******
If the files have been modified after the file backup was created, execute
the RESTORE LOG statement to apply the transaction log backup, specifying:
The name of the database to which the transaction log will be applied.
The backup device from where the transaction log backup will be restored.
The NORECOVERY clause if you have another transaction log backup to apply
after the current one; otherwise, specify the RECOVERY clause.
The transaction log backups, if applied, must cover the time when the files
and filegroups were backed up until the end of log (unless ALL database file
s
are restored).
****************************************
********** ******
But thats just it, I may not want to take this action. Maybe some data got
deleted from a set of tables in a filegroup right after I took my last
filegroup backup, so I just want to restore that filegroup back to that
backup, but leave my other filegroups alone. Restoring the log brings the
data back to a consistant state when the log was backed up, which may not be
what I want.
Can this be accomplished?
TIA, ChrisRThe short answer is that SQL Server will not assist in providing you with an
inconsistent database.
A database would be inconsistent if different parts of it are from different
points in time. And
this is indeed what you want to achieve.
Your option is to restore this filegroup backup to a new database (using the
PARTIAL option of the
restore command - see BOL for details), and then copy over the relevant data
to your production
database.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
news:5774CAB8-3FAC-4DF6-BCF8-1FA12E73559E@.microsoft.com...
> Howdy all. I want to be able to restore just 1 filegroup from a filegroup
> backup, without having to restore the log afterwords even if the data has
> changed post filegroup backup. While this would leave the data inconsistan
t,
> it may be desired at times. From BOL:
> ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/2f552700-efb3-48f1-b96d-c0
73049100f0.htm
> ****************************************
********** ******
> If the files have been modified after the file backup was created, execute
> the RESTORE LOG statement to apply the transaction log backup, specifying:
> The name of the database to which the transaction log will be applied.
> The backup device from where the transaction log backup will be restored.
> The NORECOVERY clause if you have another transaction log backup to apply
> after the current one; otherwise, specify the RECOVERY clause.
> The transaction log backups, if applied, must cover the time when the file
s
> and filegroups were backed up until the end of log (unless ALL database fi
les
> are restored).
> ****************************************
********** ******
> But thats just it, I may not want to take this action. Maybe some data got
> deleted from a set of tables in a filegroup right after I took my last
> filegroup backup, so I just want to restore that filegroup back to that
> backup, but leave my other filegroups alone. Restoring the log brings the
> data back to a consistant state when the log was backed up, which may not
be
> what I want.
> Can this be accomplished?
> TIA, ChrisR|||That's what I thought.
Thanks Tibor.
"Tibor Karaszi" wrote:

> The short answer is that SQL Server will not assist in providing you with
an inconsistent database.
> A database would be inconsistent if different parts of it are from differe
nt points in time. And
> this is indeed what you want to achieve.
> Your option is to restore this filegroup backup to a new database (using t
he PARTIAL option of the
> restore command - see BOL for details), and then copy over the relevant da
ta to your production
> database.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "ChrisR" <ChrisR@.discussions.microsoft.com> wrote in message
> news:5774CAB8-3FAC-4DF6-BCF8-1FA12E73559E@.microsoft.com...
>
>

No comments:

Post a Comment