SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Restoring database - Filegroups


Restoring database - Filegroups

Author
Message
jeelanik
jeelanik
SSC-Enthusiastic
SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)

Group: General Forum Members
Points: 159 Visits: 140
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.



Josh B
Josh B
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1684 Visits: 9265
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.
jeelanik
jeelanik
SSC-Enthusiastic
SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)

Group: General Forum Members
Points: 159 Visits: 140
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.



ALZDBA
ALZDBA
One Orange Chip
One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)One Orange Chip (29K reputation)

Group: General Forum Members
Points: 29055 Visits: 8986
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


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- 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 :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search