Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 mdf structure

Author  Topic 

Jude_Aj
Starting Member

22 Posts

Posted - 2009-01-17 : 02:49:24
Hi,
I am trying to understand the structure of the .mdf file in sql server 2000. Can anybody help me in that direction.I spent the whole day browsing the net for it with little success.
Any help would be appreciated.

Thanks in advance.

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2009-01-17 : 03:50:02
These are good places to look:
http://sqlskills.com/blogs/paul
http://blogs.msdn.com/sqlserverstorageengine/default.aspx

The entire mdf file is divided into 8kb chunks - pages and objects, headers, allocation information are stored on one or more pages within the file


--
Gail Shaw
SQL Server MVP
Go to Top of Page

Jude_Aj
Starting Member

22 Posts

Posted - 2009-01-17 : 06:54:29
Hi,
Thanks for replying Gail . What i am trying to do is read an mdf file in a hex editor.I am trying to understand the file format.
Can please direct me in doing so.
Thanks
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-01-17 : 11:13:29
It is dangerous if it is allowed.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-01-17 : 14:28:21
Books Online has a couple of good entries on page structures, describing GAM, SGAM, PFS and data pages, and also some details on index pages. Check those out.

You can also use the DBCC PAGE command to look at the data. It's undocumented but you can find examples through Google and the Inside SQL Server Storage Engine book. There are a few options that format the data in different ways to make it more readable that a straight hex dump. Plus you don't risk accidentally overwriting data like a hex editor might.
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2009-01-17 : 16:26:30
quote:
Originally posted by Jude_Aj

What i am trying to do is read an mdf file in a hex editor.


Why?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

Jude_Aj
Starting Member

22 Posts

Posted - 2009-01-19 : 09:32:56
Hey guys...thanks a lot for your help. i was really stuck at one time.I guess i am moving some where now with this research.By the way,I am doing a research on how data is maintained in different database softwares as part of my final year project.
thanks once again,
cheers!!

Go to Top of Page
   

- Advertisement -