What are mdf,ldf and ndf in sql server

In sql server data and log information are never stored in a single file.
So we can devide the whole sql files into 3 .

Primary data files

Primary data file is the starting point of the database. It points to the other files in the database. Therefore, every database has one primary data file. Also, all the data in the database objects (tables, stored procedures, views, triggers.. etc.) are stored in the primary data files. This is indicated by .mdf

Secondary data files

You can only have one primary data file for a database. Rest made up by secondary data files. But its not necessary to have a secondary data file. Therefore some databases may not have any secondary data file. But its also possible to have multiple secondary data files for a single database. It is indicated by .ndf.

Log files

Log files are used to store all the log information. These log files can be used to recover databases in later.

           when you create database all the data in the files are stored in the .mdf file and all the transactions or manipulationsare stored in the .ldf files.

Comments

Post a Comment

Popular posts from this blog

Introduction To Oracle10g

Insert

Except