Home All Groups Group Topic Archive Search About

Partial restore without restoring PRIMARY FG



Author
16 Dec 2008 2:03 PM
subs
I previously posted a question on how to restore a single filegroup to
a database, leaving the others intact.

http://groups.google.co.uk/group/microsoft.public.sqlserver.server/browse_thread/thread/5f0f39655702bc88?hl=en

Put simply, Live Db with two filegroups, PRIMARY and AUDITLOGS.  When
copying databases from live to test, AUDITLOGS is about 90% of the
database size.  So I'm taking a filegroup backup of PRIMARY only and
copying to the test server.  I then restore using:

RESTORE DATABASE MyDatabase
FILEGROUP = 'PRIMARY'
FROM
DISK = 'F:\SQL_Backups\MyDatabase_PRIMARY.bak'
WITH
PARTIAL, FILE = 1
GO

This restores PRIMARY ok, but leaves AUDITLOGS offline.  My
understanding is that the only way to bring AUDITLOGS back online is
to do a restore.  However, when doing a PARTIAL restore, it will
restore the primary FG by default.  So how can I bring AUDTLOGS back
online???

Pulling my hair out over this one!  Any help appreciated.

Thanks,

Red.

Author
16 Dec 2008 2:34 PM
Tibor Karaszi
>I previously posted a question on how to restore a single filegroup
>to
> a database, leaving the others intact.

You don't. That would leave you with a database which is potentially
from different points in time. That could be disastrous from a data
integrity viewpoint (both user-data and possibly also meta-data).
I.e., SQL Server will not allow this.

What you *can* do is to restore the primary and possibly other as
well, but leaving out one or more non-primary filegroups *to a new
database name*.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


<s***@gambool.com> wrote in message
Show quoteHide quote
news:10958d0a-d8b1-4a84-9a87-bbeeec2bd36c@r37g2000prr.googlegroups.com...
>I previously posted a question on how to restore a single filegroup
>to
> a database, leaving the others intact.
>
> http://groups.google.co.uk/group/microsoft.public.sqlserver.server/browse_thread/thread/5f0f39655702bc88?hl=en
>
> Put simply, Live Db with two filegroups, PRIMARY and AUDITLOGS.
> When
> copying databases from live to test, AUDITLOGS is about 90% of the
> database size.  So I'm taking a filegroup backup of PRIMARY only and
> copying to the test server.  I then restore using:
>
> RESTORE DATABASE MyDatabase
> FILEGROUP = 'PRIMARY'
> FROM
> DISK = 'F:\SQL_Backups\MyDatabase_PRIMARY.bak'
> WITH
> PARTIAL, FILE = 1
> GO
>
> This restores PRIMARY ok, but leaves AUDITLOGS offline.  My
> understanding is that the only way to bring AUDITLOGS back online is
> to do a restore.  However, when doing a PARTIAL restore, it will
> restore the primary FG by default.  So how can I bring AUDTLOGS back
> online???
>
> Pulling my hair out over this one!  Any help appreciated.
>
> Thanks,
>
> Red.
>
Are all your drivers up to date? click for free checkup

