Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 DB Shrinking

Author  Topic 

Dinky
Starting Member

37 Posts

Posted - 2007-12-14 : 16:35:19
I am new to SQL server.

We have many databases for which log files have grown much bigger. The one I need to Shrink immediately has 16 MB .mdf file and 12 GB of .ldf file.

I will very much appreciate, if somebody can help me with step by step process to shrink the database/log file (some way). We are in a crunch situation

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-12-14 : 16:37:24
What is your recovery model set to? If FULL, are you performing regular transaction log backups? We backup our transaction logs every 15 minutes.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

laddu
Constraint Violating Yak Guru

332 Posts

Posted - 2007-12-14 : 21:06:47

You can create your own job and in the job step you can mention the below command,
Backup log DatabaseName with truncate_only


If you wish to curtail the log file growth it is better to change the recovery model to Simple but you cannot have point in time recovery. If you have Full Recovery take regular T-log backups to prevent the log file growth. Refer the below link which provides the reason for the transaction log getting filled up, http://support.microsoft.com/kb/110139.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-12-14 : 23:25:26
Don't truncate log if you need point of time db recovery.
Go to Top of Page
   

- Advertisement -