DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Kristin Piskulic Guest

    Shrinking databases


    I ran the Optimization portion of my DB Maintenance Plan this morning and
    my .MDF and .LDF files are still large. How do I reduce these in size?

    Database Size: 4,934 MB
    Available Space: 3,965 MB

    If it matters, here are the settings for the optimization of this database:
    Reorganize data & index pages
    Change free space per page to 10%

    Remove unused space from db files
    Shrink db when it grows beyond 50 MB
    Amount of free space to remain after shrink - 10% of the data space

    Also, in general: Is it better to check the "Reorganize pages with the original
    amount of free space" instead of "Change free space per page to 10%"?

    Thanks,
    Kristin Piskulic


  2. #2
    Krishna Guest

    Re: Shrinking databases


    Hi Kristin,

    Try using the following:

    DBCC SHRINKDATABASE (DBName, 10)

    The above decreases the size of the files in the DBName database to allow
    10 percent free space in the files of DBName.


    OR Use this:

    USE DBName
    GO
    DBCC SHRINKFILE (DataFile, 50)
    GO

    This example shrinks the size of a file named DataFile in the DBName user
    database to 50 MB.


    Cheers.


    Krishna Pada Das
    MCDBA




    "Kristin Piskulic" <kpiskulic@microcon.com> wrote:
    >
    >I ran the Optimization portion of my DB Maintenance Plan this morning and
    >my .MDF and .LDF files are still large. How do I reduce these in size?
    >
    >Database Size: 4,934 MB
    >Available Space: 3,965 MB
    >
    >If it matters, here are the settings for the optimization of this database:
    > Reorganize data & index pages
    > Change free space per page to 10%
    >
    > Remove unused space from db files
    > Shrink db when it grows beyond 50 MB
    > Amount of free space to remain after shrink - 10% of the data space
    >
    >Also, in general: Is it better to check the "Reorganize pages with the

    original
    >amount of free space" instead of "Change free space per page to 10%"?
    >
    >Thanks,
    >Kristin Piskulic
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links