question

pits avatar image
pits asked

file group

Hello, what is relation between mdf and ldf.If my ldf is on drive C and mdf is on drive D.then in case of file group running out of space I need to create space on D.But in some of cases when I shrink ldf on C the file group space alert goes of autometically.what login is this? rgds, [Moderator edit] above line should read "what logi**c** is this?"
filegroup
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ThomasRushton avatar image ThomasRushton ♦♦ commented ·
Can you provide the exact error message you're getting? And what's giving it to you?
0 Likes 0 ·
ThomasRushton avatar image
ThomasRushton answered
The MDF is the SQL Server database data file; the LDF is the transaction log file. My first reaction would be to check that your backups are running properly - you should, as well as doing Full backups, be periodically backing up the transaction log (assuming your database isn't in SIMPLE recovery mode). If the TLogs are being backed up regularly, and you're still getting the problem, then it may be that either you've not got sufficient space for the TLog to grow itself (or you've disabled autogrowth), or you need to reconsider the frequency at which you're doing TLog backups, or you've got some outstanding transaction that's causing issues.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

TimothyAWiseman avatar image TimothyAWiseman commented ·
By default mdf is the primary database file for that db, ndf is traditionally used for additional files. http://msdn.microsoft.com/en-us/library/ms179316.aspx
1 Like 1 ·
Grant Fritchey avatar image Grant Fritchey ♦♦ commented ·
I typed too much. Good answer.
0 Likes 0 ·
Grant Fritchey avatar image
Grant Fritchey answered
If all you have are the two files then, by default, they work like this. The mdf is a data file. That's where all your data and structures and stored procedures, etc., are stored for the database in question. The ldf is a log file. That stores the transaction logs for the database. Every transaction gets written to the log. Then, depending on the recovery model, they either get cleaned off automatically (for Simple recovery) or you have to run a log backup (for Bulk Logged & Full recovery). The filegroup is an additional management mechanism that you can use to rearrange groups of files if you have multiple files assigned to your database. In your case, with only a single .mdf file, you'll only have the default filegroup. If the filegroup is running out of space, it's probably referring to the data file on your D: drive, but it could be that you have limited file growth on one or both files which could also spawn the error. I don't understand wht you mean by "What login is this?" These are files stored on disks and have no relations directly to logins in your SQL Server instance.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

pits avatar image pits commented ·
my mistake,the question supposed to be "What logic is this",thank you Grant,
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.