Re: Shrink File?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Sebastian K. Zaklada (szaklada-dont-like-spam_at_skilledsoftware.com)
Date: 03/12/04


Date: Fri, 12 Mar 2004 17:24:21 +0100

Joshua Campbell wrote:
> The first link talks about creating dummy transactions. Is this
> script safe? Also, since I'm new, I don't really know what I'm
> supposed to change in that script. Can you point out what I need to
> change?

Yes, it is perfectly safe.
You need to change this lines in script (lines below are copied from the
oryginal KB article for easier reference):

-- *** MAKE SURE TO CHANGE THE NEXT 4 LINES WITH YOUR CRITERIA. ***
   USE [Test DB] -- This is the name of the database
                                  -- for which the log will be shrunk.
   SELECT @LogicalFileName = 'Test DB Log', -- Use sp_helpfile to
      -- identify the logical file
      -- name that you want to shrink.

Check to see if the log has shrunk from its original size.Repeat the
preceding steps if necessary. If the log is not shrinking, re-check the
summary at the top of the article to see if you are encountering any of the
common issues with shrinking the log.After the log shrinks:
  1.. Perform a full database backup of the master database.
  2.. Perform a full database backup of the user database. This is necessary
because the SHRINK command is not logged and invalidates future transaction
log backups unless a full database backup is completed.
sincerely,

--
Sebastian K. Zaklada
Skilled Software
http://www.skilledsoftware.com
This posting is provided "AS IS" with no warranties, and confers no rights.


Relevant Pages