Check data in secondary files

  • this is my scenario,

    I have a db consists of 10 .ndfs , i want to remove one of the .ndf file lets say 7 , how can we find whether the file conatins any data or objects and how to remove the file

  • Is each file in its own filegroup, or are they all in one filegroup, or something in between?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • all files belongs to the same file group

  • Then all tables in that filegroup would have been striped across all files.

    Shrinkfile with the Emptyfile option. Make sure there's enough space in the other files.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • thanks for ur response , if the secondary files belongs to different groups i.e one .ndf belongs to one file group , then how to check the data .

  • Query sys.allocation_units and sys.data_spaces, identify the affected indexes and create ... with drop existing on different filegroup.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply