Re:logfiles grow non-stop in SQL2000




Hi Hari,

this is fantastic advice. Thanks!

this is a production database. I am planning of setting up Log Shipping
(some time in the future) so the DB has to stay in the FULL or BULK_LOGGED
mode. Until then I tried setting up logfile backups (did it through a
maintenance plan) but their size wouldn't shrink. On the contrary all I
managed to do it to have a huge logfile and huge logfile backup!!! Let's say
that I want to stay in FULL/BULK_LOGGED mode, make logfile backups
periodically (once or twice a day would be enough) and shrink the logfile
after the backup. Do I have to run a special command to do this? Can I
schedule it to happen automatically?

million thanks!
christos


"Hari Prasad" wrote:
>
> Hi Chris,
>
> Looks like the recovery model for your database is FULL or BULK_LOGGED.Please change the recovery model for the database to
> SIMPLE if your database is non production. Use the below command to set the database to SIMPLE.
>
>
> ALTER database <DBNAME> set recovery SIMPLE
>
>
> If you do not have the 65 G to take a backup or if you do not want the transaction log backup. You could truncate the transaction
> log and shrink the LDF file.
>
>
> backup log <dbname> with truncate_only
> go
> DBCC SHRINKFILE (db1_log1_logical_name,truncat­eonly)
>
>
> If you need the transaction log backup do:-
>
>
> backup log <dbname> to disk='d:\backup\dbname.trn'
> go
> DBCC SHRINKFILE (db1_log1_logical_name,truncat­eonly)
>
>
> Now execute the below command to see log file size and usage.
>
>
> DBCC SQLPERF(LOGSPACE)
>
>
> Note:
>
>
> If you need to keep the recovery model to FULL then schedule a transaction log backup in frequent intervals (atleast 30 minutes once).
> This will keep the log file size under control.
>
> Thanks
> Hari
> SQL Server MVP
>
>
> ____________________________________
> Christos Kritikos Wrote:
>
> Hello,
>
> I am running SQL 2000 Enterprise (with all the updates) on a Win2000 Std
> Server. This DB is part of a webiste that includes users loging-in etc - so
> the DB is accessed by the webservers.
>
> The logfiles for the most frequently-used databases grow non-stop. If I
> don't do anything about it they will just grow until I run out of disk space!
> I tried to limit the maximum logfile size (through enterprise manager) but
> the result is that the DB becomes inaccessible when the logfile hits the
> limit. Is this normal? I am reading some documents that SQL sever is supposed
> to re-use the unnecessary part of the logfiles. How come this doesn't happen?
>
> I went through KB 317375 (Transaction Log Grows Unexpectedly or Becomes Full
> on SQL Server). It lists a number of reasons that may cause this problem. How
> can I figure out if some of these conditions apply in my case? Just by
> reading through them it seems as if they don't apply, but I may be mistaken.
>
> Million thanks for the help. I have been struggling with this for days!
>
> christos
>
>
>
>
>
>
>
>
> Sent via SreeSharp NewsReader http://www.SreeSharp.com
>
.



Relevant Pages

  • Re: does anyone know file backup operation?
    ... POINT-IN-TIME means recover database to a specific point of time. ... Say you have a Finance database, You have transaction log backup till 10 AM. ... > Thanks in advance Hari ...
    (microsoft.public.sqlserver.clients)
  • Re: Need Some Quick SBS/Exchange Help!
    ... This logfile has been damaged and is unusable. ... Information Store First Storage Group: Corruption was detected during ... about only 14mb free space in the Exchange database so I think I am bucking ...
    (microsoft.public.windows.server.sbs)
  • Re:logfiles grow non-stop in SQL2000
    ... Looks like the recovery model for your database is FULL or BULK_LOGGED.Please change the recovery model for the database to ... If you do not have the 65 G to take a backup or if you do not want the transaction log backup. ... The logfiles for the most frequently-used databases grow non-stop. ...
    (microsoft.public.sqlserver.setup)
  • RE: What is the best practice to create Maintenance Plans
    ... > If master is damaged in some way, for example because of media failure, an ... > With the Simple Recovery model, the database can be recovered to the point ... > Full Recovery or Bulk-Logged Recovery model. ... > Transaction Log backup for master database is not allowed. ...
    (microsoft.public.sqlserver.security)
  • Re: implementing a database log
    ... adding recovery/logging, and i have some practical questions about the ... pro: logfile is slim, very fine-grained control ... the database is corrupt. ...
    (comp.databases.theory)