Monday, February 20, 2012

Large LDF File

My LDF file is 1.8GB big and my data file is only about 100mb big. I have had
the recovery model set to full until recently which is probably why it has
ended up so big. I have now changed that to simple. Now no matter what I do
the LDF file stays at exactly 1,785,856 KB in size. I have tried backing up
the database and backing up the transaction log but neither have made any
difference to the size of the file. Even using the database doesn't appear to
make any difference to the file size. Can you please advise me as to what I
can do to shrink this file and get it working again.
Many Thanks.
Look up DBCC SHRINKFILE in BOL.
"Boxwell" <Boxwell@.discussions.microsoft.com> wrote in message
news:25DB49E4-46C3-48E2-9B2F-1984B11E0216@.microsoft.com...
> My LDF file is 1.8GB big and my data file is only about 100mb big. I have
> had
> the recovery model set to full until recently which is probably why it has
> ended up so big. I have now changed that to simple. Now no matter what I
> do
> the LDF file stays at exactly 1,785,856 KB in size. I have tried backing
> up
> the database and backing up the transaction log but neither have made any
> difference to the size of the file. Even using the database doesn't appear
> to
> make any difference to the file size. Can you please advise me as to what
> I
> can do to shrink this file and get it working again.
> Many Thanks.
|||Run => DBCC sqlperf(logspace), list the % of logspace used
Run => backup transaction DBNAME with no_log
BOL =>NO_LOG | TRUNCATE_ONLY
Removes the inactive part of the log without making a backup copy of it and
truncates the log. This option frees space. Specifying a backup device is
unnecessary because the log backup is not saved. NO_LOG and TRUNCATE_ONLY
are synonyms.
Run => DBCC sqlperf(logspace)
To Add on to this, to save disk space you need to run,
sp_helpdb 'dbname' => get logical log name of file.
DBCC SHRINKFILE ('DBNAME_Log',0) => this will release dsik space...
Thanks,
Sree
"Boxwell" wrote:

> My LDF file is 1.8GB big and my data file is only about 100mb big. I have had
> the recovery model set to full until recently which is probably why it has
> ended up so big. I have now changed that to simple. Now no matter what I do
> the LDF file stays at exactly 1,785,856 KB in size. I have tried backing up
> the database and backing up the transaction log but neither have made any
> difference to the size of the file. Even using the database doesn't appear to
> make any difference to the file size. Can you please advise me as to what I
> can do to shrink this file and get it working again.
> Many Thanks.

No comments:

Post a Comment