Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2016 April SQL Server: The internal storage architecture of the Database Files

SQL Server: The internal storage architecture of the Database Files

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

Here, I am sharing one of the important topics for the internal Storage File Architecture of the SQL Server.

SQL Server is managing two different kinds of files one is for Data and other is for Log information.
The File-groups is a collection of database files, and it helps to manage database files.

Type of the SQL Server Database Files.

Primary Data File (.mdf):

The Primary Data File is starting point of the database and also points to the other files.

Each database has only one primary data file, and it stores all the tables, indexes, views, functions, and other database objects.

It also contains information about the location of all other files.
The default extension of this data file is .mdf.

Secondary Data File (.ndf):

When database exceeds the maximum allocated size, Secondary Data File helps the database to continue to grow. The extension of this file is .ndf.
This is not mandatory to create this file for each database.

When we are configuring table partitions, we can create separately .ndf file to store partition data.

Log File (.ldf):

This file contains all transaction log information of a database which helps us to recover an entire database in case of any loss.
The Database Transactions are written to the log file even before they are written to the data file.



All the database file can grow automatically from their specified size and if we have not specified default size, it can continue to grow until the disk full.

The Filegroup is a logical container of the database files, and the Primary Filegroup is a default Filegroup which contains a primary data and log file of a database.
If there are multiple files in a Filegroup, they will not auto-grow until all the files are full.

Apr 12, 2016Anvesh Patel
Database Design: The Ultimate Strategies to avoid DeadlockSQL Server: The Internal Structure of the Data Page
Comments: 2
  1. Max
    December 28, 2017 at 2:55 pm

    Dear,
    If I have three datafiles of the same groupfile with free space, SQL Server sequentially fills the datafiles? How are the spaces organized? Does having several datafiles affect performance?
    Thank you

    • Anvesh Patel
      Anvesh Patel
      December 28, 2017 at 6:54 pm

      Yes, more data files will degrade the performance. SQL Server filling data files sequential and later DBA can identify free data pages and can do schedule the maintenance.
      Check other related articles, it may help you

      https://www.dbrnd.com/2017/07/sql-server-practical-example-of-exceeding-the-maximum-row-size-of-8060/

      https://www.dbrnd.com/2016/12/sql-server-index-performance-tuning-with-the-fill-factor/

Anvesh Patel
Anvesh Patel

Database Engineer

April 12, 2016 SQL ServerAnvesh Patel, database, database research and development, dbrnd, log file, primary data file, secondary data file, SQL Query, SQL Server, SQL Server Administrator, SQL Server Monitoring, SQL Server Performance Tunning, SQL Server Tips and Tricks, TSQL
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....