Large transaction logs

Posted on 2006-05-23
Last Modified: 2008-02-26
Good morning all

Currently, i have 2 servers with transaction logs of 21GB (on a 34GB drive) and 41GB (on two drives - 21 and 20) . Both have unexpectedly jumped size and i now face the dilemma of 2 choices : installing an fresh set of drives or trying to prune them in some way. With limited disk space, though, they won't shrink any more and my question comes to this :

Can i truncate the log without damaging the actual database then shrink ? If so, how to, especially on the database with the two log files ? Mind you it has been storing transactions for the past 5 years and no-one sat down to fix it.
db_Log is on a RAID5 with 800mb free.
db_Log2 is on a single drive with 10GB free.
I do have the flexibility of 3 drives that i have sitting beside me at the moment

Any solutions ?

Cheers !
Question by:AlexD_Gr
    LVL 142

    Accepted Solution

    >Can i truncate the log without damaging the actual database then shrink ?
    however, the best would be to backup the transaction log though, and then shrink it (this will avoid data loss in case of crash).

    to avoid such a increase, you should have regular transaction log backup in place on the database (possibly, you can use the disk you have beside you for exactly that...), this will keep it from growing.
    LVL 2

    Author Comment

    The log itself is set to grow @ 150mb so as to avoid similar problems that the company had in the past as well as removing the default 7% that MS SQL has from start - 7% @ 21GB is deadly when you have small drives.

    Backup - i.e. detach db and copy log.ldf over somewhere else ? (just to be 100% certain)
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    >Backup - i.e. detach db and copy log.ldf over somewhere else ? (just to be 100% certain)

    that is one possibilty, although you don't need to do it that way (as it requires db downtime)
    LVL 2

    Author Comment

    server essentially isn't used after 6pm so it's all mine
    LVL 2

    Author Comment

    Thanks angelIII - all's well !

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Changing the order of columns 9 58
    surrogate key in database world 6 61
    wordpress to database 2 49
    Remove duplicate from left join 6 47
    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    Creating and Managing Databases with phpMyAdmin in cPanel.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now