0

I'm not a db administrator but from a quick search I found .NDF files are secondary data files. I'm curious to know under what conditions the .NDF files are generated ? If it is generated, how we can know which data base is behind it ?

2

You have a database with a datafile(PRIMARY) in a filegroup(PRIMARY) which stores metadata as well as user data. When you reach the maximum size of the datafile(depended on underlying Operating System) then you need to add an extra file which is know as secondary data file. According to the reference, datafile can grow up to 16TB, so for normal sized database this situation may no arise. So it's optional to have any secondary datafiles.

However, these can be used to spread data across multiple disks by putting each file on a different disk drive.

I'm curious to know under what conditions the .NDF files are generated ?

When you add extra datafiles on a database.

If it is generated, how we can know which data base is behind it ?

It is added on A DATABASE. So you need to know database first in order to add the secondary data files. If you know that database then you can know the it's datafiles.

More details and useful links are given here

  • 1
    About twelve NDF files are generated and the name is tempdb1.ndf, tempdb2.ndf etc and having tempdb.mdf and tempdb.ldf. Is there anyway to know which db in the server causing this generation. I tried to 'attach', and receiving 'using by another process' error. – Rauf Apr 16 '17 at 8:19
  • As their name's suggest, these belongs to tempdb – JSapkota Apr 16 '17 at 8:33
  • @JSapkota - any idea why? There are 8 of them on my system, all 142 606 336 bytes. Why is there not just a single tempdb.mdf file? – Reversed Engineer Jul 25 '18 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.