什么是 .mdf 文件?

发布于 2024-07-28 23:10:48 字数 1460 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

九命猫 2024-08-04 23:10:48

SQL Server 数据库使用两个文件 - 一个 MDF 文件(称为主数据库文件),其中包含架构和数据;以及一个 LDF 文件(包含日志)。 请参阅维基百科。 数据库还可以使用辅助数据库文件,该文件通常使用 .ndf 扩展名。

正如 John S. 所指出的,这些文件扩展名纯粹是约定俗成的 - 您可以使用任何您想要的扩展名,尽管我想不出这样做的充分理由。

有关 MSDN 的详细信息此处以及《Beginning SQL Server》 2005 管理(Google 图书)此处

SQL Server databases use two files - an MDF file, known as the primary database file, which contains the schema and data, and a LDF file, which contains the logs. See wikipedia. A database may also use secondary database file, which normally uses a .ndf extension.

As John S. indicates, these file extensions are purely convention - you can use whatever you want, although I can't think of a good reason to do that.

More info on MSDN here and in Beginning SQL Server 2005 Administation (Google Books) here.

oО清风挽发oО 2024-08-04 23:10:48

只是为了让所有人都清楚这一点:

.MDF 文件“通常”是 SQL Server 数据文件,但重要的是要注意,它不一定是。

这是因为 .MDF 只是推荐/首选符号,但扩展名本身并不实际指示文件类型。

为了说明这一点,如果有人想要创建扩展名为 .gbn 的主数据文件,他们可以继续这样做,不会出现任何问题。

要限定首选命名约定:

  • .mdf - 主数据库数据文件。
  • .ndf - 其他数据库数据文件,即
    非主要。
  • .ldf - 日志数据文件。

Just to make this absolutely clear for all:

A .MDF file is “typically” a SQL Server data file however it is important to note that it does NOT have to be.

This is because .MDF is nothing more than a recommended/preferred notation but the extension itself does not actually dictate the file type.

To illustrate this, if someone wanted to create their primary data file with an extension of .gbn they could go ahead and do so without issue.

To qualify the preferred naming conventions:

  • .mdf - Primary database data file.
  • .ndf - Other database data files i.e.
    non Primary.
  • .ldf - Log data file.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文