sys.sysfiles (Transact-SQL)sys.sysfiles (Transact-SQL)

本主题适用于:yesSQL Server(从 2008 开始)noAzure SQL 数据库noAzure SQL 数据仓库no并行数据仓库THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

数据库中的每个文件对应一行。Contains one row for each file in a database.


将此 SQL Server 2000 系统表作为一个视图包含进来是为了保持向后兼容性。This SQL Server 2000 system table is included as a view for backward compatibility. 建议您改用当前的 SQL Server 系统视图。We recommend that you use the current SQL Server system views instead. 若要查找一个或多个等效系统视图,请参阅将系统表映射到系统视图 (Transact-SQL)To find the equivalent system view or views, see Mapping System Tables to System Views (Transact-SQL). 后续版本的 Microsoft SQL Server 将删除该功能。This feature will be removed in a future version of Microsoft SQL Server. 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

列名Column name 数据类型Data type DescriptionDescription
fileidfileid intsmallint 每个数据库的唯一文件标识号。File identification number unique for each database.
groupidgroupid intsmallint 文件组标识号。File group identification number.
sizesize intint 文件大小(8 KB 页)。Size of the file, in 8-KB pages.
最大大小maxsize intint 最大文件大小(以 8 KB 为单位的页)。Maximum file size, in 8-KB pages.

0 = 无增长。0 = No growth.

-1 = 文件将一直增长到磁盘充满为止。-1 = File will grow until the disk is full.

268435456 = 日志文件将增长到最大大小 2 TB。268435456 = Log file will grow to a maximum size of 2 TB.

注意: 无限制的日志文件大小与升级的数据库将报告为-1 的日志文件的最大大小。Note: Databases that are upgraded with an unlimited log file size will report -1 for the maximum size of the log file.
增长growth intint 数据库的增长大小。Growth size of the database. 可以是页面数,或是文件大小,具体取决于值的百分比状态Can be either the number of pages or the percentage of file size, depending on value of status.

0 = 无增长。0 = No growth.
statusstatus intint 有关 bits 状态增长以兆字节 (MB) 或千字节 (KB) 的值。Status bits for the growth value in either megabytes (MB) or kilobytes (KB).

0x2 = 磁盘文件。0x2 = Disk file.

0x40 = 日志文件。0x40 = Log file.

0x100000 = 增长。0x100000 = Growth. 该值是百分比,不是页数。This value is a percentage and not the number of pages.
perfperf intint 保留。Reserved.
名称name sysnamesysname 文件的逻辑名称。Logical name of the file.
filenamefilename nvarchar(260)nvarchar(260) 物理设备的名称。Name of the physical device. 这包括文件的完整路径。This includes the full path of the file.

另请参阅See Also

将系统表映射到系统视图(Transact SQL) Mapping System Tables to System Views (Transact-SQL)
兼容性视图 (Transact SQL)Compatibility Views (Transact-SQL)