Author
17 Dec 2008 3:48 PM
subs
On 16 Dec, 14:34, "Tibor Karaszi"
<tibor_please.no.email_kara***@hotmail.nomail.com> wrote:
Show quoteHide quote
> >I previously posted a question on how to restore a single filegroup
> >to
> > a database, leaving the others intact.
>
> You don't. That would leave you with a database which is potentially
> from different points in time. That could be disastrous from a data
> integrity viewpoint (both user-data and possibly also meta-data).
> I.e., SQL Server will not allow this.
>
> What you *can* do is to restore the primary and possibly other as
> well, but leaving out one or more non-primary filegroups *to a new
> database name*.
>
> --
> Tibor Karaszi, SQL Server MVPhttp://www.karaszi.com/sqlserver/default.asphttp://sqlblog.com/blogs/tibor_karaszi
>
> <s***@gambool.com> wrote in message
>
> news:10958d0a-d8b1-4a84-9a87-bbeeec2bd36c@r37g2000prr.googlegroups.com...
>
> >I previously posted a question on how to restore a single filegroup
> >to
> > a database, leaving the others intact.
>
> >http://groups.google.co.uk/group/microsoft.public.sqlserver.server/br...
>
> > Put simply, Live Db with two filegroups, PRIMARY and AUDITLOGS.
> > When
> > copying databases from live to test, AUDITLOGS is about 90% of the
> > database size.  So I'm taking a filegroup backup of PRIMARY only and
> > copying to the test server.  I then restore using:
>
> > RESTORE DATABASE MyDatabase
> > FILEGROUP = 'PRIMARY'
> > FROM
> > DISK = 'F:\SQL_Backups\MyDatabase_PRIMARY.bak'
> > WITH
> > PARTIAL, FILE = 1
> > GO
>
> > This restores PRIMARY ok, but leaves AUDITLOGS offline.  My
> > understanding is that the only way to bring AUDITLOGS back online is
> > to do a restore.  However, when doing a PARTIAL restore, it will
> > restore the primary FG by default.  So how can I bring AUDTLOGS back
> > online???
>
> > Pulling my hair out over this one!  Any help appreciated.
>
> > Thanks,
>
> > Red.

OK, so lets say I restore to a new database.  Can I do this from two
separate backups?  i.e. restore PRIMARY from backup one, and AUDITLOGS
from backup two?

Red.
Author
18 Dec 2008 10:26 AM
Tibor Karaszi
You should be able to do that, but the database will not be accessible
until you restored both and synch'd them with log restore. Make sure
you practice well before any type of production...

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


<s***@gambool.com> wrote in message
news:3f184868-f897-44b2-80c8-74419c5fa6c4@w1g2000prm.googlegroups.com...
On 16 Dec, 14:34, "Tibor Karaszi"
<tibor_please.no.email_kara***@hotmail.nomail.com> wrote:
Show quoteHide quote
> >I previously posted a question on how to restore a single filegroup
> >to
> > a database, leaving the others intact.
>
> You don't. That would leave you with a database which is potentially
> from different points in time. That could be disastrous from a data
> integrity viewpoint (both user-data and possibly also meta-data).
> I.e., SQL Server will not allow this.
>
> What you *can* do is to restore the primary and possibly other as
> well, but leaving out one or more non-primary filegroups *to a new
> database name*.
>
> --
> Tibor Karaszi, SQL Server
> MVPhttp://www.karaszi.com/sqlserver/default.asphttp://sqlblog.com/blogs/tibor_karaszi
>
> <s***@gambool.com> wrote in message
>
> news:10958d0a-d8b1-4a84-9a87-bbeeec2bd36c@r37g2000prr.googlegroups.com...
>
> >I previously posted a question on how to restore a single filegroup
> >to
> > a database, leaving the others intact.
>
> >http://groups.google.co.uk/group/microsoft.public.sqlserver.server/br...
>
> > Put simply, Live Db with two filegroups, PRIMARY and AUDITLOGS.
> > When
> > copying databases from live to test, AUDITLOGS is about 90% of the
> > database size. So I'm taking a filegroup backup of PRIMARY only
> > and
> > copying to the test server. I then restore using:
>
> > RESTORE DATABASE MyDatabase
> > FILEGROUP = 'PRIMARY'
> > FROM
> > DISK = 'F:\SQL_Backups\MyDatabase_PRIMARY.bak'
> > WITH
> > PARTIAL, FILE = 1
> > GO
>
> > This restores PRIMARY ok, but leaves AUDITLOGS offline. My
> > understanding is that the only way to bring AUDITLOGS back online
> > is
> > to do a restore. However, when doing a PARTIAL restore, it will
> > restore the primary FG by default. So how can I bring AUDTLOGS
> > back
> > online???
>
> > Pulling my hair out over this one! Any help appreciated.
>
> > Thanks,
>
> > Red.

OK, so lets say I restore to a new database.  Can I do this from two
separate backups?  i.e. restore PRIMARY from backup one, and AUDITLOGS
from backup two?

Red.

Bookmark and Share