|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Partial restore without restoring PRIMARY FG
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. >I previously posted a question on how to restore a single filegroup You don't. That would leave you with a database which is potentially >to > a database, leaving the others intact. 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*. -- Show quoteHide quoteTibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://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/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. > 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 OK, so lets say I restore to a new database. Can I do this from two> >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. separate backups? i.e. restore PRIMARY from backup one, and AUDITLOGS from backup two? Red. 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 OK, so lets say I restore to a new database. Can I do this from two> >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. separate backups? i.e. restore PRIMARY from backup one, and AUDITLOGS from backup two? Red.
Other interesting topics
Problems with NOEXPAND
SQL 2008: How to recursive Procedure for parentNavigation? Command to quit executing query through script Pending Reboot Requirement Transaction Log Backups Using xp_delete_file to delete rar files Lost my CD Windows NT Login in SQL Server 2000 sql2005 log file is full NVARCHAR Limit |
|||||||||||||||||||||||