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)
 How can I drop a offline filestream?

Author  Topic 

jb23
Starting Member

5 Posts

Posted - 2014-03-13 : 08:48:09
Hi

I have a database that missing the filestream data because the filestream folder was deleted. The data of the filestream is not important. So I don't need repair.

But now I can't use the Table that using the filestream. Always I get:
quote:

Meldung 670, Ebene 16, Status 1, Zeile 1
LOB-Daten (Large Object) für die dbo.Test-Tabelle befinden sich in einer Offlinedateigruppe ('TestFG') auf die kein Zugriff möglich ist.



I tried to drop the column but I got the message that the filegroup is offline.

Then I tried to drop the filestream from the db and got following message

quote:
Der Systemprotokoll-Datensatz '$RECYCLE.BIN' der FILESTREAM-Datei unter dem Protokollordner '' ist beschädigt. (Microsoft SQL Server, Fehler: 5511)



The state of the filestream is RECOVERY_PENDING


SELECT *
FROM sys.database_files
WHERE type = 2





To get the same issue you need a db with Filestream enabled and with filestream data in a table. Then make a backup without filestream:


BACKUP DATABASE [FSDB]
FILEGROUP = 'PRIMARY'
TO DISK = 'C:\fsdb.bak' WITH INIT


Then restore it


RESTORE FILELISTONLY
from DISK = N'c:\fsdb.bak'

RESTORE Database test2
FILE='FSDB',
Filegroup = 'PRIMARY'
from DISK = N'C:\fsdb.bak'
WITH MOVE 'FSDB' TO 'c:\fsdb.mdf',
MOVE 'FSDB_log' TO 'c:\fsdb.ldf'





I only want to remove or replace the filestream or filegroup so that I can make an "SELECT * FROM test" without error.

Please, can someone help me?

Regards, Lars
   

- Advertisement -