Monday, March 26, 2012

Model Database Log Huge - Can I delete?

My disk space is full on my server. My SQL Server modellog.ldf and
modellog$4IDR are both over 8 GB each and growing exponentially. Can I
delete these files safely?Hi
You would have to find out why these are changin! Normally you would not
touch the model database at all. You may want to swap in a model database
from an instance that has the same collation. Check out
http://support.microsoft.com/kb/224071/
John
<heebe@.hotmail.com> wrote in message
news:1154872503.159164.104260@.h48g2000cwc.googlegroups.com...
> My disk space is full on my server. My SQL Server modellog.ldf and
> modellog$4IDR are both over 8 GB each and growing exponentially. Can I
> delete these files safely?
>|||Thanks for the message. I tried shrinking the database, but no luck.
The tables internally look uneventful but the database says its size is
8 GB. SQL Server won't allow the detach of the Model database. Any
thoughts?
John Bell wrote:
> Hi
> You would have to find out why these are changin! Normally you would not
> touch the model database at all. You may want to swap in a model database
> from an instance that has the same collation. Check out
> http://support.microsoft.com/kb/224071/
> John
> <heebe@.hotmail.com> wrote in message
> news:1154872503.159164.104260@.h48g2000cwc.googlegroups.com...
> > My disk space is full on my server. My SQL Server modellog.ldf and
> > modellog$4IDR are both over 8 GB each and growing exponentially. Can I
> > delete these files safely?
> >|||Try setting the recovery model to SIMPLE and shrinking the file:
ALTER DATABASE model SET RECOVERY SIMPLE
GO
USE model
GO
DBCC SHRINKFILE('modellog', 2)
GO
It is very unusual that the model database data or log files would grow at
all. The database is normally used only as a template for creating new
databases. Make sure you don't have any renegade applications using the
database.
--
Hope this helps.
Dan Guzman
SQL Server MVP
<heebe@.hotmail.com> wrote in message
news:1154888521.842024.194280@.i42g2000cwa.googlegroups.com...
> Thanks for the message. I tried shrinking the database, but no luck.
> The tables internally look uneventful but the database says its size is
> 8 GB. SQL Server won't allow the detach of the Model database. Any
> thoughts?
>
> John Bell wrote:
>> Hi
>> You would have to find out why these are changin! Normally you would not
>> touch the model database at all. You may want to swap in a model database
>> from an instance that has the same collation. Check out
>> http://support.microsoft.com/kb/224071/
>> John
>> <heebe@.hotmail.com> wrote in message
>> news:1154872503.159164.104260@.h48g2000cwc.googlegroups.com...
>> > My disk space is full on my server. My SQL Server modellog.ldf and
>> > modellog$4IDR are both over 8 GB each and growing exponentially. Can I
>> > delete these files safely?
>> >
>|||Thanks. Tried that. I even looked each of the tables in model and
nothing has more than 300 records. Nonetheless, it is still at 8 GB.
I ran a spyware check, nothing.
Dan Guzman wrote:
> Try setting the recovery model to SIMPLE and shrinking the file:
> ALTER DATABASE model SET RECOVERY SIMPLE
> GO
> USE model
> GO
> DBCC SHRINKFILE('modellog', 2)
> GO
> It is very unusual that the model database data or log files would grow at
> all. The database is normally used only as a template for creating new
> databases. Make sure you don't have any renegade applications using the
> database.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> <heebe@.hotmail.com> wrote in message
> news:1154888521.842024.194280@.i42g2000cwa.googlegroups.com...
> > Thanks for the message. I tried shrinking the database, but no luck.
> > The tables internally look uneventful but the database says its size is
> > 8 GB. SQL Server won't allow the detach of the Model database. Any
> > thoughts?
> >
> >
> > John Bell wrote:
> >> Hi
> >>
> >> You would have to find out why these are changin! Normally you would not
> >> touch the model database at all. You may want to swap in a model database
> >> from an instance that has the same collation. Check out
> >> http://support.microsoft.com/kb/224071/
> >>
> >> John
> >>
> >> <heebe@.hotmail.com> wrote in message
> >> news:1154872503.159164.104260@.h48g2000cwc.googlegroups.com...
> >> > My disk space is full on my server. My SQL Server modellog.ldf and
> >> > modellog$4IDR are both over 8 GB each and growing exponentially. Can I
> >> > delete these files safely?
> >> >
> >|||So DBCC SHRINKFILE didn't reduce the file size? Strange...what messages
were returned?
--
Hope this helps.
Dan Guzman
SQL Server MVP
<heebe@.hotmail.com> wrote in message
news:1154917305.948015.219490@.m79g2000cwm.googlegroups.com...
> Thanks. Tried that. I even looked each of the tables in model and
> nothing has more than 300 records. Nonetheless, it is still at 8 GB.
> I ran a spyware check, nothing.
>
> Dan Guzman wrote:
>> Try setting the recovery model to SIMPLE and shrinking the file:
>> ALTER DATABASE model SET RECOVERY SIMPLE
>> GO
>> USE model
>> GO
>> DBCC SHRINKFILE('modellog', 2)
>> GO
>> It is very unusual that the model database data or log files would grow
>> at
>> all. The database is normally used only as a template for creating new
>> databases. Make sure you don't have any renegade applications using the
>> database.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> <heebe@.hotmail.com> wrote in message
>> news:1154888521.842024.194280@.i42g2000cwa.googlegroups.com...
>> > Thanks for the message. I tried shrinking the database, but no luck.
>> > The tables internally look uneventful but the database says its size is
>> > 8 GB. SQL Server won't allow the detach of the Model database. Any
>> > thoughts?
>> >
>> >
>> > John Bell wrote:
>> >> Hi
>> >>
>> >> You would have to find out why these are changin! Normally you would
>> >> not
>> >> touch the model database at all. You may want to swap in a model
>> >> database
>> >> from an instance that has the same collation. Check out
>> >> http://support.microsoft.com/kb/224071/
>> >>
>> >> John
>> >>
>> >> <heebe@.hotmail.com> wrote in message
>> >> news:1154872503.159164.104260@.h48g2000cwc.googlegroups.com...
>> >> > My disk space is full on my server. My SQL Server modellog.ldf and
>> >> > modellog$4IDR are both over 8 GB each and growing exponentially.
>> >> > Can I
>> >> > delete these files safely?
>> >> >
>> >
>|||You may need to back up the transaction log before shrinking.
Then backup log again with the truncate only option i.e
BACKUP LOG MODEL WITH TRUNCATE_ONLY
The try the DBCC Shrinkfile command again.
<heebe@.hotmail.com> wrote in message
news:1154917305.948015.219490@.m79g2000cwm.googlegroups.com...
> Thanks. Tried that. I even looked each of the tables in model and
> nothing has more than 300 records. Nonetheless, it is still at 8 GB.
> I ran a spyware check, nothing.
>
> Dan Guzman wrote:
>> Try setting the recovery model to SIMPLE and shrinking the file:
>> ALTER DATABASE model SET RECOVERY SIMPLE
>> GO
>> USE model
>> GO
>> DBCC SHRINKFILE('modellog', 2)
>> GO
>> It is very unusual that the model database data or log files would grow
>> at
>> all. The database is normally used only as a template for creating new
>> databases. Make sure you don't have any renegade applications using the
>> database.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> <heebe@.hotmail.com> wrote in message
>> news:1154888521.842024.194280@.i42g2000cwa.googlegroups.com...
>> > Thanks for the message. I tried shrinking the database, but no luck.
>> > The tables internally look uneventful but the database says its size is
>> > 8 GB. SQL Server won't allow the detach of the Model database. Any
>> > thoughts?
>> >
>> >
>> > John Bell wrote:
>> >> Hi
>> >>
>> >> You would have to find out why these are changin! Normally you would
>> >> not
>> >> touch the model database at all. You may want to swap in a model
>> >> database
>> >> from an instance that has the same collation. Check out
>> >> http://support.microsoft.com/kb/224071/
>> >>
>> >> John
>> >>
>> >> <heebe@.hotmail.com> wrote in message
>> >> news:1154872503.159164.104260@.h48g2000cwc.googlegroups.com...
>> >> > My disk space is full on my server. My SQL Server modellog.ldf and
>> >> > modellog$4IDR are both over 8 GB each and growing exponentially.
>> >> > Can I
>> >> > delete these files safely?
>> >> >
>> >
>|||Hi
You may want to check that these files are actually being used by the
model database also check for currently open transactions:
USE MODEL
GO
EXEC sp_helpfile
GO
DBCC OPENTRAN ( 'Model' )
GO
John
heebe@.hotmail.com wrote:
> Thanks. Tried that. I even looked each of the tables in model and
> nothing has more than 300 records. Nonetheless, it is still at 8 GB.
> I ran a spyware check, nothing.
>
> Dan Guzman wrote:
> > Try setting the recovery model to SIMPLE and shrinking the file:
> >
> > ALTER DATABASE model SET RECOVERY SIMPLE
> > GO
> > USE model
> > GO
> > DBCC SHRINKFILE('modellog', 2)
> > GO
> >
> > It is very unusual that the model database data or log files would grow at
> > all. The database is normally used only as a template for creating new
> > databases. Make sure you don't have any renegade applications using the
> > database.
> >
> > --
> > Hope this helps.
> >
> > Dan Guzman
> > SQL Server MVP
> >
> > <heebe@.hotmail.com> wrote in message
> > news:1154888521.842024.194280@.i42g2000cwa.googlegroups.com...
> > > Thanks for the message. I tried shrinking the database, but no luck.
> > > The tables internally look uneventful but the database says its size is
> > > 8 GB. SQL Server won't allow the detach of the Model database. Any
> > > thoughts?
> > >
> > >
> > > John Bell wrote:
> > >> Hi
> > >>
> > >> You would have to find out why these are changin! Normally you would not
> > >> touch the model database at all. You may want to swap in a model database
> > >> from an instance that has the same collation. Check out
> > >> http://support.microsoft.com/kb/224071/
> > >>
> > >> John
> > >>
> > >> <heebe@.hotmail.com> wrote in message
> > >> news:1154872503.159164.104260@.h48g2000cwc.googlegroups.com...
> > >> > My disk space is full on my server. My SQL Server modellog.ldf and
> > >> > modellog$4IDR are both over 8 GB each and growing exponentially. Can I
> > >> > delete these files safely?
> > >> >
> > >

No comments:

Post a Comment