Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Restoring database - Filegroups Expand / Collapse
Author
Message
Posted Thursday, September 30, 2010 12:33 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 10:40 AM
Points: 19, Visits: 115
I am restoring a database, one filegroup at a time.

I get the following error when I am restoring the second filegroup. I have totally x filegroups to restore.

The database can not be brought online because file 'Databasenamedata1' is currently restored to LSN 265000005575300001 but must be restored to LSN 265000005572900001.

I am not sure as to how I could avoid this error.

Info:
I am have backed up and restored "Primary" filegroup. Database was online until I tried to restore the "DATA" filegroup after restoring the primary filegroup.

More Info:
My Backup script:
BACKUP DATABASE Databasename
FILEGROUP = 'DATA'
TO DISK = 'C:\Databasenamedata.bak'
GO

My restore Script:
RESTORE DATABASE Databasename
FILE = 'Databasenamedata1'
FROM DISK = 'C:\Databasenamedata.bak'

WITH MOVE 'Databasenamedata1' TO 'c:\DatabasenameTSTdata1.ndf'
, replace
GO


Thanks.




Post #996175
Posted Thursday, September 30, 2010 2:38 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, August 29, 2014 12:10 PM
Points: 1,211, Visits: 7,711
I believe that you need to specify the WITH PARTIAL, NORECOVERY option when restoring mulitiple file groups. I've used something like...

RESTORE [database]
FILE = [filename]
FROM DISK 'C:\PathOfBackupFile.bak'
WITH PARTIAL, NORECOVERY
MOVE [filename] TO 'C:\NewPath.mdf.'

That would get the primary restored, but leave the database in Recovery so you can restore the rest of your filegroups and any tran logs before using the WITH RECOVERY to bring the database up.
Post #996293
Posted Friday, October 1, 2010 8:45 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, July 8, 2014 10:40 AM
Points: 19, Visits: 115
Thanks for your guidance.

I was wondering if I could bring the database up with Primary filegroup and open it to the users while I add the remaining filegroups (while the database is open to the users)

Thank you.



Post #996717
Posted Friday, October 1, 2010 1:14 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, August 28, 2014 12:47 AM
Points: 7,005, Visits: 8,451
What your are trying to do is a piecemeal restore.
(ent edtn / dev edtn needed )
ref: http://msdn.microsoft.com/en-us/library/ms177425.aspx


Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #996947
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse