如何在sql 2012中将脱机文件组置于联机状态 [英] How to bring offline filegroup to online status in sql 2012
问题描述
HI那里,
我有一个数据库,其辅助文件Testdb_file1.ndf驻留在辅助文件组FG1上,其上有几个表格。
一些文件组如何脱机...现在无法访问此文件组中的表...
I have a database that has secondary file Testdb_file1.ndf residing on secondary filegroup FG1 which has few tables on it
some how this filegroup has gone offline ...now not able to access tables that are in this filegroup...
如何将fg1上的此文件带到在线....
how to bring this file on fg1 to online....
alter
database
TestDB
modify
file(
name
=
'TestDB_File1'
,online) - - 这会给出错误
alter
database
TestDB
modify
file (
name
=
'TestDB_File1'
, online)---this gives error
srm_2010
推荐答案
您好srm_2010,
来自您的描述,请你尝试使用下面的T-SQL将文件联机。
Hi srm_2010,
From your description, could you please try to use below T-SQL to bring the file online.
use master
go
restore database databasename file='filename' with recovery
顺便说一下,你可以使用下面的T-SQL检查文件状态。
By the way, you can use the below T-SQL to check the file state.
use databasename
go
select * from sys.database_files
希望这对你有所帮助。
祝你好运,
Cathy Ji
Hope this help you.
Best regards,
Cathy Ji
这篇关于如何在sql 2012中将脱机文件组置于联机状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!