Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Restored Database - But Filegroup is Not Available

Author  Topic 

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2011-05-11 : 17:28:51
hi experts,

I'm trying to restore a 2008 backup to a 2008 server where it has never existed. This db uses separate filegroups for the indexes. Also, the original db was in "2005 compatibility" mode but was on SQL Server 2008.

This is how I restored onto a different 2008 instance:

RESTORE DATABASE WFCDBMesaba FILEGROUP='PRIMARY'
FROM DISK = 'E:\Mesaba\MESABA KRONOS BACKUP.BAK'
WITH PARTIAL, NORECOVERY, MOVE N'tkcsdb_Data' TO N'E:\Microsoft SQL Server\Data\WFCDBMesaba_data.mdf',
MOVE N'tkcsdb_log' TO 'E:\Microsoft SQL Server\Data\WFCDBMesaba_log.ldf';

RESTORE DATABASE WFCDBMesaba FILEGROUP='tkcs1'
FROM DISK = 'E:\Mesaba\MESABA KRONOS BACKUP.BAK'
WITH PARTIAL, NORECOVERY, MOVE N'tkcsdb_data_tkcs1' TO N'E:\Microsoft SQL Server\Data\WFCDBMesaba_data1.ndf',
MOVE N'tkcsdb_log' TO 'E:\Microsoft SQL Server\Data\WFCDBMesaba_log.ldf';

RESTORE DATABASE WFCDBMesaba FILEGROUP='tkcs2'
FROM DISK = 'E:\Mesaba\MESABA KRONOS BACKUP.BAK'
WITH RECOVERY, MOVE N'tkcsdb_data_tkcs2' TO N'E:\Microsoft SQL Server\Data\WFCDBMesaba_data2.ndf',
MOVE N'tkcsdb_log' TO 'E:\Microsoft SQL Server\Data\WFCDBMesaba_log.ldf';

From what I see in Management Studio, the db looks to be OK.


*** But when I try to query a table, I get this error:

"Filegroup tkcs2 is unavailable because it is offline. Restore or alter the filegroup to be available" ***

Do I need to run an Alter Filegroup statement or ??

Thanks for any ideas. John
   

- Advertisement -