2013-03-08 50 views
3

在工作中,我们将为我们的客户存储媒体,例如视频,高清照片和音频,我建议使用SQL FILESTREAM来存储此类媒体。处理SQL FILESTREAM数据损坏和备份

这种方法的一个主要问题是如果FILEGROUP被破坏会发生什么?

  • 这会影响数据库或其功能吗?
  • 会有数据可能被破坏的警告吗?
  • 备份损坏的FILEGROUPS数据库会引发任何警告吗?还是只是正常备份?
  • 如果可以使用损坏的数据进行备份,那么恢复如何?

我们应该考虑的其他问题?

+0

的SQL Server版本这是怎么回事上运行? – 2013-03-16 18:20:10

回答

1

请阅读CIL。

这种方法的一个主要问题是如果FILEGROUP被破坏会发生什么?

A: If Filestream Filegroup corrupted, then you database will be in "recovery pending" 
status, just like other filegroup corrupted. But almost only one kind of corruption
of FileStream FileGroup can happen, which is hdr corrupted, which is kind of
dictionary file, saving file header information.

•这是否会影响数据库或其功能?

A: Yes, this will leave your database not functional.

•会不会有数据可能被破坏的警告?

A: No, if just data is corrupted in your BLOB files, there is no warning. 
Actually those just binary files, I can't think a scenario it can be corrupted.

•使用损坏的FILEGROUPS备份数据库是否会引发任何警告?还是只是正常备份?

A: If the Filestream FileGroup is corrupted, your database is not functional,
you have to restore the database.

•如果可以使用损坏的数据进行备份,那么Restore呢?

A: Backup can't be made with corrupted data, maybe dirty data possible,
but dirty data still is legal data. When I say dirty data, for example,
someone has permission to your filestream in SQL Server will also have the
permission to your BLOB files, they can directly update the BLOB file content,
which may involve some dirty data.
As of other concerns, you need to do full backup/Differential backup/Tranlog backup 
of your database regularly, just in case disaster happens. Filegroup backup will not
help you.
0

如果你关心数据 - 就像你明显做的那样,根据这个问题 - 那么为什么putz呢?在数据库中声明BLOB列,并让DBMS处理您提出的问题。

有人,或许是你的团队中的某个人,可能反对这太慢了。首先,我挑战这个假设。其次,如果它经过测试并且速度太慢,无论如何都要做(!)并将FILESTREAM版本保留为外部缓存。这种方式转储/恢复可以忽略它,腐败/删除可以纠正一个SELECT声明。