SQL 什么是 NDF 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2707403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are NDF Files?
提问by Nasser Hadjloo
SQL Server uses MDF for data files and LDF for log files, but what are NDF files?
SQL Server 对数据文件使用 MDF,对日志文件使用 LDF,但什么是 NDF 文件?
Whats the benefits of these files?
这些文件有什么好处?
回答by Adriaan Stander
From Files and Filegroups Architecture
Secondary data files
二级数据文件
Secondary data files make up all the data files, other than the primary data file. Some databases may not have any secondary data files, while others have several secondary data files. The recommended file name extension for secondary data files is .ndf.
辅助数据文件构成了除主要数据文件之外的所有数据文件。一些数据库可能没有任何辅助数据文件,而其他数据库有几个辅助数据文件。辅助数据文件的推荐文件扩展名是 .ndf。
Also from file extension NDF - Microsoft SQL Server secondary data file
同样来自文件扩展名 NDF - Microsoft SQL Server 辅助数据文件
See Understanding Files and Filegroups
请参见了解文件和文件组
Secondary data files are optional, are user-defined, and store user data. Secondary files can be used to spread data across multiple disks by putting each file on a different disk drive. Additionally, if a database exceeds the maximum size for a single Windows file, you can use secondary data files so the database can continue to grow.
The recommended file name extension for secondary data files is .ndf.
辅助数据文件是可选的,是用户定义的,并存储用户数据。通过将每个文件放在不同的磁盘驱动器上,辅助文件可用于跨多个磁盘传播数据。此外,如果数据库超过单个 Windows 文件的最大大小,您可以使用辅助数据文件,以便数据库可以继续增长。
辅助数据文件的推荐文件扩展名是 .ndf。
/
/
For example, three files, Data1.ndf, Data2.ndf, and Data3.ndf, can be created on three disk drives, respectively, and assigned to the filegroup fgroup1. A table can then be created specifically on the filegroup fgroup1. Queries for data from the table will be spread across the three disks; this will improve performance. The same performance improvement can be accomplished by using a single file created on a RAID (redundant array of independent disks) stripe set. However, files and filegroups let you easily add new files to new disks.
例如,可以在三个磁盘驱动器上分别创建三个文件Data1.ndf、Data2.ndf 和Data3.ndf,并分配给文件组fgroup1。然后可以专门在文件组 fgroup1 上创建一个表。对表中数据的查询将分布在三个磁盘上;这将提高性能。通过使用在 RAID(独立磁盘冗余阵列)条带集上创建的单个文件,可以实现相同的性能改进。但是,文件和文件组可让您轻松地将新文件添加到新磁盘。
回答by Daniel Vassallo
Secondary data files are optional, are user-defined, and store user data. Secondary files can be used to spread data across multiple disks by putting each file on a different disk drive. Additionally, if a database exceeds the maximum size for a single Windows file, you can use secondary data files so the database can continue to grow.
辅助数据文件是可选的,是用户定义的,并存储用户数据。通过将每个文件放在不同的磁盘驱动器上,辅助文件可用于跨多个磁盘传播数据。此外,如果数据库超过单个 Windows 文件的最大大小,您可以使用辅助数据文件,以便数据库可以继续增长。
Source: MSDN: Understanding Files and Filegroups
The recommended file name extension for secondary data files is .ndf
, but this is not enforced.
辅助数据文件的推荐文件扩展名是.ndf
,但这不是强制执行的。
回答by Jason Clark
An NDF file is a user defined secondary database file of Microsoft SQL Server with an extension .ndf, which store user data. Moreover, when the size of the database file growing automatically from its specified size, you can use .ndf file for extra storage and the .ndf file could be stored on a separate disk drive. Every NDF file uses the same filename as its corresponding MDF file. We cannot open an .ndf file in SQL Server Without attaching its associated .mdf file.
NDF 文件是用户定义的 Microsoft SQL Server 的辅助数据库文件,扩展名为 .ndf,用于存储用户数据。此外,当数据库文件的大小从其指定大小自动增长时,您可以使用 .ndf 文件进行额外存储,并且 .ndf 文件可以存储在单独的磁盘驱动器上。每个 NDF 文件都使用与其对应的 MDF 文件相同的文件名。如果不附加其关联的 .mdf 文件,我们将无法在 SQL Server 中打开 .ndf 文件。