Thursday, October 1, 2009

Shrink SQL Transaction Log file ldf

--If the transaction log file has grown large the following steps can be taken.
option 1
--To back the transaction log file with no truncate optin and shrink the file this is not
--recommended because there could be a data loss, this can be avoided if can take a backup
--immediately after the shrink is completed. I have the code posted in my blog.

option 2
check the database properties --- options --- if the recovery is set to simple
and the Autoshrink to True.

We had a scenario where the ldf file has grown to 600 GB, we had the nightly and transaction back up set, but since the recovery was set to full and autoshrink was false this has increased to 600 GB.
With the setting of option2 this worked and brought back the log file to 1 GB.

1 comment:

  1. looks nice. but have you ever heard about another way of repair dbf files, provided by appropriate data recovery services?

    ReplyDelete