SQL Server filegroups and partitions

Source: Internet
Author: User

In one of the most streamlined SQL Server databases, two operating system files are included: Data files and log files.

Data files contain data and some objects, such as tables, indexes, stored procedures, views, etc.;

The log file contains information for recovering a database transaction.

Database files

There are three types of files in the SQL Server database.

Primary files, each database has a primary file that uses the. mdf extension.

Secondary files, secondary files are optional, user-defined. Secondary files can be distributed across different disks, different hard disks, which can be used to break the system's limits on file size, or to promote I/O, using the. ndf extension.

Transaction log files, each database has at least one log file, and the saved log information is used to recover the database using the. ldf extension.

For example, a simple database can be created to contain a primary file and a log file, all the data and objects are placed in the main file; a slightly more complex database can create a primary file, five secondary files, all the data and objects distributed among the six files, And the transaction information is logged by multiple log files.

By default, the data and logs are stored on the same drive in the same path, which is used to correspond to the single-drive system. However, in a production environment, this is not the optimal choice, it is recommended to put the data and logs on different hard disks.

SQL Server filegroups and partitions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.