How to reduce the size of ASPNETDB.mdf from 250MB????

Last post 02-06-2009 10:25 PM by chumble. 3 replies.

Sort Posts:

  • How to reduce the size of ASPNETDB.mdf from 250MB????

    02-03-2009, 1:35 PM
    • Member
      90 point Member
    • chumble
    • Member since 03-06-2006, 6:52 PM
    • London, UK
    • Posts 21

    I've posted this question in another forum here so forgive the cross posting.

    I have found myself with an ASPNETDB.MDF file of over 250MB in size.

    It contains many tens on thousands of users and their profile information.  I no longer need some of this profile information and I no longer require the anonymous users.

    I've attempted ProfileManager.DeleteInactiveProfiles(....)  and this leaves the size of the file intact.

    I've written my own C# to go through all users and delete out the unwanted Profile entries.

    I cannot seem to bring the file sizes down (if I get a reduction in the MDF file I get an equivalent increase in the LDF file despite changing its Recovery mode to Simple).

    Any clues??

    Many thanks

    Clive.

  • Re: How to reduce the size of ASPNETDB.mdf from 250MB????

    02-04-2009, 1:42 AM
    • Member
      2 point Member
    • gmsaiful
    • Member since 10-18-2007, 8:28 AM
    • Posts 2

     See each table consumed/free space by 

    exec sp_spaceused TableName
     Following link will help you more Link
    Gazi Md Saiful Islam
  • Re: How to reduce the size of ASPNETDB.mdf from 250MB????

    02-05-2009, 3:27 AM

    Hi chumble,

    Before deleting the data in database, I suggest you to check which tables take a big space. Then try to analyze what data takes a big space and whether it's needed. Finally, you could think about how to clear the unused data. If you need any further help, you could tell us more details so that we can help you better.

    But note, before you do any operations to database, I suggest you to backup it first. 

    Thanks.

    David Qian
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: How to reduce the size of ASPNETDB.mdf from 250MB????

    02-06-2009, 10:25 PM
    Answer
    • Member
      90 point Member
    • chumble
    • Member since 03-06-2006, 6:52 PM
    • London, UK
    • Posts 21
    I'll be doing some tests over the weekend. The table(s) in question is/are within the ASPNETDB.MDF namely aspnet_Profile and aspnet_Users . The Profile information is duplicated within another database. I think what has happened is the ASP Membership profile feature was used initially in development, as the user data increased it was moved to another MDF file but the code was left in the project. Now the site has many tens of thousands of registered users I've seeking to reduce the ASP membership database to solely authenticate. I just cannot seem to purge the superflous Profile data from the database! In fact, my last test grew the Logfile to some 160MB!!!! Thanks for taking time for me, guys. I'm going to clear the table over the weekend (!) and get more details and hopefully we can proceed. Cheers.
Page 1 of 1 (4 items)