Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir,

I am using sql server 2005 and my database size is 200gb and the log size goes on expand more than 300gb on the other drive many time disk gets full.

I have shrink the log within two days .

i am unable to trace why the log size expand so fast whats goes wrong.

i usually take the full backup of the databse it contains transaction log too my database using full recover mode.

What I have tried:

USE mydb

GO -- Set database recovery model to SIMPLE.

ALTER DATABASE SPARCIM SET RECOVERY SIMPLE

GO

-- Shrink the truncated log file to 4 MB.

DBCC SHRINKFILE (mydb_Log, 4)
DBCC SHRINKFILE (mydb_Log2, 4)

GO

-- Set database recovery model to FULL.

ALTER DATABASE mydb SET RECOVERY FULL
Posted
Updated 21-Apr-16 1:04am
Comments
ZurdoDev 20-Apr-16 8:23am    
Why are you using Full Recovery mode? If you use Simple, the log will stop growing so big.
deeptul 20-Apr-16 23:53pm    
Thanks sir
CHill60 20-Apr-16 8:24am    
"i am unable to trace why the log size expand so fast whats goes wrong" - it depends on what you are doing with your database!
Have a look at Transaction Log Management e.g. Transaction Log Management[^]
Richard Deeming 20-Apr-16 8:33am    
You say you're taking a full backup, but are you taking transaction log backups as well? If you don't, the log file will just keep growing.

Either schedule regular transaction log backups in between your full backups, or switch to simple recovery mode as Ryan suggested.
deeptul 20-Apr-16 23:54pm    
Thanks to your solution i will move to simple recovery mode.

1 solution

It is due to your recovery mode being full. You can either do full correctly (also backup the log) or change to simple. But use this info to make your decision, Recovery Models (SQL Server)[^]
 
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