Solved

Why we need secondary data files in SQL server?

Posted on 2009-05-07
7
734 Views
Last Modified: 2012-08-13
Why we need secondary datafiles in the database? What are thier advantages? Also why we need multiple secondary files?
0
Comment
Question by:asqldba
  • 4
7 Comments
 
LVL 21

Accepted Solution

by:
Tapan Pattanaik earned 250 total points
ID: 24332029

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.

For more details check this below link:

http://msdn.microsoft.com/en-us/library/ms179316.aspx
0
 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 24332040

hi asqldba,
                 Check these links ,
             

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.

For more details check this below link:

http://msdn.microsoft.com/en-us/library/ms179316.aspx

http://www.dotnetspider.com/resources/19525-Database-Files-SQL-Server.aspx
0
 

Author Comment

by:asqldba
ID: 24332243
I do understand that there are 3 type of file: Primary, Secondary and Log. My question is why we need secondary data files? Why can't we just keep just two? MDF and LDFs are needed but why we need NDF?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 24332345
hi asqldba,

The big question now is why do we need secondary database files when I can store data in primary database files?

Well this has certain advantages and disadvantages. The main disadvantage of multiple database files is administration. You need to remember these different files, their locations, and their use. The main advantage is that you can place these files on separate physical hard disks, avoiding the creation of hot spots and thereby improving performance. When you use database files, you can back up individual database files rather than the whole database in one session.
0
 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 24332398
0
 
LVL 6

Assisted Solution

by:Jerryuk007
Jerryuk007 earned 250 total points
ID: 24333679
The main reason I see as having multiple data files is so you can split a large database across multiple drives, or separate indexes, etc... for better performance. Or backup the database in "steps" (as mentioned above)

On small to average size database, I would generally use just one data file and one log file (there are of course a few exceptions...)

Jerry
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now