Results 1 to 4 of 4

Thread: Log file

  1. #1
    Join Date
    Oct 2003
    Posts
    83

    Question Unanswered: Log file

    How can I get the names of Log Files for a particular database?And how can I truncate or shrink the log files in SQL SERVER?

  2. #2
    Join Date
    Jan 2003
    Location
    Nottinghamshire, UK
    Posts
    364
    Right click on DB & look @ Properties 2 get LogFile Name
    & Run
    Backup Log 'DBName' WITH Truncate_Only

    GW
    "Everything should be made as simple as possible, but not simpler." - Albert Einstein
    "Everything should be made as complex as possible, so I look Cleverer." - Application Developer

  3. #3
    Join Date
    Feb 2003
    Location
    @ home
    Posts
    163

    Re: Log file

    To see the log file name do as GWilliy wrote.
    To truncate teh log you can force a maximum value for the log file but that it's not the best way to keep it small. It better to implement some mantainence plans that backup and shrink the database log file.


    Originally posted by subhasishray
    How can I get the names of Log Files for a particular database?And how can I truncate or shrink the log files in SQL SERVER?

  4. #4
    Join Date
    Oct 2001
    Location
    Naples, FL
    Posts
    273
    To see the files (including MDF and LDF) you can run

    sp_helpfile

    If you do not require transactional recovery you can run

    backup log dbname with truncate_only

    And you can set the recovery mode to simple to keep the log small.

    If you do require transactional recovery, schedule regular T-log backups. If you want transactional recovery, be careful with shrinking the log file as it is a performance hit when SQL has to allocate more space to grow the log when it is too small.

    HTH
    ---------------
    Ray Higdon MCSE, MCDBA, CCNA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •