July 20, 2007 at 6:26 pm
I inherited a SQL database and just discovered my modellog.ldf file is just shy of 4 GBs. I have no idea what is writing to this log, but its way to big to open in Notepad.
Any ideas on a text editor or something upon which I can view this log to determine what is writing to it & clean things up.
Thanks,
Rolf
July 20, 2007 at 10:35 pm
This is not a log text file but is part of the so called model database consisting of model.mdf and modellog.ldf which SQL Server uses as a template to create new databases. It looks like someone has been using this database to load and manipulate data which is definitely not a good idea. You should use Query Analyzer and its object browser (F8) and check if it contains user tables (which it shouldn't). It should contain only system tables.
July 21, 2007 at 5:14 am
Maybe it was created like that to make sure that all newly created Dbs had at least 4 gigs of log files. That would make sens on a lot of systems.
July 21, 2007 at 5:36 am
It could make sense on a server where you frequently create databases and you want to have a log file 'ready to go'. But my first reaction is to be suspicious.
July 21, 2007 at 6:09 am
Good point, but the fact is that if the other guy is not around anymore, it'll be hard to get this answser from him.
July 21, 2007 at 10:20 am
Heh... if you find the "other guy", give him a punch in the nose for me, huh
I agree with Michael... step 1 should be to see if there are any user tables in the Model Database... Don't just delete these, though... there may be some process somewhere that relies on them being in Model... will definitely take a bit of research if you find some.
So far as the Model LDF file goes, the default size is about a half meg... shrink the file to that size and then monitor it... perhaps there's some code somewhere that is using the Model DB (shouldn't be) and that's causing the LDF file to grow. If the LDF file for model grows after you shrink it (even just 1 byte), you're gonna need to check all the stored procs to see if the address the Model database... you're also gonna need to check all the application code (Java, C#, etc, etc) to see if anyone is using the Model database.
To be clear (you already know this... I'm just saying it to be 100% sure), no one should be writing code to write anything to the Model DB EVER! And, it should be a very rare thing to anything that reads from the Model DB.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply