0

我已经将一些数据从一个文件组移动到另一个文件组,但是当我使用 master.sys.xp_fixeddrives 检查驱动器时,驱动器并没有说它的大小已经改变。

我想知道如何检查文件组物理存储在哪个驱动器上。

谢谢

4

1 回答 1

0

Filegroups are made up of a collection of files, all of which could be on separate drives, partitions, mount points, smb shares, etc. The filegroup doesn't exist anywhere but logically, you want to know where the file inside of the filegroup reside.

Below can be run to give you the information you are looking for in terms of where the files are in that filegroup. Optionally you can omit the where clause to see all of the files and filegroups, where the files reside. It will need to be run in the context of the database in question.

SELECT f.name AS [FGName], df.name AS [FileName], LEFT(df.physical_name, 1) AS [Drive]
    , df.physical_name AS [Full_Path]
FROM sys.database_files df 
    inner join sys.filegroups f 
        on df.data_space_id = f.data_space_id
WHERE f.name = 'MyFilegroupNameHere'
于 2014-06-25T23:10:30.180 回答