Click here to Skip to main content
15,798,592 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
my sql server 2008 was very slow when select or insert or... and deadlock error occurs.
How to Clear Database Transaction Log File? or compress?
pls help me

Clearing the transaction log isn't the right way to go. Nor is compressing it. At worse this can lead to a situation where you cannot restore your database anymore until next full backup is made.

First, check what is the recovery model of the database. If it is full then ensure that you make full and transaction log backups regularly. For the concepts see:[^]

The cause for the system slow response time can be quite frankly anything. Investigate the workload, CPU usage, memory usage, possible paging on the server, disk queue lengths and so on. When you have identified the bottleneck then start investigating the reason and corrective actions.
Share this answer
I am aware this is a late answer, but I hope it will be useful for other readers

I agree with Mika and suggest you take a full backup first.

Be aware when compressing a t-log file as you may lose a ton of data that may come as a live saver in case of disaster.

To point you in the right direction, I recommend reading this thread:
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900